Go to the documentation of this file.
14 #ifndef __NNS_PLUGIN_API_FILTER_H__
15 #define __NNS_PLUGIN_API_FILTER_H__
20 #define ACCL_NONE_STR "none"
21 #define ACCL_DEFAULT_STR "default"
22 #define ACCL_AUTO_STR "auto"
23 #define ACCL_CPU_STR "cpu"
24 #define ACCL_CPU_SIMD_STR "cpu.simd"
25 #define ACCL_CPU_NEON_STR "cpu.neon"
26 #define ACCL_GPU_STR "gpu"
28 #define ACCL_NPU_STR "npu"
29 #define ACCL_NPU_MOVIDIUS_STR "npu.movidius"
30 #define ACCL_NPU_EDGE_TPU_STR "npu.edgetpu"
31 #define ACCL_NPU_VIVANTE_STR "npu.vivante"
32 #define ACCL_NPU_SRCN_STR "npu.srcn"
33 #define ACCL_NPU_SLSI_STR "npu.slsi"
34 #define ACCL_NPU_SR_STR "npu.sr"
36 #define GST_TENSOR_FILTER_FRAMEWORK_BASE (0xDEAFDEAD00000000ULL)
37 #define GST_TENSOR_FILTER_FRAMEWORK_V0 (GST_TENSOR_FILTER_FRAMEWORK_BASE)
38 #define GST_TENSOR_FILTER_FRAMEWORK_V1 (GST_TENSOR_FILTER_FRAMEWORK_BASE | 0x10000ULL)
40 #define GST_TENSOR_FILTER_API_VERSION_DEFINED (1)
41 #define GST_TENSOR_FILTER_API_VERSION_MIN (0)
42 #define GST_TENSOR_FILTER_API_VERSION_MAX (1)
47 #define checkGstTensorFilterFrameworkVersion(value, version) \
48 ((GST_TENSOR_FILTER_FRAMEWORK_BASE | ((version) << 16)) == (value & 0xFFFFFFFFFFFF0000ULL))
385 #ifdef NO_ANONYMOUS_NESTED_STRUCT
466 #ifdef NO_ANONYMOUS_NESTED_STRUCT
544 #define parse_accl_hw(...) parse_accl_hw_fill((parse_accl_args){__VA_ARGS__})
578 void (*free_callback) (
void *));
592 void *new_interpreter,
void (*replace_callback) (
void *,
void *),
void (*free_callback) (
void*));
accl_hw
acceleration hw properties.
char * shared_tensor_filter_key
int(* invoke)(const GstTensorFilterFramework *self, GstTensorFilterProperties *prop, void *private_data, const GstTensorMemory *input, GstTensorMemory *output)
int(* invoke_NN)(const GstTensorFilterProperties *prop, void **private_data, const GstTensorMemory *input, GstTensorMemory *output)
int(* getOutputDimension)(const GstTensorFilterProperties *prop, void **private_data, GstTensorsInfo *info)
int(* open)(const GstTensorFilterProperties *prop, void **private_data)
#define NNS_TENSOR_SIZE_LIMIT
The number of tensors NNStreamer supports is 256. The max memories of gst-buffer is 16 (See NNS_TENSO...
void nnstreamer_filter_exit(const char *name)
Filter's sub-plugin may call this to unregister itself.
void(* destroyNotify)(void **private_data, void *data)
int(* getInputDimension)(const GstTensorFilterProperties *prop, void **private_data, GstTensorsInfo *info)
Internal meta data exchange format for a other/tensors instance.
GstTensorSrcIIOChannelProperties * prop
DTYPE_UNSIGNED ( .
const char * custom_properties
const char ** model_files
int64_t total_invoke_latency
Structure definition for tensor-filter framework statistics.
The unit of each data tensors. It will be used as an input/output tensor of other/tensors.
Tensor_Filter Subplugin definition.
tensor_layout tensors_layout[NNS_TENSOR_SIZE_LIMIT]
model_info_ops
Tensor_Filter Subplugin's model related info gathering operations.
void nnstreamer_filter_shared_model_replace(void *instance, const char *key, void *new_interpreter, void(*replace_callback)(void *, void *), void(*free_callback)(void *))
Helper to reload interpreter for instances that has shared key. replace_callback is called iterating ...
tensors_layout input_layout
const GstTensorFilterFramework * nnstreamer_filter_find(const char *name)
Find filter sub-plugin with the name.
int(* eventHandler)(const GstTensorFilterFramework *self, const GstTensorFilterProperties *prop, void *private_data, event_ops ops, GstTensorFilterFrameworkEventData *data)
void nnstreamer_filter_set_custom_property_desc(const char *name, const char *prop,...)
set custom property description for tensor filter sub-plugin
const char ** model_files
void * nnstreamer_filter_shared_model_get(void *instance, const char *key)
Get the shared model representation that is already shared and has the same key.
const char * get_accl_hw_str(const accl_hw key)
return string based on accl_hw type
event_ops
Tensor_Filter Subplugin related events.
Accelerator related arguments for parsing.
int nnstreamer_filter_shared_model_remove(void *instance, const char *key, void(*free_callback)(void *))
Remove the instance registered at the referred list of shared model table. If referred list is empty,...
struct _GstTensorFilterProperties GstTensorFilterProperties
GstTensorFilter's properties for NN framework (internal data structure)
int(* checkAvailability)(accl_hw hw)
enum _nns_tensor_layout tensor_layout
Tensor layout format for other/tensor.
const GstTensorFilterFrameworkStatistics * statistics
Tensor_Filter Subplugin framework related information.
User data for the tensor_tilter subplugin related events.
const GstTensorFilterFrameworkStatistics * statistics
Common header file for NNStreamer, the GStreamer plugin for neural networks.
int nnstreamer_filter_probe(GstTensorFilterFramework *tfsp)
Filter's sub-plugin should call this function to register itself.
int(* reloadModel)(const GstTensorFilterProperties *prop, void **private_data)
struct _GstTensorFilterFrameworkInfo GstTensorFilterFrameworkInfo
Tensor_Filter Subplugin framework related information.
GstTensorFilter's properties for NN framework (internal data structure)
accl_hw parse_accl_hw_fill(parse_accl_args accl_args)
parse user given string to extract accelerator based on given regex filling in optional arguments
GstTensorsInfo output_meta
GstTensorsInfo input_meta
int(* setInputDimension)(const GstTensorFilterProperties *prop, void **private_data, const GstTensorsInfo *in_info, GstTensorsInfo *out_info)
int(* getModelInfo)(const GstTensorFilterFramework *self, const GstTensorFilterProperties *prop, void *private_data, model_info_ops ops, GstTensorsInfo *in_info, GstTensorsInfo *out_info)
unsigned int input_ranks[NNS_TENSOR_SIZE_LIMIT]
int(* allocateInInvoke)(void **private_data)
unsigned int output_ranks[NNS_TENSOR_SIZE_LIMIT]
int(* handleEvent)(event_ops ops, GstTensorFilterFrameworkEventData *data)
struct _GstTensorFilterFrameworkEventData GstTensorFilterFrameworkEventData
User data for the tensor_tilter subplugin related events.
const char * custom_properties
struct _GstTensorFilterFrameworkStatistics GstTensorFilterFrameworkStatistics
Structure definition for tensor-filter framework statistics.
accl_hw get_accl_hw_type(const char *str)
return accl_hw type from string
int64_t total_overhead_latency
void * nnstreamer_filter_shared_model_insert_and_get(void *instance, char *key, void *interpreter)
Insert the new shared model representation and get the value.
int(* getFrameworkInfo)(const GstTensorFilterFramework *self, const GstTensorFilterProperties *prop, void *private_data, GstTensorFilterFrameworkInfo *fw_info)
const GstTensorsInfo * info
void(* close)(const GstTensorFilterProperties *prop, void **private_data)
tensors_layout output_layout