Snapdragon Neural Processing Engine SDK
Reference Guide
|
Enumerations | |
enum | Snpe_Runtime_t { SNPE_RUNTIME_CPU_FLOAT32 = 0, SNPE_RUNTIME_GPU_FLOAT32_16_HYBRID = 1, SNPE_RUNTIME_DSP_FIXED8_TF = 2, SNPE_RUNTIME_GPU_FLOAT16 = 3, SNPE_RUNTIME_AIP_FIXED8_TF = 5 , SNPE_RUNTIME_CPU = SNPE_RUNTIME_CPU_FLOAT32, SNPE_RUNTIME_GPU = SNPE_RUNTIME_GPU_FLOAT32_16_HYBRID, SNPE_RUNTIME_DSP = SNPE_RUNTIME_DSP_FIXED8_TF } |
enum | Snpe_RuntimeCheckOption_t |
enum | Snpe_PerformanceProfile_t { SNPE_PERFORMANCE_PROFILE_DEFAULT = 0 } |
enum | Snpe_ProfilingLevel_t { SNPE_PROFILING_LEVEL_OFF = 0, SNPE_PROFILING_LEVEL_BASIC = 1, SNPE_PROFILING_LEVEL_DETAILED = 2, SNPE_PROFILING_LEVEL_MODERATE = 3 } |
enum | Snpe_ExecutionPriorityHint_t |
enum | Snpe_ImageEncoding_t { , SNPE_IMAGE_ENCODING_RGB = 1, SNPE_IMAGE_ENCODING_ARGB32 = 2, SNPE_IMAGE_ENCODING_RGBA = 3 , SNPE_IMAGE_ENCODING_NV21 = 5, SNPE_IMAGE_ENCODING_BGR = 6 } |
enum | Snpe_LogLevel_t |
enum | Snpe_IOBufferDataType_t |
DlcRecord | |
typedef void * | Snpe_DlcRecord_Handle_t |
SNPE_API Snpe_DlcRecord_Handle_t | Snpe_DlcRecord_Create () |
SNPE_API Snpe_ErrorCode_t | Snpe_DlcRecord_Delete (Snpe_DlcRecord_Handle_t dlcRecordHandle) |
SNPE_API size_t | Snpe_DlcRecord_Size (Snpe_DlcRecord_Handle_t dlcRecordHandle) |
SNPE_API uint8_t * | Snpe_DlcRecord_Data (Snpe_DlcRecord_Handle_t dlcRecordHandle) |
DlContainer | |
typedef void * | Snpe_DlContainer_Handle_t |
SNPE_API Snpe_ErrorCode_t | Snpe_DlContainer_Delete (Snpe_DlContainer_Handle_t dlContainerHandle) |
SNPE_API Snpe_DlContainer_Handle_t | Snpe_DlContainer_Open (const char *filename) |
SNPE_API Snpe_DlContainer_Handle_t | Snpe_DlContainer_OpenBuffer (const uint8_t *buffer, const size_t size) |
SNPE_API Snpe_StringList_Handle_t | Snpe_DlContainer_GetCatalog (Snpe_DlContainer_Handle_t dlContainerHandle) |
SNPE_API Snpe_DlcRecord_Handle_t | Snpe_DlContainer_GetRecord (Snpe_DlContainer_Handle_t dlContainerHandle, const char *recordName) |
SNPE_API Snpe_ErrorCode_t | Snpe_DlContainer_Save (Snpe_DlContainer_Handle_t dlContainerHandle, const char *filename) |
Snpe_ErrorCode | |
enum | Snpe_ErrorCode_t |
SNPE_API void | Snpe_ErrorCode_clearLastErrorCode () |
SNPE_API Snpe_ErrorCode_t | Snpe_ErrorCode_getLastErrorCode () |
SNPE_API const char * | Snpe_ErrorCode_GetLastErrorString () |
SNPE_API const char * | Snpe_ErrorCode_getLastInfoString () |
SNPE_API uint32_t | Snpe_ErrorCode_enumToUInt32 (Snpe_ErrorCode_t code) |
DlVersion | |
typedef void * | Snpe_DlVersion_Handle_t |
SNPE_API Snpe_ErrorCode_t | Snpe_DlVersion_Delete (Snpe_DlVersion_Handle_t handle) |
SNPE_API int32_t | Snpe_DlVersion_GetMajor (Snpe_DlVersion_Handle_t handle) |
SNPE_API int32_t | Snpe_DlVersion_GetMinor (Snpe_DlVersion_Handle_t handle) |
SNPE_API int32_t | Snpe_DlVersion_GetTeeny (Snpe_DlVersion_Handle_t handle) |
SNPE_API const char * | Snpe_DlVersion_GetBuild (Snpe_DlVersion_Handle_t handle) |
SNPE_API const char * | Snpe_DlVersion_ToString (Snpe_DlVersion_Handle_t handle) |
IBufferAttributes | |
typedef void * | Snpe_IBufferAttributes_Handle_t |
SNPE_API size_t | Snpe_IBufferAttributes_GetElementSize (Snpe_IBufferAttributes_Handle_t handle) |
SNPE_API Snpe_UserBufferEncoding_ElementType_t | Snpe_IBufferAttributes_GetEncodingType (Snpe_IBufferAttributes_Handle_t handle) |
SNPE_API Snpe_TensorShape_Handle_t | Snpe_IBufferAttributes_GetDims (Snpe_IBufferAttributes_Handle_t handle) |
SNPE_API Snpe_TensorShape_Handle_t | Snpe_IBufferAttributes_GetAlignments (Snpe_IBufferAttributes_Handle_t handle) |
SNPE_API Snpe_UserBufferEncoding_Handle_t | Snpe_IBufferAttributes_GetEncoding_Ref (Snpe_IBufferAttributes_Handle_t handle) |
SNPE_API Snpe_ErrorCode_t | Snpe_IBufferAttributes_Delete (Snpe_IBufferAttributes_Handle_t handle) |
IDiagLog | |
typedef void * | Snpe_IDiagLog_Handle_t |
SNPE_API Snpe_ErrorCode_t | Snpe_IDiagLog_SetOptions (Snpe_IDiagLog_Handle_t handle, Snpe_Options_Handle_t loggingOptionsHandle) |
SNPE_API Snpe_Options_Handle_t | Snpe_IDiagLog_GetOptions (Snpe_IDiagLog_Handle_t handle) |
SNPE_API Snpe_ErrorCode_t | Snpe_IDiagLog_SetDiagLogMask (Snpe_IDiagLog_Handle_t handle, const char *mask) |
SNPE_API Snpe_ErrorCode_t | Snpe_IDiagLog_Start (Snpe_IDiagLog_Handle_t handle) |
SNPE_API Snpe_ErrorCode_t | Snpe_IDiagLog_Stop (Snpe_IDiagLog_Handle_t handle) |
IOBufferDataTypeMap | |
typedef void * | Snpe_IOBufferDataTypeMap_Handle_t |
SNPE_API Snpe_IOBufferDataTypeMap_Handle_t | Snpe_IOBufferDataTypeMap_Create () |
SNPE_API Snpe_ErrorCode_t | Snpe_IOBufferDataTypeMap_Delete (Snpe_IOBufferDataTypeMap_Handle_t handle) |
SNPE_API Snpe_ErrorCode_t | Snpe_IOBufferDataTypeMap_Add (Snpe_IOBufferDataTypeMap_Handle_t handle, const char *name, Snpe_IOBufferDataType_t bufferDataType) |
SNPE_API Snpe_ErrorCode_t | Snpe_IOBufferDataTypeMap_Remove (Snpe_IOBufferDataTypeMap_Handle_t handle, const char *name) |
SNPE_API Snpe_IOBufferDataType_t | Snpe_IOBufferDataTypeMap_GetBufferDataType (Snpe_IOBufferDataTypeMap_Handle_t handle, const char *name) |
SNPE_API size_t | Snpe_IOBufferDataTypeMap_Size (Snpe_IOBufferDataTypeMap_Handle_t handle) |
SNPE_API int | Snpe_IOBufferDataTypeMap_Find (Snpe_IOBufferDataTypeMap_Handle_t handle, const char *name) |
SNPE_API int | Snpe_IOBufferDataTypeMap_Empty (Snpe_IOBufferDataTypeMap_Handle_t handle) |
ITensor | |
typedef void * | Snpe_ITensor_Handle_t |
SNPE_API Snpe_ErrorCode_t | Snpe_ITensor_Delete (Snpe_ITensor_Handle_t iTensorHandle) |
SNPE_API void * | Snpe_ITensor_GetData (Snpe_ITensor_Handle_t tensorHandle) |
SNPE_API Snpe_TensorShape_Handle_t | Snpe_ITensor_GetShape (Snpe_ITensor_Handle_t tensorHandle) |
SNPE_API size_t | Snpe_ITensor_GetSize (Snpe_ITensor_Handle_t tensorHandle) |
PlatformValidator | |
typedef void * | Snpe_PlatformValidator_Handle_t |
SNPE_API Snpe_PlatformValidator_Handle_t | Snpe_PlatformValidator_Create () |
SNPE_API Snpe_ErrorCode_t | Snpe_PlatformValidator_Delete (Snpe_PlatformValidator_Handle_t handle) |
SNPE_API void | Snpe_PlatformValidator_SetRuntime (Snpe_PlatformValidator_Handle_t handle, Snpe_Runtime_t runtime) |
SNPE_API int | Snpe_PlatformValidator_IsRuntimeAvailable (Snpe_PlatformValidator_Handle_t handle) |
SNPE_API const char * | Snpe_PlatformValidator_GetCoreVersion (Snpe_PlatformValidator_Handle_t handle) |
SNPE_API const char * | Snpe_PlatformValidator_GetLibVersion (Snpe_PlatformValidator_Handle_t handle) |
SNPE_API int | Snpe_PlatformValidator_RuntimeCheck (Snpe_PlatformValidator_Handle_t handle) |
RuntimeList | |
typedef void * | Snpe_RuntimeList_Handle_t |
SNPE_API Snpe_RuntimeList_Handle_t | Snpe_RuntimeList_Create () |
SNPE_API Snpe_ErrorCode_t | Snpe_RuntimeList_Delete (Snpe_RuntimeList_Handle_t runtimeListHandle) |
SNPE_API Snpe_Runtime_t | Snpe_RuntimeList_GetRuntime (Snpe_RuntimeList_Handle_t runtimeListHandle, int index) |
SNPE_API Snpe_ErrorCode_t | Snpe_RuntimeList_Add (Snpe_RuntimeList_Handle_t runtimeListHandle, Snpe_Runtime_t runtime) |
SNPE_API Snpe_ErrorCode_t | Snpe_RuntimeList_Remove (Snpe_RuntimeList_Handle_t runtimeListHandle, Snpe_Runtime_t runtime) |
SNPE_API size_t | Snpe_RuntimeList_Size (Snpe_RuntimeList_Handle_t runtimeListHandle) |
SNPE_API int | Snpe_RuntimeList_Empty (Snpe_RuntimeList_Handle_t runtimeListHandle) |
SNPE_API Snpe_ErrorCode_t | Snpe_RuntimeList_Clear (Snpe_RuntimeList_Handle_t runtimeListHandle) |
SNPE_API Snpe_Runtime_t | Snpe_RuntimeList_StringToRuntime (const char *str) |
SNPE_API const char * | Snpe_RuntimeList_RuntimeToString (Snpe_Runtime_t runtime) |
StringList | |
typedef void * | Snpe_StringList_Handle_t |
SNPE_API Snpe_StringList_Handle_t | Snpe_StringList_Create () |
SNPE_API Snpe_StringList_Handle_t | Snpe_StringList_CreateSize (size_t size) |
SNPE_API Snpe_StringList_Handle_t | Snpe_StringList_CreateCopy (Snpe_StringList_Handle_t other) |
SNPE_API Snpe_ErrorCode_t | Snpe_StringList_Delete (Snpe_StringList_Handle_t stringListHandle) |
SNPE_API Snpe_ErrorCode_t | Snpe_StringList_Append (Snpe_StringList_Handle_t stringListHandle, const char *string) |
SNPE_API const char * | Snpe_StringList_At (Snpe_StringList_Handle_t stringListHandle, size_t idx) |
SNPE_API const char ** | Snpe_StringList_Begin (Snpe_StringList_Handle_t stringListHandle) |
SNPE_API const char ** | Snpe_StringList_End (Snpe_StringList_Handle_t stringListHandle) |
SNPE_API size_t | Snpe_StringList_Size (Snpe_StringList_Handle_t stringListHandle) |
SNPE_API Snpe_ErrorCode_t | Snpe_StringList_Assign (Snpe_StringList_Handle_t src, Snpe_StringList_Handle_t dst) |
TensorMap | |
typedef void * | Snpe_TensorMap_Handle_t |
SNPE_API Snpe_TensorMap_Handle_t | Snpe_TensorMap_Create () |
SNPE_API Snpe_ErrorCode_t | Snpe_TensorMap_Delete (Snpe_TensorMap_Handle_t handle) |
SNPE_API void | Snpe_TensorMap_Add (Snpe_TensorMap_Handle_t handle, const char *name, Snpe_ITensor_Handle_t tensorHandle) |
SNPE_API void | Snpe_TensorMap_Remove (Snpe_TensorMap_Handle_t handle, const char *name) |
SNPE_API size_t | Snpe_TensorMap_Size (Snpe_TensorMap_Handle_t handle) |
SNPE_API void | Snpe_TensorMap_Clear (Snpe_TensorMap_Handle_t handle) |
SNPE_API Snpe_ITensor_Handle_t | Snpe_TensorMap_GetTensor_Ref (Snpe_TensorMap_Handle_t handle, const char *name) |
SNPE_API Snpe_StringList_Handle_t | Snpe_TensorMap_GetTensorNames (Snpe_TensorMap_Handle_t handle) |
TensorShape | |
typedef void * | Snpe_TensorShape_Handle_t |
SNPE_API Snpe_TensorShape_Handle_t | Snpe_TensorShape_CreateDimsSize (const size_t *dims, size_t size) |
SNPE_API Snpe_TensorShape_Handle_t | Snpe_TensorShape_Create () |
SNPE_API Snpe_TensorShape_Handle_t | Snpe_TensorShape_CreateCopy (Snpe_TensorShape_Handle_t other) |
SNPE_API Snpe_ErrorCode_t | Snpe_TensorShape_Delete (Snpe_TensorShape_Handle_t tensorShapeHandle) |
SNPE_API Snpe_ErrorCode_t | Snpe_TensorShape_Assign (Snpe_TensorShape_Handle_t srcHandle, Snpe_TensorShape_Handle_t dstHandle) |
SNPE_API void | Snpe_TensorShape_Concatenate (Snpe_TensorShape_Handle_t tensorShape, size_t *dims, size_t size) |
SNPE_API size_t | Snpe_TensorShape_Rank (Snpe_TensorShape_Handle_t tensorShape) |
SNPE_API size_t | Snpe_TensorShape_At (Snpe_TensorShape_Handle_t tensorShapeHandle, size_t index) |
SNPE_API const size_t * | Snpe_TensorShape_GetDimensions (Snpe_TensorShape_Handle_t tensorShape) |
This module defines the SNPE C APIs
typedef void* Snpe_DlContainer_Handle_t |
A typedef to indicate a SNPE DlContainer handle
typedef void* Snpe_DlcRecord_Handle_t |
A typedef to indicate a SNPE DlcRecord handle
typedef void* Snpe_DlVersion_Handle_t |
A class that contains the different portions of a version number. A typedef to indicate a SNPE DlVersion handle
typedef void* Snpe_IBufferAttributes_Handle_t |
A typedef to indicate a SNPE IBufferAttributes handle
typedef void* Snpe_IDiagLog_Handle_t |
A typedef to indicate a SNPE IDiagLog handle
typedef void* Snpe_IOBufferDataTypeMap_Handle_t |
A typedef to indicate a SNPE IOBufferDataTypeMap handle
typedef void* Snpe_ITensor_Handle_t |
Represents a tensor which holds n-dimensional data. It is important to understand how the tensor data is represented in memory relative to the tensor dimensions. Tensors store data in memory in row-major order (i.e. the last tensor dimension is the fastest varying one). For example, if you have a two dimensional tensor with 3 rows and 2 columns (i.e. the tensor dimensions are 3,2 as returned in tensor dimension vectors) with the following data in terms rows and columns:
| 1 2 |
| 3 4 |
| 5 6 |
This data would be stored in memory as 1,2,3,4,5,6.
typedef void* Snpe_IUserBuffer_Handle_t |
A typedef to indicate a SNPE IUserBuffer handle UserBuffer contains a pointer and info on how to walk it and interpret its content.
typedef void* Snpe_Options_Handle_t |
A typedef to indicate a SNPE Options handle
typedef void* Snpe_PlatformConfig_Handle_t |
A typedef to indicate a SNPE PlatformConfig handle
typedef void* Snpe_PlatformValidator_Handle_t |
A typedef to indicate a SNPE PlatformValidator handle
typedef void* Snpe_RuntimeList_Handle_t |
A typedef to indicate a SNPE RuntimeList handle
typedef void* Snpe_SNPE_Handle_t |
A typedef to indicate a SNPE handle
typedef void* Snpe_SNPEBuilder_Handle_t |
A typedef to indicate a SNPEBuilder handle
typedef void* Snpe_StringList_Handle_t |
A typedef to indicate a SNPE StringList handle
typedef void* Snpe_TensorMap_Handle_t |
A typedef to indicate a SNPE Tensor Map handle
typedef void* Snpe_TensorShape_Handle_t |
A typedef to indicate a SNPE TensorShape handle
typedef void* Snpe_TensorShapeMap_Handle_t |
A typedef to indicate a SNPE TensorShapeMap handle
typedef void* Snpe_UserBufferEncoding_Handle_t |
A typedef to indicate a SNPE UserByfferEncoding handle
typedef void* Snpe_UserBufferMap_Handle_t |
A typedef to indicate a SNPE UserBufferMap handle
typedef void* Snpe_UserBufferSource_Handle_t |
A base class buffer source type
typedef void* Snpe_UserGLConfig_Handle_t |
A structure OpenGL configuration
typedef void* Snpe_UserGpuConfig_Handle_t |
A structure Gpu configuration
typedef void* Snpe_UserMemoryMap_Handle_t |
A typedef to indicate a SNPE User Memory handle
enum Snpe_ErrorCode_t |
enum Snpe_ImageEncoding_t |
Enumeration that lists the supported image encoding formats.
Enumeration that list the supported data types for buffers
enum Snpe_LogLevel_t |
Enumeration that lists the supported LogLevels that can be set by users.
Enumeration of various performance profiles that can be requested.
Enumeration of various profilngLevels that can be requested.
enum Snpe_Runtime_t |
Enumeration of supported target runtimes.
Enumeration of runtime available check options.
An enum class of all supported element types in a IUserBuffer
SNPE_API Snpe_ErrorCode_t Snpe_DlContainer_Delete | ( | Snpe_DlContainer_Handle_t | dlContainerHandle | ) |
Destroys/frees a DlContainer
[in] | dlContainerHandle | : Handle to access DlContainer |
SNPE_API Snpe_StringList_Handle_t Snpe_DlContainer_GetCatalog | ( | Snpe_DlContainer_Handle_t | dlContainerHandle | ) |
Get the record catalog for a container.
[in] | dlContainerHandle | : Handle to access DlContainer |
SNPE_API Snpe_DlcRecord_Handle_t Snpe_DlContainer_GetRecord | ( | Snpe_DlContainer_Handle_t | dlContainerHandle, |
const char * | recordName | ||
) |
Get a record from a container by name.
[in] | dlContainerHandle | : Handle to access DlContainer |
[in] | recordName | : Name of the record to fetch. |
SNPE_API Snpe_DlContainer_Handle_t Snpe_DlContainer_Open | ( | const char * | filename | ) |
Initializes a container from a container archive file.
[in] | filename | Container archive file path. |
SNPE_API Snpe_DlContainer_Handle_t Snpe_DlContainer_OpenBuffer | ( | const uint8_t * | buffer, |
const size_t | size | ||
) |
Initializes a container from a byte buffer.
[in] | buffer | Byte buffer holding the contents of an archive file. |
[in] | size | Size of the byte buffer. |
SNPE_API Snpe_ErrorCode_t Snpe_DlContainer_Save | ( | Snpe_DlContainer_Handle_t | dlContainerHandle, |
const char * | filename | ||
) |
Save the container to an archive on disk. This function will save the container if the filename is different from the file that it was opened from, or if at least one record was modified since the container was opened.
It will truncate any existing file at the target path.
[in] | dlContainerHandle | : Handle to access DlContainer |
[in] | filename | : Container archive file path. |
SNPE_API Snpe_DlcRecord_Handle_t Snpe_DlcRecord_Create | ( | ) |
Constructs a DlcRecord and returns a handle to it
SNPE_API uint8_t* Snpe_DlcRecord_Data | ( | Snpe_DlcRecord_Handle_t | dlcRecordHandle | ) |
Gets a pointer to the start of the DlcRecord's data
[in] | dlcRecordHandle | : Handle to access DlcRecord |
SNPE_API Snpe_ErrorCode_t Snpe_DlcRecord_Delete | ( | Snpe_DlcRecord_Handle_t | dlcRecordHandle | ) |
Destroys/frees a DlcRecord
[in] | dlcRecordHandle | : Handle to access DlcRecord |
SNPE_API size_t Snpe_DlcRecord_Size | ( | Snpe_DlcRecord_Handle_t | dlcRecordHandle | ) |
Gets the size of a DlcRecord in bytes
[in] | dlcRecordHandle | : Handle to access DlcRecord |
SNPE_API Snpe_ErrorCode_t Snpe_DlVersion_Delete | ( | Snpe_DlVersion_Handle_t | handle | ) |
Destroys/frees DlVersion
[in] | handle | : Handle to access DlVersion |
SNPE_API const char* Snpe_DlVersion_GetBuild | ( | Snpe_DlVersion_Handle_t | handle | ) |
Get the string holding information about the build version.
[in] | handle | : Handle to access DlVersion |
SNPE_API int32_t Snpe_DlVersion_GetMajor | ( | Snpe_DlVersion_Handle_t | handle | ) |
Get the major version number.
[in] | handle | : Handle to access DlVersion |
SNPE_API int32_t Snpe_DlVersion_GetMinor | ( | Snpe_DlVersion_Handle_t | handle | ) |
Get the minor version number.
[in] | handle | : Handle to access DlVersion |
SNPE_API int32_t Snpe_DlVersion_GetTeeny | ( | Snpe_DlVersion_Handle_t | handle | ) |
Get the teeny version number.
[in] | handle | : Handle to access DlVersion |
SNPE_API const char* Snpe_DlVersion_ToString | ( | Snpe_DlVersion_Handle_t | handle | ) |
Returns a string in the form Major.Minor.Teeny.Build.
[in] | handle | : Handle to access DlVersion |
SNPE_API void Snpe_ErrorCode_clearLastErrorCode | ( | ) |
Clear the last error code
SNPE_API uint32_t Snpe_ErrorCode_enumToUInt32 | ( | Snpe_ErrorCode_t | code | ) |
Returns the uint32_t representation of the error code enum.
[in] | code | The error code to be converted. |
SNPE_API Snpe_ErrorCode_t Snpe_ErrorCode_getLastErrorCode | ( | ) |
Returns the error code of the last error encountered.
SNPE_API const char* Snpe_ErrorCode_GetLastErrorString | ( | ) |
Returns the error string of the last error encountered.
SNPE_API const char* Snpe_ErrorCode_getLastInfoString | ( | ) |
Returns the info string of the last error encountered.
SNPE_API Snpe_ErrorCode_t Snpe_IBufferAttributes_Delete | ( | Snpe_IBufferAttributes_Handle_t | handle | ) |
Destroys the IBufferAttributes object.
[handle] | handle : Handle to access IBufferAttributes |
SNPE_API Snpe_TensorShape_Handle_t Snpe_IBufferAttributes_GetAlignments | ( | Snpe_IBufferAttributes_Handle_t | handle | ) |
Gets the alignment requirement of each dimension.
Alignment per each dimension is expressed as an multiple, for example, if one particular dimension can accept multiples of 8, the alignment will be 8.
[in] | handle | : Handle to access IBufferAttributes |
SNPE_API Snpe_TensorShape_Handle_t Snpe_IBufferAttributes_GetDims | ( | Snpe_IBufferAttributes_Handle_t | handle | ) |
Gets the number of elements in each dimension.
[in] | handle | : Handle to access IBufferAttributes |
SNPE_API size_t Snpe_IBufferAttributes_GetElementSize | ( | Snpe_IBufferAttributes_Handle_t | handle | ) |
Gets the buffer's element size, in bytes.
This can be used to compute the memory size required to back this buffer.
[in] | handle | : Handle to access IBufferAttributes |
SNPE_API Snpe_UserBufferEncoding_Handle_t Snpe_IBufferAttributes_GetEncoding_Ref | ( | Snpe_IBufferAttributes_Handle_t | handle | ) |
Gets the buffer encoding returned from the network responsible for generating this buffer. Depending on the encoding type, this will be an instance of an encoding type specific derived class.
[in] | handle | : Handle to access IBufferAttributes |
SNPE_API Snpe_UserBufferEncoding_ElementType_t Snpe_IBufferAttributes_GetEncodingType | ( | Snpe_IBufferAttributes_Handle_t | handle | ) |
Gets the element's encoding type.
[in] | handle | : Handle to access IBufferAttributes |
SNPE_API Snpe_Options_Handle_t Snpe_IDiagLog_GetOptions | ( | Snpe_IDiagLog_Handle_t | handle | ) |
Gets the curent options for the diag logger.
[in] | handle | : Handle to access IDiagLog |
SNPE_API Snpe_ErrorCode_t Snpe_IDiagLog_SetDiagLogMask | ( | Snpe_IDiagLog_Handle_t | handle, |
const char * | mask | ||
) |
[in] | handle | : Handle to access IDiagLog |
[in] | mask | : Allows for setting the log mask once diag logging has started |
SNPE_API Snpe_ErrorCode_t Snpe_IDiagLog_SetOptions | ( | Snpe_IDiagLog_Handle_t | handle, |
Snpe_Options_Handle_t | loggingOptionsHandle | ||
) |
Sets the options after initialization occurs.
[in] | handle | : Handle to access IDiagLog |
[in] | loggingOptions | : The options to set up diagnostic logging. |
SNPE_API Snpe_ErrorCode_t Snpe_IDiagLog_Start | ( | Snpe_IDiagLog_Handle_t | handle | ) |
Enables logging.
Logging should be started prior to the instantiation of other SNPE_APIs to ensure all events are captured.
[in] | handle | : Handle to access IDiagLog |
SNPE_API Snpe_ErrorCode_t Snpe_IDiagLog_Stop | ( | Snpe_IDiagLog_Handle_t | handle | ) |
Disables logging.
[in] | handle | : Handle to access IDiagLog |
SNPE_API Snpe_ErrorCode_t Snpe_IOBufferDataTypeMap_Add | ( | Snpe_IOBufferDataTypeMap_Handle_t | handle, |
const char * | name, | ||
Snpe_IOBufferDataType_t | bufferDataType | ||
) |
Adds a name and the corresponding buffer data type to the map.
[in] | handle | : Handle to access the IOBufferDataType map |
[in] | name | : The name of the buffer |
[in] | bufferDataType | : data type of the buffer |
SNPE_API Snpe_IOBufferDataTypeMap_Handle_t Snpe_IOBufferDataTypeMap_Create | ( | ) |
Creates a new Buffer Data type map
SNPE_API Snpe_ErrorCode_t Snpe_IOBufferDataTypeMap_Delete | ( | Snpe_IOBufferDataTypeMap_Handle_t | handle | ) |
Destroys the map.
[in] | handle | : Handle to access the IOBufferDataType map |
SNPE_API int Snpe_IOBufferDataTypeMap_Empty | ( | Snpe_IOBufferDataTypeMap_Handle_t | handle | ) |
Checks whether the map is empty.
SNPE_API int Snpe_IOBufferDataTypeMap_Find | ( | Snpe_IOBufferDataTypeMap_Handle_t | handle, |
const char * | name | ||
) |
Checks the existence of the named buffer in the map.
[in] | handle | : Handle to access the IOBufferDataType map |
[in] | name | : The name of the buffer |
SNPE_API Snpe_IOBufferDataType_t Snpe_IOBufferDataTypeMap_GetBufferDataType | ( | Snpe_IOBufferDataTypeMap_Handle_t | handle, |
const char * | name | ||
) |
Returns the type of the named buffer.
[in] | handle | : Handle to access the IOBufferDataType map |
[in] | name | : The name of the buffer |
SNPE_API Snpe_ErrorCode_t Snpe_IOBufferDataTypeMap_Remove | ( | Snpe_IOBufferDataTypeMap_Handle_t | handle, |
const char * | name | ||
) |
Removes a buffer name from the map.
[in] | handle | : Handle to access the IOBufferDataType map |
[in] | name | : The name of the buffer |
SNPE_API size_t Snpe_IOBufferDataTypeMap_Size | ( | Snpe_IOBufferDataTypeMap_Handle_t | handle | ) |
Returns the size of the buffer type map.
[in] | handle | : Handle to access the IOBufferDataType map |
SNPE_API Snpe_ErrorCode_t Snpe_ITensor_Delete | ( | Snpe_ITensor_Handle_t | iTensorHandle | ) |
Destroys/frees an ITensor
[in] | userBufferHandle | : Handle to access the IUserBuffer |
SNPE_API void* Snpe_ITensor_GetData | ( | Snpe_ITensor_Handle_t | tensorHandle | ) |
Returns a tensor iterator pointing to the beginning of the data in the tensor.
[in] | tensorHandle | : Handle to access ITensor |
SNPE_API Snpe_TensorShape_Handle_t Snpe_ITensor_GetShape | ( | Snpe_ITensor_Handle_t | tensorHandle | ) |
Gets the shape of this tensor.
The last element of the vector represents the fastest varying dimension and the zeroth element represents the slowest varying dimension, etc.
[in] | tensorHandle | : Handle to access ITensor |
SNPE_API size_t Snpe_ITensor_GetSize | ( | Snpe_ITensor_Handle_t | tensorHandle | ) |
Returns the element size of the data in the tensor (discounting strides). This is how big a buffer would need to be to hold the tensor data contiguously in memory.
[in] | tensorHandle | : Handle to access ITensor |
SNPE_API Snpe_ErrorCode_t Snpe_IUserBuffer_Delete | ( | Snpe_IUserBuffer_Handle_t | userBufferHandle | ) |
Destroys/frees an IUserBuffer
[in] | userBufferHandle | : Handle to access the IUserBuffer |
SNPE_API Snpe_UserBufferEncoding_Handle_t Snpe_IUserBuffer_GetEncoding_Ref | ( | Snpe_IUserBuffer_Handle_t | userBufferHandle | ) |
Gets a reference to the data encoding object of the underlying buffer.
This is necessary when the UserBuffer is re-used, and the encoding parameters can change. For example, each input can be quantized with different step sizes.
[in] | userBufferHandle | : Handle to access the user Buffer |
SNPE_API size_t Snpe_IUserBuffer_GetOutputSize | ( | Snpe_IUserBuffer_Handle_t | userBufferHandle | ) |
Retrieves the size of the inference data in the buffer, in bytes.
The inference results from a dynamic-sized model may not be exactly the same size as the UserBuffer provided to SNPE. This function can be used to get the amount of output inference data, which may be less or greater than the size of the UserBuffer.
If the inference results fit in the UserBuffer, getOutputSize() would be less than or equal to getSize(). But if the inference results were more than the capacity of the provided UserBuffer, the results would be truncated to fit the UserBuffer. But, getOutputSize() would be greater than getSize(), which indicates a bigger buffer needs to be provided to SNPE to hold all of the inference results.
[in] | userBufferHandle | : Handle to access the user Buffer |
SNPE_API size_t Snpe_IUserBuffer_GetSize | ( | Snpe_IUserBuffer_Handle_t | userBufferHandle | ) |
Retrieves the size of the buffer, in bytes.
[in] | userBufferHandle | : Handle to access the user Buffer |
SNPE_API Snpe_TensorShape_Handle_t Snpe_IUserBuffer_GetStrides_Ref | ( | Snpe_IUserBuffer_Handle_t | userBufferHandle | ) |
Retrieves the total number of bytes between elements in each dimension if the buffer were to be interpreted as a multi-dimensional array.
[in] | userBufferHandle | : Handle to access the user Buffer |
SNPE_API int Snpe_IUserBuffer_SetBufferAddress | ( | Snpe_IUserBuffer_Handle_t | userBufferHandle, |
void * | buffer | ||
) |
Changes the underlying memory that backs the UserBuffer.
This can be used to avoid creating multiple UserBuffer objects when the only thing that differs is the memory location.
[in] | userBufferHandle | : Handle to access the user Buffer |
[in] | buffer | : Pointer to the memory location |
SNPE_API Snpe_ErrorCode_t Snpe_Options_Delete | ( | Snpe_Options_Handle_t | handle | ) |
Destroys/frees a Options
[in] | handle | : Handle to access Options object |
SNPE_API const char* Snpe_Options_GetDiagLogMask | ( | Snpe_Options_Handle_t | handle | ) |
Gets DiagLogMask diagLogMask: Enables diag logging only on the specified area mask
[in] | handle | : Handle to access Options object |
SNPE_API const char* Snpe_Options_GetLogFileDirectory | ( | Snpe_Options_Handle_t | handle | ) |
Gets logFileDirectory logFileDirectory: The path to the directory where log files will be written. The path may be relative or absolute. Relative paths are interpreted
[in] | handle | : Handle to access Options object |
SNPE_API const char* Snpe_Options_GetLogFileName | ( | Snpe_Options_Handle_t | handle | ) |
Gets logFileName logFileName: The name used for log files. If this value is empty then BaseName will be used as the default file name.
[in] | handle | : Handle to access Options object |
SNPE_API int Snpe_Options_GetLogFileReplace | ( | Snpe_Options_Handle_t | handle | ) |
If the log file already exists, control whether it will be replaced
[in] | handle | : Handle to access options object |
SNPE_API uint32_t Snpe_Options_GetLogFileRotateCount | ( | Snpe_Options_Handle_t | handle | ) |
Gets the maximum number of log files to create. If set to 0 no log rotation will be used and the log file name specified will be used each time, overwriting any existing log file that may exist.
[in] | handle | : Handle to access options object. |
SNPE_API void Snpe_Options_SetDiagLogMask | ( | Snpe_Options_Handle_t | handle, |
const char * | diagLogMask | ||
) |
Sets DiagLogMask diagLogMask: Enables diag logging only on the specified area mask
[in] | handle | : Handle to access Options object |
[in] | diagLogMask | : specific area where logging needs to be enabed |
SNPE_API void Snpe_Options_SetLogFileDirectory | ( | Snpe_Options_Handle_t | handle, |
const char * | logFileDirectory | ||
) |
Sets logFileDirectory logFileDirectory: The path to the directory where log files will be written. The path may be relative or absolute. Relative paths are interpreted
[in] | handle | : Handle to access Options object |
[in] | logFileDirectory | : path for saving the log files |
SNPE_API void Snpe_Options_SetLogFileName | ( | Snpe_Options_Handle_t | handle, |
const char * | logFileName | ||
) |
Sets logFileName logFileName: The name used for log files. If this value is empty then BaseName will be used as the default file name.
[in] | handle | : Handle to access Options object |
[in] | logFileName | : name of log file |
SNPE_API void Snpe_Options_SetLogFileReplace | ( | Snpe_Options_Handle_t | handle, |
int | logFileReplace | ||
) |
If the log file already exists, control whether it will be replaced
[in] | handle | : Handle to access options object |
[in] | logFileReplace | : 1 if log file to be replaced, 0 otherwise |
SNPE_API void Snpe_Options_SetLogFileRotateCount | ( | Snpe_Options_Handle_t | handle, |
uint32_t | logFileRotateCount | ||
) |
Sets the maximum number of log files to create. If set to 0 no log rotation will be used and the log file name specified will be used each time, overwriting any existing log file that may exist.
[in] | handle | : Handle to access options object. |
[in] | logFileRotateCount | : max log files to create |
SNPE_API Snpe_PlatformConfig_Handle_t Snpe_PlatformConfig_Create | ( | ) |
Creates a new PlatformConfig
SNPE_API Snpe_ErrorCode_t Snpe_PlatformConfig_Delete | ( | Snpe_PlatformConfig_Handle_t | handle | ) |
Destroys the PlatformConfig.
[in] | handle | : Handle needed to access the platformConfig |
SNPE_API const char* Snpe_PlatformConfig_GetPlatformOptions | ( | Snpe_PlatformConfig_Handle_t | handle | ) |
Gets the platform options.
[in] | handle | : Handle needed to access the platformConfig |
SNPE_API Snpe_PlatformConfig_PlatformType_t Snpe_PlatformConfig_GetPlatformType | ( | Snpe_PlatformConfig_Handle_t | handle | ) |
Retrieves the platform type.
[in] | handle | : Handle needed to access the platformConfig |
SNPE_API Snpe_UserGpuConfig_Handle_t Snpe_PlatformConfig_GetUserGpuConfig | ( | Snpe_PlatformConfig_Handle_t | handle | ) |
Retrieves the Gpu configuration.
[in] | handle | : Handle needed to access the platformConfig |
SNPE_API int Snpe_PlatformConfig_IsOptionsValid | ( | Snpe_PlatformConfig_Handle_t | handle | ) |
Indicates whther the plaform configuration is valid.
[in] | handle | : Handle needed to access the platformConfig |
SNPE_API int Snpe_PlatformConfig_IsValid | ( | Snpe_PlatformConfig_Handle_t | handle | ) |
Indicates whther the plaform configuration is valid.
[in] | handle | : Handle needed to access the platformConfig |
SNPE_API int Snpe_PlatformConfig_RemovePlatformOptionValue | ( | Snpe_PlatformConfig_Handle_t | handle, |
const char * | optionName, | ||
const char * | value | ||
) |
Removes the platform options.
[in] | handle | : Handle needed to access the platformConfig |
[in] | optionName | : Name of platform options" |
[in] | value | : Value of specified optionName |
SNPE_API int Snpe_PlatformConfig_SetPlatformOptions | ( | Snpe_PlatformConfig_Handle_t | handle, |
const char * | options | ||
) |
Sets the platform options.
[in] | handle | : Handle needed to access the platformConfig |
[in] | options | : Options as a const char* in the form of "keyword:options" |
SNPE_API int Snpe_PlatformConfig_SetPlatformOptionValue | ( | Snpe_PlatformConfig_Handle_t | handle, |
const char * | optionName, | ||
const char * | value | ||
) |
Sets the platform options.
[in] | handle | : Handle needed to access the platformConfig |
[in] | optionName | : Name of platform options" |
[in] | value | : Value of specified optionName |
SNPE_API int Snpe_PlatformConfig_SetUserGpuConfig | ( | Snpe_PlatformConfig_Handle_t | handle, |
Snpe_UserGpuConfig_Handle_t | gpuHandle | ||
) |
Sets the Gpu configuration.
[in] | handle | : Handle needed to access the platformConfig |
[in] | gpuHandle | : Gpu Configuration handle |
SNPE_API Snpe_PlatformValidator_Handle_t Snpe_PlatformValidator_Create | ( | ) |
Creates a new Platform Validator
SNPE_API Snpe_ErrorCode_t Snpe_PlatformValidator_Delete | ( | Snpe_PlatformValidator_Handle_t | handle | ) |
Destroys/frees Platform Validator
[in] | handle | : Handle to access Platform Validator |
SNPE_API const char* Snpe_PlatformValidator_GetCoreVersion | ( | Snpe_PlatformValidator_Handle_t | handle | ) |
Returns the core version for the Runtime selected.
SNPE_API const char* Snpe_PlatformValidator_GetLibVersion | ( | Snpe_PlatformValidator_Handle_t | handle | ) |
Returns the library version for the Runtime selected.
SNPE_API int Snpe_PlatformValidator_IsRuntimeAvailable | ( | Snpe_PlatformValidator_Handle_t | handle | ) |
Checks if the Runtime prerequisites for SNPE are available.
SNPE_API int Snpe_PlatformValidator_RuntimeCheck | ( | Snpe_PlatformValidator_Handle_t | handle | ) |
Runs a small program on the runtime and Checks if SNPE is supported for Runtime.
SNPE_API void Snpe_PlatformValidator_SetRuntime | ( | Snpe_PlatformValidator_Handle_t | handle, |
Snpe_Runtime_t | runtime | ||
) |
Sets the runtime processor for compatibility check.
SNPE_API Snpe_ErrorCode_t Snpe_RuntimeList_Add | ( | Snpe_RuntimeList_Handle_t | runtimeListHandle, |
Snpe_Runtime_t | runtime | ||
) |
Adds runtime to the end of the runtime list order of precedence is former followed by latter entry.
[in] | runtimeListHandle | Handle needed to access the runtimeList |
[in] | runtime | to add |
SNPE_API Snpe_ErrorCode_t Snpe_RuntimeList_Clear | ( | Snpe_RuntimeList_Handle_t | runtimeListHandle | ) |
Removes all runtime from the list
[in] | runtimeListHandle | Handle needed to access the runtimeList |
SNPE_API Snpe_RuntimeList_Handle_t Snpe_RuntimeList_Create | ( | ) |
Creates a new runtime list
SNPE_API Snpe_ErrorCode_t Snpe_RuntimeList_Delete | ( | Snpe_RuntimeList_Handle_t | runtimeListHandle | ) |
Destroys the RuntimeList.
[in] | runtimeListHandle | : Handle needed to access the runtimeList |
SNPE_API int Snpe_RuntimeList_Empty | ( | Snpe_RuntimeList_Handle_t | runtimeListHandle | ) |
Returns 1 if the list is empty.
[in] | runtimeListHandle | Handle needed to access the runtimeList |
SNPE_API Snpe_Runtime_t Snpe_RuntimeList_GetRuntime | ( | Snpe_RuntimeList_Handle_t | runtimeListHandle, |
int | index | ||
) |
Returns the Runtime from list at position index.
[in] | runtimeListHandle | Handle needed to access the runtimeList |
[in] | index | : position in runtimeList |
SNPE_API Snpe_ErrorCode_t Snpe_RuntimeList_Remove | ( | Snpe_RuntimeList_Handle_t | runtimeListHandle, |
Snpe_Runtime_t | runtime | ||
) |
Removes the runtime from the list.
[in] | runtimeListHandle | Handle needed to access the runtimeList |
[in] | runtime | to be removed |
SNPE_API const char* Snpe_RuntimeList_RuntimeToString | ( | Snpe_Runtime_t | runtime | ) |
[in] | runtime | Returns a const char* corresponding to the in param runtime enum |
SNPE_API size_t Snpe_RuntimeList_Size | ( | Snpe_RuntimeList_Handle_t | runtimeListHandle | ) |
Returns the number of runtimes in the list.
[in] | runtimeListHandle | Handle needed to access the runtimeList |
SNPE_API Snpe_Runtime_t Snpe_RuntimeList_StringToRuntime | ( | const char * | str | ) |
[in] | runtime | const char* Returns a Runtime enum corresponding to the in param string |
SNPE_API Snpe_ErrorCode_t Snpe_SNPE_Delete | ( | Snpe_SNPE_Handle_t | snpeHandle | ) |
Destroys/frees a SNPE object
[in] | snpeHandle | Handle to access the SNPE object |
SNPE_API Snpe_ErrorCode_t Snpe_SNPE_DeregisterIonBuffers | ( | Snpe_SNPE_Handle_t | snpeHandle, |
Snpe_StringList_Handle_t | ionBufferNamesHandle | ||
) |
Deregister Client ION Buffers.
[in] | snpeHandle | Handle to access the SNPE object |
[in] | ionBufferNamesHandle | A StringList of ION Buffer names |
SNPE_API Snpe_ErrorCode_t Snpe_SNPE_ExecuteITensors | ( | Snpe_SNPE_Handle_t | snpeHandle, |
Snpe_TensorMap_Handle_t | inputHandle, | ||
Snpe_TensorMap_Handle_t | outputHandle | ||
) |
Processes the input data and returns the output.
[in] | snpeHandle | Handle to access the SNPE object |
[in] | inputHandle | A map of tensors that contains the input data for each input. The names of tensors needs to be matched with names retrieved through getInputTensorNames() |
[in,out] | outputHandle | An empty map of tensors that will contain the output data of potentially multiple layers (the key in the map is the layer name) upon return |
SNPE_API Snpe_ErrorCode_t Snpe_SNPE_ExecuteUserBuffers | ( | Snpe_SNPE_Handle_t | snpeHandle, |
Snpe_UserBufferMap_Handle_t | inputHandle, | ||
Snpe_UserBufferMap_Handle_t | outputHandle | ||
) |
Processes the input data and returns the output, using user-supplied buffers.
[in] | snpeHandle | Handle to access the SNPE object |
[in] | inputHandle | A map of UserBuffers that contains the input data for each input. The names of UserBuffers needs to be matched with names retrieved through getInputTensorNames() |
[in,out] | outputHandle | A map of UserBuffers that will hold the output data of potentially multiple layers (the key in the map is the UserBuffer name) |
Caller must guarantee that for the duration of execute(), the buffer stored in UserBuffer would remain valid. For more detail on buffer ownership and lifetime requirements, please refer to zdl::DlSystem::UserBuffer documentation.
SNPE_API Snpe_IDiagLog_Handle_t Snpe_SNPE_GetDiagLogInterface_Ref | ( | Snpe_SNPE_Handle_t | snpeHandle | ) |
Get the diagnostic logging interface
[in] | snpeHandle | Handle to access the SNPE object |
SNPE_API Snpe_TensorShape_Handle_t Snpe_SNPE_GetInputDimensions | ( | Snpe_SNPE_Handle_t | snpeHandle, |
const char * | name | ||
) |
Returns the dimensions of the input data to the model in the form of TensorShape. The dimensions in TensorShape corresponds to what the tensor dimensions would need to be for an input tensor to the model.
[in] | snpeHandle | Handle to access the SNPE object |
[in] | name | input name. |
SNPE_API Snpe_TensorShape_Handle_t Snpe_SNPE_GetInputDimensionsOfFirstTensor | ( | Snpe_SNPE_Handle_t | snpeHandle | ) |
Returns the dimensions of the first input's data to the model in the form of TensorShape. The dimensions in TensorShape corresponds to what the tensor dimensions would need to be for an input tensor to the model.
[in] | snpeHandle | Handle to access the SNPE object |
SNPE_API Snpe_IBufferAttributes_Handle_t Snpe_SNPE_GetInputOutputBufferAttributes | ( | Snpe_SNPE_Handle_t | snpeHandle, |
const char * | name | ||
) |
Returns attributes of buffers used to feed input tensors and receive result from output tensors.
[in] | snpeHandle | Handle to access the SNPE object |
[in] | name | Tensor name. |
SNPE_API Snpe_StringList_Handle_t Snpe_SNPE_GetInputTensorNames | ( | Snpe_SNPE_Handle_t | snpeHandle | ) |
Gets the names of input tensors to the network.
To support multiple input scenarios, where multiple tensors are passed through execute() in a TensorMap, each tensor needs to be uniquely named. The names of tensors can be retrieved through this function.
In the case of a single input, one name will be returned.
[in] | snpeHandle | Handle to access the SNPE object |
SNPE_API const char* Snpe_SNPE_GetModelVersion | ( | Snpe_SNPE_Handle_t | snpeHandle | ) |
Returns the version string embedded at model conversion time.
[in] | snpeHandle | Handle to access the SNPE object |
SNPE_API Snpe_StringList_Handle_t Snpe_SNPE_GetOutputLayerNames | ( | Snpe_SNPE_Handle_t | snpeHandle | ) |
Gets the output layer(s) for the network.
[in] | snpeHandle | Handle to access the SNPE object |
SNPE_API Snpe_StringList_Handle_t Snpe_SNPE_GetOutputTensorNames | ( | Snpe_SNPE_Handle_t | snpeHandle | ) |
Gets the names of output tensors to the network.
[in] | snpeHandle | Handle to access the SNPE object |
SNPE_API Snpe_StringList_Handle_t Snpe_SNPE_GetOutputTensorNamesByLayerName | ( | Snpe_SNPE_Handle_t | snpeHandle, |
const char * | name | ||
) |
Gets the names of output tensor from the input layer name.
[in] | snpeHandle | Handle to access the SNPE object |
[in] | name | Layer name |
SNPE_API Snpe_ErrorCode_t Snpe_SNPE_RegisterIonBuffers | ( | Snpe_SNPE_Handle_t | snpeHandle, |
Snpe_UserMemoryMap_Handle_t | ionBufferMapHandle | ||
) |
Register Client ION Buffers.
[in] | snpeHandle | Handle to access the SNPE object |
[in] | ionBufferMapHandle | A UserMemoryMap of virtual addresses |
SNPE_API Snpe_SNPE_Handle_t Snpe_SNPEBuilder_Build | ( | Snpe_SNPEBuilder_Handle_t | snpeBuilderHandle | ) |
Returns an instance of SNPE based on the current parameters.
[in] | snpeBuilderHandle | Handle to access the SNPEBuilder object |
SNPE_API Snpe_SNPEBuilder_Handle_t Snpe_SNPEBuilder_Create | ( | Snpe_DlContainer_Handle_t | containerHandle | ) |
Constructor of NeuralNetwork Builder ith a supplied model.
The builder class for creating SNPE objects. Not meant to be extended.
[in] | containerHandle | A DlContainer holding the model. |
SNPE_API Snpe_ErrorCode_t Snpe_SNPEBuilder_Delete | ( | Snpe_SNPEBuilder_Handle_t | snpeBuilderHandle | ) |
Destroys/frees a SNPEBuilder object
[in] | snpeBuilderHandle | Handle to access the SNPEBuilder object |
SNPE_API Snpe_ErrorCode_t Snpe_SNPEBuilder_SetBufferDataType | ( | Snpe_SNPEBuilder_Handle_t | snpeBuilderHandle, |
Snpe_IOBufferDataTypeMap_Handle_t | dataTypeMapHandle | ||
) |
Sets the datatype of the buffer. Only valid for dsp runtime currently.
[in] | snpeBuilderHandle | Handle to access the SNPEBuilder object |
[in] | dataTypeMapHandle | Map of the buffer names and the datatype that needs to be set. |
SNPE_API Snpe_ErrorCode_t Snpe_SNPEBuilder_SetCpuFixedPointMode | ( | Snpe_SNPEBuilder_Handle_t | snpeBuilderHandle, |
bool | cpuFxpMode | ||
) |
Sets the fixed point execution mode for CPU runtime. If a floating point DLC is executed with this option set, the program will be terminated with an exception. If a quantized DLC is executed without this option set, the execution will be in floating point mode in CPU.
[in] | snpeBuilderHandle | Handle to access the SNPEBuilder object |
[in] | cpuFxpMode | Boolean If set to true, enables the fixed point mode. |
SNPE_API Snpe_ErrorCode_t Snpe_SNPEBuilder_SetDebugMode | ( | Snpe_SNPEBuilder_Handle_t | snpeBuilderHandle, |
int | debugMode | ||
) |
Sets the debug mode of the runtime.
[in] | snpeBuilderHandle | Handle to access the SNPEBuilder object |
[in] | debugMode | This enables debug mode for the runtime. It does two things. For an empty outputLayerNames list, all layers will be output. It might also disable some internal runtime optimizations (e.g., some networks might be optimized by combining layers, etc.). |
SNPE_API Snpe_ErrorCode_t Snpe_SNPEBuilder_SetExecutionPriorityHint | ( | Snpe_SNPEBuilder_Handle_t | snpeBuilderHandle, |
Snpe_ExecutionPriorityHint_t | priority | ||
) |
Sets a preference for execution priority.
This allows the caller to give coarse hint to SNPE runtime about the priority of the network. SNPE runtime is free to use this information to co-ordinate between different workloads that may or may not extend beyond SNPE.
[in] | snpeBuilderHandle | Handle to access the SNPEBuilder object |
[in] | priority | The target performance profile. |
SNPE_API Snpe_ErrorCode_t Snpe_SNPEBuilder_SetInitCacheMode | ( | Snpe_SNPEBuilder_Handle_t | snpeBuilderHandle, |
int | cacheMode | ||
) |
Sets the mode of init caching functionality.
[in] | snpeBuilderHandle | Handle to access the SNPEBuilder object |
[in] | mode | Boolean. This flag enables/disables the functionality of init caching. When init caching functionality is enabled, a set of init caches will be created during network building/initialization process and will be added to DLC container. If such DLC container is saved by the user, in subsequent network building/initialization processes these init caches will be loaded from the DLC so as to reduce initialization time. In disable mode, no init caches will be added to DLC container. |
SNPE_API Snpe_ErrorCode_t Snpe_SNPEBuilder_SetInputDimensions | ( | Snpe_SNPEBuilder_Handle_t | snpeBuilderHandle, |
Snpe_TensorShapeMap_Handle_t | inputDimensionsMapHandle | ||
) |
Sets network's input dimensions to enable resizing of the spatial dimensions of each layer for fully convolutional networks, and the batch dimension for all networks.
[in] | tensorShapeMapHandle | : Handle to the map of input names and their new dimensions. The new dimensions overwrite the input dimensions embedded in the model and then resize each layer of the model. If the model contains layers whose dimensions cannot be resized e.g FullyConnected, exception will be thrown when SNPE instance is actually built. In general the batch dimension is always resizable. After resizing of layers' dimensions in model based on new input dimensions, the new model is revalidated against all runtime constraints, whose failures may result in cpu fallback situation. |
SNPE_API Snpe_ErrorCode_t Snpe_SNPEBuilder_SetOutputLayers | ( | Snpe_SNPEBuilder_Handle_t | snpeBuilderHandle, |
Snpe_StringList_Handle_t | outputLayerNames | ||
) |
Sets the layers that will generate output.
[in] | snpeBuilderHandle | Handle to access the SNPEBuilder object |
[in] | outputLayerNames | List of layer names to output. An empty list will result in only the final layer of the model being the output layer. The list will be copied. |
SNPE_API Snpe_ErrorCode_t Snpe_SNPEBuilder_SetOutputTensors | ( | Snpe_SNPEBuilder_Handle_t | snpeBuilderHandle, |
Snpe_StringList_Handle_t | outputTensorNames | ||
) |
Sets the output tensor names.
[in] | snpeBuilderHandle | Handle to access the SNPEBuilder object |
[in] | outputTensorNames | List of tensor names to output. An empty list will result in producing output for the final output tensor of the model. The list will be copied. |
SNPE_API Snpe_ErrorCode_t Snpe_SNPEBuilder_SetPerformanceProfile | ( | Snpe_SNPEBuilder_Handle_t | snpeBuilderHandle, |
Snpe_PerformanceProfile_t | performanceProfile | ||
) |
Requests a performance profile.
[in] | snpeBuilderHandle | Handle to access the SNPEBuilder object |
[in] | performanceProfile | The target performance profile. |
SNPE_API Snpe_ErrorCode_t Snpe_SNPEBuilder_SetPlatformConfig | ( | Snpe_SNPEBuilder_Handle_t | snpeBuilderHandle, |
Snpe_PlatformConfig_Handle_t | platformConfigHandle | ||
) |
Sets the platform configuration.
[in] | snpeBuilderHandle | Handle to access the SNPEBuilder object |
[in] | platformConfig | The platform configuration. |
SNPE_API Snpe_ErrorCode_t Snpe_SNPEBuilder_SetProfilingLevel | ( | Snpe_SNPEBuilder_Handle_t | snpeBuilderHandle, |
Snpe_ProfilingLevel_t | profilingLevel | ||
) |
Sets the profiling level. Default profiling level for SNPEBuilder is off. Off and basic only applies to DSP runtime.
[in] | snpeBuilderHandle | Handle to access the SNPEBuilder object |
[in] | profilingLevel | The target profiling level. |
SNPE_API Snpe_ErrorCode_t Snpe_SNPEBuilder_SetRuntimeProcessorOrder | ( | Snpe_SNPEBuilder_Handle_t | snpeBuilderHandle, |
Snpe_RuntimeList_Handle_t | runtimeListHandle | ||
) |
Sets network's runtime order of precedence. Example: CPU_FLOAT32, GPU_FLOAT16, AIP_FIXED8_TF.
[in] | snpeBuilderHandle | Handle to access the SNPEBuilder object |
[in] | runtimeListHandle | The list of runtime in order of precedence |
SNPE_API Snpe_ErrorCode_t Snpe_SNPEBuilder_SetSingleThreadedInit | ( | Snpe_SNPEBuilder_Handle_t | snpeBuilderHandle, |
int | singleThreadedInit | ||
) |
Sets up the entire initialization callflow to happen on the user's thread.
SNPE_API Snpe_ErrorCode_t Snpe_SNPEBuilder_SetTimeOut | ( | Snpe_SNPEBuilder_Handle_t | snpeBuilderHandle, |
uint64_t | timeout | ||
) |
Execution terminated when exceeding time limit. Only valid for dsp runtime currently.
[in] | snpeBuilderHandle | Handle to access the SNPEBuilder object |
[in] | timeout | Time limit value |
SNPE_API Snpe_ErrorCode_t Snpe_SNPEBuilder_SetUnconsumedTensorsAsOutputs | ( | Snpe_SNPEBuilder_Handle_t | snpeBuilderHandle, |
int | setOutput | ||
) |
Sets the unconsumed tensors as output.
[in] | snpeBuilderHandle | Handle to access the SNPEBuilder object |
[in] | setOutput | Boolean. This enables unconsumed tensors (i.e) outputs which are not inputs to any layer (basically dead ends) to be marked for output |
SNPE_API Snpe_ErrorCode_t Snpe_SNPEBuilder_SetUseUserSuppliedBuffers | ( | Snpe_SNPEBuilder_Handle_t | snpeBuilderHandle, |
int | bufferMode | ||
) |
Sets whether this neural network will perform inference with input from user-supplied buffers, and write output to user-supplied buffers. Default behaviour is to use tensors created by ITensorFactory.
[in] | snpeBuilderHandle | Handle to access the SNPEBuilder object |
[in] | bufferMode | Boolean whether to use user-supplied buffer or not. |
SNPE_API Snpe_ErrorCode_t Snpe_StringList_Append | ( | Snpe_StringList_Handle_t | stringListHandle, |
const char * | string | ||
) |
Append a string to the list.
[in] | stringListHandle | : Handle to access the stringList |
[in] | str | Null-terminated ASCII string to append to the list. |
SNPE_API Snpe_ErrorCode_t Snpe_StringList_Assign | ( | Snpe_StringList_Handle_t | src, |
Snpe_StringList_Handle_t | dst | ||
) |
Copy-assigns the contents of src into dst
src | Source StringList handle |
dst | Destination StringList handle |
SNPE_API const char* Snpe_StringList_At | ( | Snpe_StringList_Handle_t | stringListHandle, |
size_t | idx | ||
) |
Returns the string at the indicated position, or an empty string if the positions is greater than the size of the list.
[in] | stringListHandle | : Handle to access the stringList |
[in] | idx | Position in the list of the desired string |
SNPE_API const char** Snpe_StringList_Begin | ( | Snpe_StringList_Handle_t | stringListHandle | ) |
Pointer to the first string in the list. Can be used to iterate through the list.
[in] | stringListHandle | : Handle to access the stringList |
SNPE_API Snpe_StringList_Handle_t Snpe_StringList_Create | ( | ) |
Constructs a StringList and returns a handle to it
SNPE_API Snpe_StringList_Handle_t Snpe_StringList_CreateCopy | ( | Snpe_StringList_Handle_t | other | ) |
Constructs a StringList and returns a handle to it
[in] | other | : StringList handle to be copied from |
SNPE_API Snpe_StringList_Handle_t Snpe_StringList_CreateSize | ( | size_t | size | ) |
Constructs a StringList and returns a handle to it
[in] | size | : size of list |
SNPE_API Snpe_ErrorCode_t Snpe_StringList_Delete | ( | Snpe_StringList_Handle_t | stringListHandle | ) |
Destroys/frees a StringList
[in] | stringListHandle | : Handle to access the stringList |
SNPE_API const char** Snpe_StringList_End | ( | Snpe_StringList_Handle_t | stringListHandle | ) |
Pointer to one after the last string in the list. Can be used to iterate through the list.
[in] | stringListHandle | : Handle to access the stringList |
SNPE_API size_t Snpe_StringList_Size | ( | Snpe_StringList_Handle_t | stringListHandle | ) |
Return the number of valid string pointers held by this list.
[in] | stringListHandle | : Handle to access the stringList |
SNPE_API void Snpe_TensorMap_Add | ( | Snpe_TensorMap_Handle_t | handle, |
const char * | name, | ||
Snpe_ITensor_Handle_t | tensorHandle | ||
) |
Adds a name and the corresponding tensor pointer to the map.
[in] | handle | : Handle to tensorMap |
[in] | name | : The name of the tensor |
[in] | tensorHandle | : Handle to access ITensor |
SNPE_API void Snpe_TensorMap_Clear | ( | Snpe_TensorMap_Handle_t | handle | ) |
[in] | handle | : Handle to tensorMap Removes all tensors from the map |
SNPE_API Snpe_TensorMap_Handle_t Snpe_TensorMap_Create | ( | ) |
Constructs a TensorMap and returns a handle to it
SNPE_API Snpe_ErrorCode_t Snpe_TensorMap_Delete | ( | Snpe_TensorMap_Handle_t | handle | ) |
Destroys/frees Tensor Map
[in] | handle | : handle to tensorMap |
SNPE_API Snpe_ITensor_Handle_t Snpe_TensorMap_GetTensor_Ref | ( | Snpe_TensorMap_Handle_t | handle, |
const char * | name | ||
) |
Returns the tensor given its name.
[in] | handle | : Handle to tensorMap |
[in] | name | : The name of the tensor to get. |
SNPE_API Snpe_StringList_Handle_t Snpe_TensorMap_GetTensorNames | ( | Snpe_TensorMap_Handle_t | handle | ) |
[in] | handle | : Handle to tensorMap |
SNPE_API void Snpe_TensorMap_Remove | ( | Snpe_TensorMap_Handle_t | handle, |
const char * | name | ||
) |
Removes a mapping of tensor and its name by its name.
[in] | handle | : Handle to tensorMap |
[in] | name | : The name of tensor to be removed |
SNPE_API size_t Snpe_TensorMap_Size | ( | Snpe_TensorMap_Handle_t | handle | ) |
Returns the number of tensors in the map.
[in] | handle | : Handle to tensorMap |
SNPE_API Snpe_ErrorCode_t Snpe_TensorShape_Assign | ( | Snpe_TensorShape_Handle_t | srcHandle, |
Snpe_TensorShape_Handle_t | dstHandle | ||
) |
Copy-assigns the contents of srcHandle into dstHandle
srcHandle | Source TensorShape handle |
dstHandle | Destination TensorShape handle |
SNPE_API size_t Snpe_TensorShape_At | ( | Snpe_TensorShape_Handle_t | tensorShapeHandle, |
size_t | index | ||
) |
[in] | handle | : handle to tensorShape |
[in] | index | : Position in the dimension array. |
SNPE_API void Snpe_TensorShape_Concatenate | ( | Snpe_TensorShape_Handle_t | tensorShape, |
size_t * | dims, | ||
size_t | size | ||
) |
Concatenates additional dimensions specified in the array to the existing dimensions.
[in] | handle | : handle to tensorShape |
[in] | dims | The dimensions are specified in which the last element of the vector represents the fastest varying dimension and the zeroth element represents the slowest varying, etc. |
[in] | size | Size of the array. |
SNPE_API Snpe_TensorShape_Handle_t Snpe_TensorShape_Create | ( | ) |
Constructs a TensorShape and returns a handle to it
SNPE_API Snpe_TensorShape_Handle_t Snpe_TensorShape_CreateCopy | ( | Snpe_TensorShape_Handle_t | other | ) |
copy constructor.
[in] | other | object to copy. |
SNPE_API Snpe_TensorShape_Handle_t Snpe_TensorShape_CreateDimsSize | ( | const size_t * | dims, |
size_t | size | ||
) |
Creates a new shape with a list of dims specified in array
[in] | dims | The dimensions are specified in which the last element of the vector represents the fastest varying dimension and the zeroth element represents the slowest varying, etc. |
[in] | size | Size of the array. |
SNPE_API Snpe_ErrorCode_t Snpe_TensorShape_Delete | ( | Snpe_TensorShape_Handle_t | tensorShapeHandle | ) |
Destroys/frees Tensor Shape
[in] | handle | : handle to tensorShape |
SNPE_API const size_t* Snpe_TensorShape_GetDimensions | ( | Snpe_TensorShape_Handle_t | tensorShape | ) |
Retrieves a pointer to the first dimension of shape
[in] | handle | : handle to tensorShape |
SNPE_API size_t Snpe_TensorShape_Rank | ( | Snpe_TensorShape_Handle_t | tensorShape | ) |
[in] | handle | : handle to tensorShape |
Retrieves the rank i.e. number of dimensions.
SNPE_API Snpe_ErrorCode_t Snpe_TensorShapeMap_Add | ( | Snpe_TensorShapeMap_Handle_t | tsmHandle, |
const char * | name, | ||
Snpe_TensorShape_Handle_t | tsHandle | ||
) |
Adds a name and the corresponding tensor pointer to the map.
[in] | tsmhandle | : handle to access Tensor Shape Map |
[in] | name | The name of the tensor |
[in] | tsHandle | : Handle to access Tensor Shape |
SNPE_API Snpe_ErrorCode_t Snpe_TensorShapeMap_Assign | ( | Snpe_TensorShapeMap_Handle_t | srcHandle, |
Snpe_TensorShapeMap_Handle_t | dstHandle | ||
) |
assignment operator. Copy-assigns from srcHandle to dstHandle
[in] | srcHandle | : handle to source Tensor Shape Map object |
[out] | dstHandle | : handle to destination Tensor Shape Map object |
SNPE_API Snpe_ErrorCode_t Snpe_TensorShapeMap_Clear | ( | Snpe_TensorShapeMap_Handle_t | tsmHandle | ) |
Removes all tensors from the map
[in] | tsmhandle | : handle to access Tensor Shape Map |
SNPE_API Snpe_TensorShapeMap_Handle_t Snpe_TensorShapeMap_Create | ( | ) |
Constructs a TensorShapeMap and returns a handle to it
SNPE_API Snpe_TensorShapeMap_Handle_t Snpe_TensorShapeMap_CreateCopy | ( | Snpe_TensorShapeMap_Handle_t | tsmHandle | ) |
copy constructor.
[in] | tsmHandle | : Handle to the other object to copy. |
SNPE_API Snpe_ErrorCode_t Snpe_TensorShapeMap_Delete | ( | Snpe_TensorShapeMap_Handle_t | tsmHandle | ) |
Destroys/frees Tensor Shape Map
[in] | tsmhandle | : handle to access Tensor Shape Map |
SNPE_API Snpe_TensorShape_Handle_t Snpe_TensorShapeMap_GetTensorShape | ( | Snpe_TensorShapeMap_Handle_t | tsmHandle, |
const char * | name | ||
) |
Returns the tensor given its name.
[in] | tsmhandle | : handle to access Tensor Shape Map |
[in] | name | The name of the tensor to get. |
SNPE_API Snpe_StringList_Handle_t Snpe_TensorShapeMap_GetTensorShapeNames | ( | Snpe_TensorShapeMap_Handle_t | tsmHandle | ) |
[in] | tsmHandle | : handle to access Tensor Shape Map |
SNPE_API Snpe_ErrorCode_t Snpe_TensorShapeMap_Remove | ( | Snpe_TensorShapeMap_Handle_t | tsmHandle, |
const char * | name | ||
) |
Removes a mapping of tensor and its name by its name.
[in] | tsmhandle | : handle to access Tensor Shape Map |
[in] | name | The name of tensor to be removed |
SNPE_API size_t Snpe_TensorShapeMap_Size | ( | Snpe_TensorShapeMap_Handle_t | tsmHandle | ) |
Returns the number of tensors in the map.
[in] | tsmhandle | : handle to access Tensor Shape Map |
SNPE_API Snpe_UserBufferEncoding_ElementType_t Snpe_UserBufferEncoding_GetElementType | ( | Snpe_UserBufferEncoding_Handle_t | userBufferHandle | ) |
Retrieves the element type.
[in] | userBufferHandle | : Handle to access userBufferEncoding |
SNPE_API Snpe_UserBufferEncoding_Handle_t Snpe_UserBufferEncodingFloat_Create | ( | ) |
An encoding type where each element is represented by a float.
Userbuffer size assumes float encoding for each element. (i.e., a tensor with dimensions (2,3) will be represented by (2 * 3) * 4 = 24 bytes in memory).
SNPE_API Snpe_ErrorCode_t Snpe_UserBufferEncodingFloat_Delete | ( | Snpe_UserBufferEncoding_Handle_t | userBufferHandle | ) |
Destroys the encodingFloat.
[in] | userBufferHandle | : Handle to access the encoding |
SNPE_API size_t Snpe_UserBufferEncodingFloat_GetElementSize | ( | Snpe_UserBufferEncoding_Handle_t | userBufferHandle | ) |
Retrieves the size of the element, in bytes.
[in] | userBufferHandle | : Handle to access the encoding |
SNPE_API Snpe_UserBufferEncoding_Handle_t Snpe_UserBufferEncodingFloatN_Create | ( | uint8_t | bWidth | ) |
An encoding type where each element is represented by a float N
Userbuffer size assumes float N encoding for each element. (i.e., a tensor with dimensions (2,3) with a provided bitwidth of 16 will be represented by (2 * 3) * 2 = 12 bytes in memory).
SNPE_API Snpe_ErrorCode_t Snpe_UserBufferEncodingFloatN_Delete | ( | Snpe_UserBufferEncoding_Handle_t | userBufferHandle | ) |
Destroys the encodingFloatN.
[in] | userBufferHandle | : Handle to access the encoding |
SNPE_API size_t Snpe_UserBufferEncodingFloatN_GetElementSize | ( | Snpe_UserBufferEncoding_Handle_t | userBufferHandle | ) |
Retrieves the size of the element, in bytes.
[in] | userBufferHandle | : Handle to access the encoding |
SNPE_API Snpe_UserBufferEncoding_Handle_t Snpe_UserBufferEncodingIntN_Create | ( | uint8_t | bWidth | ) |
An encoding type where each element is represented by a Int
Userbuffer size assumes int N encoding for each element. (i.e., a tensor with dimensions (2,3) with a provided bitwidth of 32 will be represented by (2 * 3) * 4 = 24 bytes in memory).
SNPE_API Snpe_ErrorCode_t Snpe_UserBufferEncodingIntN_Delete | ( | Snpe_UserBufferEncoding_Handle_t | userBufferHandle | ) |
Destroys the encodingIntN.
[in] | userBufferHandle | : Handle to access the encoding |
SNPE_API size_t Snpe_UserBufferEncodingIntN_GetElementSize | ( | Snpe_UserBufferEncoding_Handle_t | userBufferHandle | ) |
Retrieves the size of the element, in bytes.
[in] | userBufferHandle | : Handle to access the encoding |
SNPE_API Snpe_UserBufferEncoding_Handle_t Snpe_UserBufferEncodingTfN_Create | ( | uint64_t | stepFor0, |
float | stepSize, | ||
uint8_t | bWidth | ||
) |
An encoding type where each element is represented by tfN, which is an N-bit quantized value, which has an exact representation of 0.0
Userbuffer size assumes tf N encoding for each element. (i.e., a tensor with dimensions (2,3) with a provided bitwidth of 16 will be represented by (2 * 3) * 2 = 12 bytes in memory).
SNPE_API Snpe_ErrorCode_t Snpe_UserBufferEncodingTfN_Delete | ( | Snpe_UserBufferEncoding_Handle_t | userBufferHandle | ) |
Destroys the encodingTfN.
[in] | userBufferHandle | : Handle to access the encoding |
SNPE_API size_t Snpe_UserBufferEncodingTfN_GetElementSize | ( | Snpe_UserBufferEncoding_Handle_t | userBufferHandle | ) |
Retrieves the size of the element, in bytes.
[in] | userBufferHandle | : Handle to access the encoding |
SNPE_API float Snpe_UserBufferEncodingTfN_GetMax | ( | Snpe_UserBufferEncoding_Handle_t | userBufferHandle | ) |
Calculates the maximum floating point value that can be represented with this encoding.
[in] | userBufferHandle | : Handle to access the encoding |
SNPE_API float Snpe_UserBufferEncodingTfN_GetMin | ( | Snpe_UserBufferEncoding_Handle_t | userBufferHandle | ) |
Calculates the minimum floating point value that can be represented with this encoding.
[in] | userBufferHandle | : Handle to access the encoding |
SNPE_API float Snpe_UserBufferEncodingTfN_GetQuantizedStepSize | ( | Snpe_UserBufferEncoding_Handle_t | userBufferHandle | ) |
Retrieves the step size.
[in] | userBufferHandle | : Handle to access the encoding |
SNPE_API uint64_t Snpe_UserBufferEncodingTfN_GetStepExactly0 | ( | Snpe_UserBufferEncoding_Handle_t | userBufferHandle | ) |
Retrieves the step that represents 0.0.
[in] | userBufferHandle | : Handle to access the encoding |
SNPE_API void Snpe_UserBufferEncodingTfN_SetQuantizedStepSize | ( | Snpe_UserBufferEncoding_Handle_t | userBufferHandle, |
float | quantizedStepSize | ||
) |
Sets the float value that each step represents.
[in] | userBufferHandle | : Handle to access the encoding |
[in] | quantizedStepSize | : The float value of each step size |
SNPE_API void Snpe_UserBufferEncodingTfN_SetStepExactly0 | ( | Snpe_UserBufferEncoding_Handle_t | userBufferHandle, |
uint64_t | stepExactly0 | ||
) |
Sets the step value that represents 0.
[in] | userBufferHandle | : Handle to access the encoding |
[in] | stepExactly0 | : The step value that represents 0 |
SNPE_API Snpe_UserBufferEncoding_Handle_t Snpe_UserBufferEncodingUintN_Create | ( | uint8_t | bWidth | ) |
An encoding type where each element is represented by a Uint
Userbuffer size assumes uint N encoding for each element. (i.e., a tensor with dimensions (2,3) with a provided bitwidth of 32 will be represented by (2 * 3) * 4 = 24 bytes in memory).
SNPE_API Snpe_ErrorCode_t Snpe_UserBufferEncodingUintN_Delete | ( | Snpe_UserBufferEncoding_Handle_t | userBufferHandle | ) |
Destroys the encodingUintN.
[in] | userBufferHandle | : Handle to access the encoding |
SNPE_API size_t Snpe_UserBufferEncodingUintN_GetElementSize | ( | Snpe_UserBufferEncoding_Handle_t | userBufferHandle | ) |
Retrieves the size of the element, in bytes.
[in] | userBufferHandle | : Handle to access the encoding |
SNPE_API Snpe_UserBufferEncoding_Handle_t Snpe_UserBufferEncodingUnsigned8Bit_Create | ( | ) |
An encoding type where each element is represented by an unsigned int.
Userbuffer size assumes uint8 encoding for each element. (i.e., a tensor with dimensions (2,3) will be represented by (2 * 3) * 1 = 6 bytes in memory).
SNPE_API Snpe_ErrorCode_t Snpe_UserBufferEncodingUnsigned8Bit_Delete | ( | Snpe_UserBufferEncoding_Handle_t | userBufferHandle | ) |
Destroys the encodingUnsigned8Bit.
[in] | userBufferHandle | : Handle to access the encodingUnsigned8Bit |
SNPE_API size_t Snpe_UserBufferEncodingUnsigned8Bit_GetElementSize | ( | Snpe_UserBufferEncoding_Handle_t | userBufferHandle | ) |
Retrieves the size of the element, in bytes.
[in] | userBufferHandle | : Handle to access the encoding |
SNPE_API void Snpe_UserBufferMap_Add | ( | Snpe_UserBufferMap_Handle_t | handle, |
const char * | name, | ||
Snpe_IUserBuffer_Handle_t | bufferHandle | ||
) |
Adds a name and the corresponding UserBuffer pointer to the map.
[in] | handle | : Handle to access UserBufferMap |
[in] | name | : The name of the UserBuffer |
[in] | bufferHandle | : Handle to access UserBuffer |
SNPE_API Snpe_ErrorCode_t Snpe_UserBufferMap_Assign | ( | Snpe_UserBufferMap_Handle_t | srcHandle, |
Snpe_UserBufferMap_Handle_t | dstHandle | ||
) |
Copy-assigns the contents of srcHandle into dstHandle
src | Source UserBufferMap handle |
dst | Destination UserBufferMap handle |
SNPE_API Snpe_ErrorCode_t Snpe_UserBufferMap_Clear | ( | Snpe_UserBufferMap_Handle_t | handle | ) |
[in] | handle | : Handle to access UserBufferMap Removes all UserBuffers from the map |
SNPE_API Snpe_UserBufferMap_Handle_t Snpe_UserBufferMap_Create | ( | ) |
Creates a new empty UserBuffer map
SNPE_API Snpe_UserBufferMap_Handle_t Snpe_UserBufferMap_CreateCopy | ( | Snpe_UserBufferMap_Handle_t | other | ) |
copy constructor.
[in] | other | : Handle to the other userBufferMap to be copied from. |
SNPE_API Snpe_ErrorCode_t Snpe_UserBufferMap_Delete | ( | Snpe_UserBufferMap_Handle_t | handle | ) |
Destroys/frees UserBuffer Map
[in] | handle | : Handle to access UserBuffer Map |
SNPE_API Snpe_IUserBuffer_Handle_t Snpe_UserBufferMap_GetUserBuffer_Ref | ( | Snpe_UserBufferMap_Handle_t | handle, |
const char * | name | ||
) |
Returns the UserBuffer given its name.
[in] | handle | : Handle to access UserBufferMap |
[in] | name | : The name of the UserBuffer to get. |
SNPE_API Snpe_StringList_Handle_t Snpe_UserBufferMap_GetUserBufferNames | ( | Snpe_UserBufferMap_Handle_t | handle | ) |
Returns the names of all UserBuffers
[in] | handle | : Handle to access UserBufferMap |
SNPE_API Snpe_ErrorCode_t Snpe_UserBufferMap_Remove | ( | Snpe_UserBufferMap_Handle_t | handle, |
const char * | name | ||
) |
Removes a mapping of one UserBuffer and its name by its name.
[in] | handle | : Handle to access UserBufferMap |
[in] | name | : The name of UserBuffer to be removed |
SNPE_API size_t Snpe_UserBufferMap_Size | ( | Snpe_UserBufferMap_Handle_t | handle | ) |
Returns the number of UserBuffers in the map.
[in] | handle | : Handle to access UserBufferMap |
SNPE_API Snpe_UserBufferSource_SourceType_t Snpe_UserBufferSource_GetSourceType | ( | Snpe_UserBufferSource_Handle_t | userBufferHandle | ) |
Retrieves the source type.
[in] | userBufferHandle | : Handle to access userBufferSource |
SNPE_API Snpe_UserBufferSource_Handle_t Snpe_UserBufferSourceGLBuffer_Create | ( | ) |
An source type where input data is delivered from OpenGL buffer
SNPE_API Snpe_ErrorCode_t Snpe_UserBufferSourceGLBuffer_Delete | ( | Snpe_UserBufferSource_Handle_t | userBufferHandle | ) |
Destroys the userBuffer.
[in] | userBufferHandle | : Handle to access the UserBuffer |
SNPE_API Snpe_UserGLConfig_Handle_t Snpe_UserGLConfig_Create | ( | ) |
Creates a new userGLConfig
SNPE_API Snpe_ErrorCode_t Snpe_UserGLConfig_Delete | ( | Snpe_UserGLConfig_Handle_t | handle | ) |
Destroys the userGLConfig.
[in] | handle | : Handle to access the userGLConfig |
SNPE_API void* Snpe_UserGLConfig_GetUserGLContext | ( | Snpe_UserGLConfig_Handle_t | handle | ) |
Get EGL context.
[in] | handle | : Handle to access userGLConfig |
SNPE_API void* Snpe_UserGLConfig_GetUserGLDisplay | ( | Snpe_UserGLConfig_Handle_t | handle | ) |
Get EGL Display.
[in] | handle | : Handle to access userGLConfig |
SNPE_API void Snpe_UserGLConfig_SetUserGLContext | ( | Snpe_UserGLConfig_Handle_t | handle, |
void * | userGLContext | ||
) |
Sets the EGL context.
[in] | handle | : Handle to access userGLConfig |
[in] | userGLContext | : void pointer |
SNPE_API void Snpe_UserGLConfig_SetUserGLDisplay | ( | Snpe_UserGLConfig_Handle_t | handle, |
void * | userGLDisplay | ||
) |
Sets the EGL Display.
[in] | handle | : Handle to access userGLConfig |
[in] | userGLDisplay | : void pointer |
SNPE_API Snpe_UserGpuConfig_Handle_t Snpe_UserGpuConfig_Create | ( | ) |
Creates a new userGpuConfig
SNPE_API Snpe_ErrorCode_t Snpe_UserGpuConfig_Delete | ( | Snpe_UserGpuConfig_Handle_t | handle | ) |
Destroys the userGpuConfig.
[in] | handle | : Handle to access userGLConfig |
SNPE_API Snpe_UserGLConfig_Handle_t Snpe_UserGpuConfig_Get_Ref | ( | Snpe_UserGpuConfig_Handle_t | handle | ) |
Get the userGpuConfig.
[in] | handle | : Handle to access userGpuConfig |
SNPE_API void Snpe_UserGpuConfig_Set | ( | Snpe_UserGpuConfig_Handle_t | handle, |
Snpe_UserGLConfig_Handle_t | glHandle | ||
) |
Set the userGpuConfig.
[in] | handle | : Handle to access userGpuConfig |
[in] | glHandle | : Handle needed to access userGlConfig |
SNPE_API Snpe_ErrorCode_t Snpe_UserMemoryMap_Add | ( | Snpe_UserMemoryMap_Handle_t | handle, |
const char * | name, | ||
void * | address | ||
) |
Adds a name and the corresponding buffer address to the map.
[in] | handle | : Handle to access UserMemory Map |
[in] | name | : The name of the UserMemory |
[in] | address | : The pointer to the Buffer Memory |
SNPE_API Snpe_ErrorCode_t Snpe_UserMemoryMap_Clear | ( | Snpe_UserMemoryMap_Handle_t | handle | ) |
Removes all User Memory from the map
[in] | handle | : Handle to access UserMemory Map |
SNPE_API Snpe_UserMemoryMap_Handle_t Snpe_UserMemoryMap_Copy | ( | Snpe_UserMemoryMap_Handle_t | other | ) |
copy constructor.
[in] | other | : Handle to the other object to copy. |
SNPE_API Snpe_UserMemoryMap_Handle_t Snpe_UserMemoryMap_Create | ( | ) |
Creates a new empty UserMemory map
SNPE_API Snpe_ErrorCode_t Snpe_UserMemoryMap_Delete | ( | Snpe_UserMemoryMap_Handle_t | handle | ) |
Destroys/frees UserMemory Map
[in] | handle | : Handle to access UserMemory Map |
SNPE_API Snpe_StringList_Handle_t Snpe_UserMemoryMap_GetUserBufferNames | ( | Snpe_UserMemoryMap_Handle_t | handle | ) |
Returns the names of all User Memory
[in] | handle | : Handle to access UserMemory Map |
SNPE_API void* Snpe_UserMemoryMap_GetUserMemoryAddressAtIndex | ( | Snpe_UserMemoryMap_Handle_t | handle, |
const char * | name, | ||
uint32_t | index | ||
) |
Returns address at a specified index corresponding to a UserMemory buffer name.
[in] | handle | : Handle to access UserMemory Map |
[in] | name | : The name of the buffer |
[in] | index | : The index in the list of addresses |
SNPE_API size_t Snpe_UserMemoryMap_GetUserMemoryAddressCount | ( | Snpe_UserMemoryMap_Handle_t | handle, |
const char * | name | ||
) |
Returns the no of UserMemory addresses mapped to the buffer.
[in] | handle | : Handle to access UserMemory Map |
[in] | name | : The name of the UserMemory |
SNPE_API Snpe_ErrorCode_t Snpe_UserMemoryMap_Remove | ( | Snpe_UserMemoryMap_Handle_t | handle, |
const char * | name | ||
) |
Removes a mapping of one Buffer address and its name by its name.
[in] | handle | : Handle to access UserMemory Map |
[in] | name | : The name of Memory address to be removed |
SNPE_API size_t Snpe_UserMemoryMap_Size | ( | Snpe_UserMemoryMap_Handle_t | handle | ) |
Returns the number of User Memory addresses in the map.
[in] | handle | : Handle to access UserMemory Map |
SNPE_API int Snpe_Util_AddOpPackage | ( | const char * | regLibraryPath | ) |
Register a user-defined op package with SNPE.
[in] | regLibraryPath | Path to the registration library that allows clients to register a set of operations that are part of the package, and share op info with SNPE |
SNPE_API Snpe_ITensor_Handle_t Snpe_Util_CreateITensor | ( | Snpe_TensorShape_Handle_t | shapeHandle | ) |
Creates a new ITensor with uninitialized data.
ITensor buffer size assumes float32 encoding for each element. (i.e., a tensor with dimensions (2,3) will be represented by (2 * 3) * 4 = 24 bytes in memory)
The strides for the tensor will match the tensor dimensions (i.e., the tensor data is contiguous in memory).
[in] | shapeHandle | The dimensions for the tensor in which the last element of the vector represents the fastest varying dimension and the zeroth element represents the slowest varying, etc. |
SNPE_API Snpe_ITensor_Handle_t Snpe_Util_CreateITensor_NV21 | ( | Snpe_TensorShape_Handle_t | shapeHandle, |
unsigned char * | data, | ||
size_t | dataSize | ||
) |
Create a new ITensor with specific data. (i.e. the tensor data is contiguous in memory). This tensor is primarily used to create a tensor where tensor size can't be computed directly from dimension. One such example is NV21-formatted image, or any YUV formatted image
[in] | shapeHandle | The dimensions for the tensor in which the last element of the vector represents the fastest varying dimension and the zeroth element represents the slowest varying, etc. |
[in] | data | The actual data with which the Tensor object is filled. |
[in] | dataSize | The size of data |
SNPE_API Snpe_IUserBuffer_Handle_t Snpe_Util_CreateUserBuffer | ( | void * | buffer, |
size_t | bufSize, | ||
Snpe_TensorShape_Handle_t | stridesHandle, | ||
Snpe_IUserBuffer_Handle_t | userBufferEncodingHandle | ||
) |
Creates a UserBuffer.
[in] | buffer | Pointer to the buffer that the caller supplies |
[in] | bufSize | Buffer size, in bytes |
[in] | stridesHandle | Total number of bytes between elements in each dimension. E.g. A tightly packed tensor of floats with dimensions [4, 3, 2] would have strides of [24, 8, 4]. |
[in] | userBufferEncodingHandle | Reference to an UserBufferEncoding object |
SNPE_API Snpe_IUserBuffer_Handle_t Snpe_Util_CreateUserGlBuffer | ( | void * | buffer, |
size_t | bufSize, | ||
Snpe_TensorShape_Handle_t | stridesHandle, | ||
Snpe_IUserBuffer_Handle_t | userBufferEncodingHandle, | ||
Snpe_IUserBuffer_Handle_t | userBufferSourceHandle | ||
) |
Creates a UserBuffer.
[in] | buffer | Pointer to the buffer that the caller supplies |
[in] | bufSize | Buffer size, in bytes |
[in] | stridesHandle | Total number of bytes between elements in each dimension. E.g. A tightly packed tensor of floats with dimensions [4, 3, 2] would have strides of [24, 8, 4]. |
[in] | userBufferEncodingHandle | Reference to an UserBufferEncoding object |
[in] | userBufferSourceHandle | Reference to an UserBufferSource object |
SNPE_API const char* Snpe_Util_GetLastError | ( | ) |
SNPE_API Snpe_DlVersion_Handle_t Snpe_Util_GetLibraryVersion | ( | ) |
Gets the version of the SNPE library.
SNPE_API int Snpe_Util_InitializeLogging | ( | Snpe_LogLevel_t | level | ) |
Initializes logging with the specified log level. initializeLogging with level, is used on Android platforms and after successful initialization, SNPE logs are printed in android logcat logs.
It is recommended to initializeLogging before creating any SNPE instances, in order to capture information related to core initialization. If this is called again after first time initialization, subsequent calls are ignored. Also, Logging can be re-initialized after a call to terminateLogging API by calling initializeLogging again.
A typical usage of Logging life cycle can be initializeLogging() any other SNPE API like isRuntimeAvailable()
Please note, enabling logging can have performance impact.
[in] | level | Log level (LOG_INFO, LOG_WARN, etc.). |
SNPE_API int Snpe_Util_InitializeLoggingPath | ( | Snpe_LogLevel_t | level, |
const char * | logPath | ||
) |
Initializes logging with the specified log level and log path. initializeLogging with level & log path, is used on non Android platforms and after successful initialization, SNPE logs are printed in std output & into log files created in the log path.
It is recommended to initializeLogging before creating any SNPE instances, in order to capture information related to core initialization. If this is called again after first time initialization, subsequent calls are ignored. Also, Logging can be re-initialized after a call to terminateLogging API by calling initializeLogging again.
A typical usage of Logging life cycle can be initializeLogging() any other SNPE API like isRuntimeAvailable()
Please note, enabling logging can have performance impact
[in] | level | Log level (LOG_INFO, LOG_WARN, etc.). |
[in] | logPath | of directory to store logs. If path is empty, the default path is "./Log". For android, the log path is ignored. |
SNPE_API int Snpe_Util_IsGLCLInteropSupported | ( | ) |
Indicates whether the OpenGL and OpenCL interoperability is supported on GPU platform.
SNPE_API int Snpe_Util_IsRuntimeAvailable | ( | Snpe_Runtime_t | runtime | ) |
Indicates whether the supplied runtime is available on the current platform.
[in] | runtime | The target runtime to check. |
SNPE_API int Snpe_Util_IsRuntimeAvailableCheckOption | ( | Snpe_Runtime_t | runtime, |
Snpe_RuntimeCheckOption_t | runtimeCheckOption | ||
) |
Indicates whether the supplied runtime is available on the current platform.
[in] | runtime | The target runtime to check. |
[in] | runtimeCheckOption | Extent to perform runtime available check. |
SNPE_API int Snpe_Util_SetLogLevel | ( | Snpe_LogLevel_t | level | ) |
Updates the current logging level with the specified level. setLogLevel is optional, called anytime after initializeLogging and before terminateLogging, to update the log level set. Log levels can be updated multiple times by calling setLogLevel A call to setLogLevel() is ignored if it is made before initializeLogging() or after terminateLogging()
[in] | level | Log level (LOG_INFO, LOG_WARN, etc.). |
SNPE_API int Snpe_Util_SetSNPEStorageLocation | ( | const char * | storagePath | ) |
Set the SNPE storage location for all SNPE instances in this process. Note that this may only be called once, and if so must be called before creating any SNPE instances.
[in] | storagePath | Absolute path to a directory which SNPE may use for caching and other storage purposes. |
SNPE_API int Snpe_Util_TerminateLogging | ( | ) |
Terminates logging.
It is recommended to terminateLogging after initializeLogging in order to disable logging information. If this is called before initialization or after first time termination, calls are ignored.