Snapdragon Neural Processing Engine SDK
Reference Guide
C

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

Description of 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

Description of 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

Description of 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

Description of 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

Description of 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

Description of 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

Description of 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

Description of ITenor.

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)
 

IUserBuffer

Description of IUserBuffer.

enum  Snpe_UserBufferEncoding_ElementType_t
 
typedef void * Snpe_UserBufferEncoding_Handle_t
 
typedef void * Snpe_UserBufferSource_Handle_t
 
typedef void * Snpe_IUserBuffer_Handle_t
 
SNPE_API Snpe_UserBufferEncoding_ElementType_t Snpe_UserBufferEncoding_GetElementType (Snpe_UserBufferEncoding_Handle_t userBufferHandle)
 
SNPE_API Snpe_UserBufferSource_SourceType_t Snpe_UserBufferSource_GetSourceType (Snpe_UserBufferSource_Handle_t userBufferHandle)
 
SNPE_API Snpe_UserBufferSource_Handle_t Snpe_UserBufferSourceGLBuffer_Create ()
 
SNPE_API Snpe_ErrorCode_t Snpe_UserBufferSourceGLBuffer_Delete (Snpe_UserBufferSource_Handle_t userBufferHandle)
 
SNPE_API Snpe_UserBufferEncoding_Handle_t Snpe_UserBufferEncodingUnsigned8Bit_Create ()
 
SNPE_API Snpe_ErrorCode_t Snpe_UserBufferEncodingUnsigned8Bit_Delete (Snpe_UserBufferEncoding_Handle_t userBufferHandle)
 
SNPE_API size_t Snpe_UserBufferEncodingUnsigned8Bit_GetElementSize (Snpe_UserBufferEncoding_Handle_t userBufferHandle)
 
SNPE_API Snpe_UserBufferEncoding_Handle_t Snpe_UserBufferEncodingFloat_Create ()
 
SNPE_API Snpe_ErrorCode_t Snpe_UserBufferEncodingFloat_Delete (Snpe_UserBufferEncoding_Handle_t userBufferHandle)
 
SNPE_API size_t Snpe_UserBufferEncodingFloat_GetElementSize (Snpe_UserBufferEncoding_Handle_t userBufferHandle)
 
SNPE_API Snpe_UserBufferEncoding_Handle_t Snpe_UserBufferEncodingFloatN_Create (uint8_t bWidth)
 
SNPE_API Snpe_ErrorCode_t Snpe_UserBufferEncodingFloatN_Delete (Snpe_UserBufferEncoding_Handle_t userBufferHandle)
 
SNPE_API size_t Snpe_UserBufferEncodingFloatN_GetElementSize (Snpe_UserBufferEncoding_Handle_t userBufferHandle)
 
SNPE_API Snpe_UserBufferEncoding_Handle_t Snpe_UserBufferEncodingTfN_Create (uint64_t stepFor0, float stepSize, uint8_t bWidth)
 
SNPE_API Snpe_ErrorCode_t Snpe_UserBufferEncodingTfN_Delete (Snpe_UserBufferEncoding_Handle_t userBufferHandle)
 
SNPE_API size_t Snpe_UserBufferEncodingTfN_GetElementSize (Snpe_UserBufferEncoding_Handle_t userBufferHandle)
 
SNPE_API void Snpe_UserBufferEncodingTfN_SetStepExactly0 (Snpe_UserBufferEncoding_Handle_t userBufferHandle, uint64_t stepExactly0)
 
SNPE_API void Snpe_UserBufferEncodingTfN_SetQuantizedStepSize (Snpe_UserBufferEncoding_Handle_t userBufferHandle, float quantizedStepSize)
 
SNPE_API uint64_t Snpe_UserBufferEncodingTfN_GetStepExactly0 (Snpe_UserBufferEncoding_Handle_t userBufferHandle)
 
SNPE_API float Snpe_UserBufferEncodingTfN_GetQuantizedStepSize (Snpe_UserBufferEncoding_Handle_t userBufferHandle)
 
SNPE_API float Snpe_UserBufferEncodingTfN_GetMin (Snpe_UserBufferEncoding_Handle_t userBufferHandle)
 
SNPE_API float Snpe_UserBufferEncodingTfN_GetMax (Snpe_UserBufferEncoding_Handle_t userBufferHandle)
 
SNPE_API Snpe_UserBufferEncoding_Handle_t Snpe_UserBufferEncodingIntN_Create (uint8_t bWidth)
 
SNPE_API Snpe_ErrorCode_t Snpe_UserBufferEncodingIntN_Delete (Snpe_UserBufferEncoding_Handle_t userBufferHandle)
 
SNPE_API size_t Snpe_UserBufferEncodingIntN_GetElementSize (Snpe_UserBufferEncoding_Handle_t userBufferHandle)
 
SNPE_API Snpe_UserBufferEncoding_Handle_t Snpe_UserBufferEncodingUintN_Create (uint8_t bWidth)
 
SNPE_API Snpe_ErrorCode_t Snpe_UserBufferEncodingUintN_Delete (Snpe_UserBufferEncoding_Handle_t userBufferHandle)
 
SNPE_API size_t Snpe_UserBufferEncodingUintN_GetElementSize (Snpe_UserBufferEncoding_Handle_t userBufferHandle)
 
SNPE_API Snpe_ErrorCode_t Snpe_IUserBuffer_Delete (Snpe_IUserBuffer_Handle_t userBufferHandle)
 
SNPE_API Snpe_TensorShape_Handle_t Snpe_IUserBuffer_GetStrides_Ref (Snpe_IUserBuffer_Handle_t userBufferHandle)
 
SNPE_API size_t Snpe_IUserBuffer_GetSize (Snpe_IUserBuffer_Handle_t userBufferHandle)
 
SNPE_API size_t Snpe_IUserBuffer_GetOutputSize (Snpe_IUserBuffer_Handle_t userBufferHandle)
 
SNPE_API int Snpe_IUserBuffer_SetBufferAddress (Snpe_IUserBuffer_Handle_t userBufferHandle, void *buffer)
 
SNPE_API Snpe_UserBufferEncoding_Handle_t Snpe_IUserBuffer_GetEncoding_Ref (Snpe_IUserBuffer_Handle_t userBufferHandle)
 

Options

Description of Options.

typedef void * Snpe_Options_Handle_t
 
SNPE_API Snpe_ErrorCode_t Snpe_Options_Delete (Snpe_Options_Handle_t handle)
 
SNPE_API const char * Snpe_Options_GetDiagLogMask (Snpe_Options_Handle_t handle)
 
SNPE_API void Snpe_Options_SetDiagLogMask (Snpe_Options_Handle_t handle, const char *diagLogMask)
 
SNPE_API const char * Snpe_Options_GetLogFileDirectory (Snpe_Options_Handle_t handle)
 
SNPE_API void Snpe_Options_SetLogFileDirectory (Snpe_Options_Handle_t handle, const char *logFileDirectory)
 
SNPE_API const char * Snpe_Options_GetLogFileName (Snpe_Options_Handle_t handle)
 
SNPE_API void Snpe_Options_SetLogFileName (Snpe_Options_Handle_t handle, const char *logFileName)
 
SNPE_API uint32_t Snpe_Options_GetLogFileRotateCount (Snpe_Options_Handle_t handle)
 
SNPE_API void Snpe_Options_SetLogFileRotateCount (Snpe_Options_Handle_t handle, uint32_t logFileRotateCount)
 
SNPE_API int Snpe_Options_GetLogFileReplace (Snpe_Options_Handle_t handle)
 
SNPE_API void Snpe_Options_SetLogFileReplace (Snpe_Options_Handle_t handle, int logFileReplace)
 

PlatformConfig

Description of PlatformConfig.

typedef void * Snpe_UserGLConfig_Handle_t
 
typedef void * Snpe_UserGpuConfig_Handle_t
 
typedef void * Snpe_PlatformConfig_Handle_t
 
SNPE_API Snpe_UserGLConfig_Handle_t Snpe_UserGLConfig_Create ()
 
SNPE_API Snpe_ErrorCode_t Snpe_UserGLConfig_Delete (Snpe_UserGLConfig_Handle_t handle)
 
SNPE_API void Snpe_UserGLConfig_SetUserGLContext (Snpe_UserGLConfig_Handle_t handle, void *userGLContext)
 
SNPE_API void Snpe_UserGLConfig_SetUserGLDisplay (Snpe_UserGLConfig_Handle_t handle, void *userGLDisplay)
 
SNPE_API void * Snpe_UserGLConfig_GetUserGLContext (Snpe_UserGLConfig_Handle_t handle)
 
SNPE_API void * Snpe_UserGLConfig_GetUserGLDisplay (Snpe_UserGLConfig_Handle_t handle)
 
SNPE_API Snpe_UserGpuConfig_Handle_t Snpe_UserGpuConfig_Create ()
 
SNPE_API Snpe_ErrorCode_t Snpe_UserGpuConfig_Delete (Snpe_UserGpuConfig_Handle_t handle)
 
SNPE_API void Snpe_UserGpuConfig_Set (Snpe_UserGpuConfig_Handle_t handle, Snpe_UserGLConfig_Handle_t glHandle)
 
SNPE_API Snpe_UserGLConfig_Handle_t Snpe_UserGpuConfig_Get_Ref (Snpe_UserGpuConfig_Handle_t handle)
 
SNPE_API Snpe_PlatformConfig_Handle_t Snpe_PlatformConfig_Create ()
 
SNPE_API Snpe_ErrorCode_t Snpe_PlatformConfig_Delete (Snpe_PlatformConfig_Handle_t handle)
 
SNPE_API Snpe_PlatformConfig_PlatformType_t Snpe_PlatformConfig_GetPlatformType (Snpe_PlatformConfig_Handle_t handle)
 
SNPE_API int Snpe_PlatformConfig_IsValid (Snpe_PlatformConfig_Handle_t handle)
 
SNPE_API Snpe_UserGpuConfig_Handle_t Snpe_PlatformConfig_GetUserGpuConfig (Snpe_PlatformConfig_Handle_t handle)
 
SNPE_API int Snpe_PlatformConfig_SetUserGpuConfig (Snpe_PlatformConfig_Handle_t handle, Snpe_UserGpuConfig_Handle_t gpuHandle)
 
SNPE_API int Snpe_PlatformConfig_SetPlatformOptions (Snpe_PlatformConfig_Handle_t handle, const char *options)
 
SNPE_API int Snpe_PlatformConfig_IsOptionsValid (Snpe_PlatformConfig_Handle_t handle)
 
SNPE_API const char * Snpe_PlatformConfig_GetPlatformOptions (Snpe_PlatformConfig_Handle_t handle)
 
SNPE_API int Snpe_PlatformConfig_SetPlatformOptionValue (Snpe_PlatformConfig_Handle_t handle, const char *optionName, const char *value)
 
SNPE_API int Snpe_PlatformConfig_RemovePlatformOptionValue (Snpe_PlatformConfig_Handle_t handle, const char *optionName, const char *value)
 

PlatformValidator

Description of 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

Description of 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)
 

SNPE

Description of SNPE

typedef void * Snpe_SNPE_Handle_t
 
SNPE_API Snpe_ErrorCode_t Snpe_SNPE_Delete (Snpe_SNPE_Handle_t snpeHandle)
 
SNPE_API Snpe_StringList_Handle_t Snpe_SNPE_GetInputTensorNames (Snpe_SNPE_Handle_t snpeHandle)
 
SNPE_API Snpe_StringList_Handle_t Snpe_SNPE_GetOutputTensorNames (Snpe_SNPE_Handle_t snpeHandle)
 
SNPE_API Snpe_StringList_Handle_t Snpe_SNPE_GetOutputTensorNamesByLayerName (Snpe_SNPE_Handle_t snpeHandle, const char *name)
 
SNPE_API Snpe_ErrorCode_t Snpe_SNPE_ExecuteITensors (Snpe_SNPE_Handle_t snpeHandle, Snpe_TensorMap_Handle_t inputHandle, Snpe_TensorMap_Handle_t outputHandle)
 
SNPE_API Snpe_ErrorCode_t Snpe_SNPE_ExecuteUserBuffers (Snpe_SNPE_Handle_t snpeHandle, Snpe_UserBufferMap_Handle_t inputHandle, Snpe_UserBufferMap_Handle_t outputHandle)
 
SNPE_API Snpe_ErrorCode_t Snpe_SNPE_RegisterIonBuffers (Snpe_SNPE_Handle_t snpeHandle, Snpe_UserMemoryMap_Handle_t ionBufferMapHandle)
 
SNPE_API Snpe_ErrorCode_t Snpe_SNPE_DeregisterIonBuffers (Snpe_SNPE_Handle_t snpeHandle, Snpe_StringList_Handle_t ionBufferNamesHandle)
 
SNPE_API const char * Snpe_SNPE_GetModelVersion (Snpe_SNPE_Handle_t snpeHandle)
 
SNPE_API Snpe_TensorShape_Handle_t Snpe_SNPE_GetInputDimensions (Snpe_SNPE_Handle_t snpeHandle, const char *name)
 
SNPE_API Snpe_TensorShape_Handle_t Snpe_SNPE_GetInputDimensionsOfFirstTensor (Snpe_SNPE_Handle_t snpeHandle)
 
SNPE_API Snpe_StringList_Handle_t Snpe_SNPE_GetOutputLayerNames (Snpe_SNPE_Handle_t snpeHandle)
 
SNPE_API Snpe_IBufferAttributes_Handle_t Snpe_SNPE_GetInputOutputBufferAttributes (Snpe_SNPE_Handle_t snpeHandle, const char *name)
 
SNPE_API Snpe_IDiagLog_Handle_t Snpe_SNPE_GetDiagLogInterface_Ref (Snpe_SNPE_Handle_t snpeHandle)
 

SNPEBuilder

Description of SNPEBuilder

typedef void * Snpe_SNPEBuilder_Handle_t
 
SNPE_API Snpe_SNPEBuilder_Handle_t Snpe_SNPEBuilder_Create (Snpe_DlContainer_Handle_t containerHandle)
 
SNPE_API Snpe_ErrorCode_t Snpe_SNPEBuilder_Delete (Snpe_SNPEBuilder_Handle_t snpeBuilderHandle)
 
SNPE_API Snpe_ErrorCode_t Snpe_SNPEBuilder_SetPerformanceProfile (Snpe_SNPEBuilder_Handle_t snpeBuilderHandle, Snpe_PerformanceProfile_t performanceProfile)
 
SNPE_API Snpe_ErrorCode_t Snpe_SNPEBuilder_SetProfilingLevel (Snpe_SNPEBuilder_Handle_t snpeBuilderHandle, Snpe_ProfilingLevel_t profilingLevel)
 
SNPE_API Snpe_ErrorCode_t Snpe_SNPEBuilder_SetExecutionPriorityHint (Snpe_SNPEBuilder_Handle_t snpeBuilderHandle, Snpe_ExecutionPriorityHint_t priority)
 
SNPE_API Snpe_ErrorCode_t Snpe_SNPEBuilder_SetOutputLayers (Snpe_SNPEBuilder_Handle_t snpeBuilderHandle, Snpe_StringList_Handle_t outputLayerNames)
 
SNPE_API Snpe_ErrorCode_t Snpe_SNPEBuilder_SetOutputTensors (Snpe_SNPEBuilder_Handle_t snpeBuilderHandle, Snpe_StringList_Handle_t outputTensorNames)
 
SNPE_API Snpe_ErrorCode_t Snpe_SNPEBuilder_SetUseUserSuppliedBuffers (Snpe_SNPEBuilder_Handle_t snpeBuilderHandle, int bufferMode)
 
SNPE_API Snpe_ErrorCode_t Snpe_SNPEBuilder_SetDebugMode (Snpe_SNPEBuilder_Handle_t snpeBuilderHandle, int debugMode)
 
SNPE_API Snpe_ErrorCode_t Snpe_SNPEBuilder_SetInputDimensions (Snpe_SNPEBuilder_Handle_t snpeBuilderHandle, Snpe_TensorShapeMap_Handle_t inputDimensionsMapHandle)
 
SNPE_API Snpe_ErrorCode_t Snpe_SNPEBuilder_SetInitCacheMode (Snpe_SNPEBuilder_Handle_t snpeBuilderHandle, int cacheMode)
 
SNPE_API Snpe_SNPE_Handle_t Snpe_SNPEBuilder_Build (Snpe_SNPEBuilder_Handle_t snpeBuilderHandle)
 
SNPE_API Snpe_ErrorCode_t Snpe_SNPEBuilder_SetPlatformConfig (Snpe_SNPEBuilder_Handle_t snpeBuilderHandle, Snpe_PlatformConfig_Handle_t platformConfigHandle)
 
SNPE_API Snpe_ErrorCode_t Snpe_SNPEBuilder_SetRuntimeProcessorOrder (Snpe_SNPEBuilder_Handle_t snpeBuilderHandle, Snpe_RuntimeList_Handle_t runtimeListHandle)
 
SNPE_API Snpe_ErrorCode_t Snpe_SNPEBuilder_SetUnconsumedTensorsAsOutputs (Snpe_SNPEBuilder_Handle_t snpeBuilderHandle, int setOutput)
 
SNPE_API Snpe_ErrorCode_t Snpe_SNPEBuilder_SetTimeOut (Snpe_SNPEBuilder_Handle_t snpeBuilderHandle, uint64_t timeout)
 
SNPE_API Snpe_ErrorCode_t Snpe_SNPEBuilder_SetBufferDataType (Snpe_SNPEBuilder_Handle_t snpeBuilderHandle, Snpe_IOBufferDataTypeMap_Handle_t dataTypeMapHandle)
 
SNPE_API Snpe_ErrorCode_t Snpe_SNPEBuilder_SetSingleThreadedInit (Snpe_SNPEBuilder_Handle_t snpeBuilderHandle, int singleThreadedInit)
 
SNPE_API Snpe_ErrorCode_t Snpe_SNPEBuilder_SetCpuFixedPointMode (Snpe_SNPEBuilder_Handle_t snpeBuilderHandle, bool cpuFxpMode)
 

SNPEUtil

Description of SNPEUtil

SNPE_API Snpe_IUserBuffer_Handle_t Snpe_Util_CreateUserBuffer (void *buffer, size_t bufSize, Snpe_TensorShape_Handle_t stridesHandle, Snpe_IUserBuffer_Handle_t userBufferEncodingHandle)
 
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)
 
SNPE_API Snpe_ITensor_Handle_t Snpe_Util_CreateITensor (Snpe_TensorShape_Handle_t shapeHandle)
 
SNPE_API Snpe_ITensor_Handle_t Snpe_Util_CreateITensor_NV21 (Snpe_TensorShape_Handle_t shapeHandle, unsigned char *data, size_t dataSize)
 
SNPE_API int Snpe_Util_IsRuntimeAvailable (Snpe_Runtime_t runtime)
 
SNPE_API int Snpe_Util_IsRuntimeAvailableCheckOption (Snpe_Runtime_t runtime, Snpe_RuntimeCheckOption_t runtimeCheckOption)
 
SNPE_API Snpe_DlVersion_Handle_t Snpe_Util_GetLibraryVersion ()
 
SNPE_API int Snpe_Util_SetSNPEStorageLocation (const char *storagePath)
 
SNPE_API int Snpe_Util_AddOpPackage (const char *regLibraryPath)
 
SNPE_API int Snpe_Util_IsGLCLInteropSupported ()
 
SNPE_API const char * Snpe_Util_GetLastError ()
 
SNPE_API int Snpe_Util_InitializeLogging (Snpe_LogLevel_t level)
 
SNPE_API int Snpe_Util_InitializeLoggingPath (Snpe_LogLevel_t level, const char *logPath)
 
SNPE_API int Snpe_Util_SetLogLevel (Snpe_LogLevel_t level)
 
SNPE_API int Snpe_Util_TerminateLogging ()
 

StringList

Description of 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

Description of 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

Description of 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)
 

TensorShapeMap

Description of TensorShapeMap.

typedef void * Snpe_TensorShapeMap_Handle_t
 
SNPE_API Snpe_TensorShapeMap_Handle_t Snpe_TensorShapeMap_Create ()
 
SNPE_API Snpe_TensorShapeMap_Handle_t Snpe_TensorShapeMap_CreateCopy (Snpe_TensorShapeMap_Handle_t tsmHandle)
 
SNPE_API Snpe_ErrorCode_t Snpe_TensorShapeMap_Delete (Snpe_TensorShapeMap_Handle_t tsmHandle)
 
SNPE_API Snpe_ErrorCode_t Snpe_TensorShapeMap_Assign (Snpe_TensorShapeMap_Handle_t srcHandle, Snpe_TensorShapeMap_Handle_t dstHandle)
 
SNPE_API Snpe_ErrorCode_t Snpe_TensorShapeMap_Add (Snpe_TensorShapeMap_Handle_t tsmHandle, const char *name, Snpe_TensorShape_Handle_t tsHandle)
 
SNPE_API Snpe_ErrorCode_t Snpe_TensorShapeMap_Remove (Snpe_TensorShapeMap_Handle_t tsmHandle, const char *name)
 
SNPE_API size_t Snpe_TensorShapeMap_Size (Snpe_TensorShapeMap_Handle_t tsmHandle)
 
SNPE_API Snpe_ErrorCode_t Snpe_TensorShapeMap_Clear (Snpe_TensorShapeMap_Handle_t tsmHandle)
 
SNPE_API Snpe_TensorShape_Handle_t Snpe_TensorShapeMap_GetTensorShape (Snpe_TensorShapeMap_Handle_t tsmHandle, const char *name)
 
SNPE_API Snpe_StringList_Handle_t Snpe_TensorShapeMap_GetTensorShapeNames (Snpe_TensorShapeMap_Handle_t tsmHandle)
 

UserBufferMap

Description of UserBufferMap.

typedef void * Snpe_UserBufferMap_Handle_t
 
SNPE_API Snpe_UserBufferMap_Handle_t Snpe_UserBufferMap_Create ()
 
SNPE_API Snpe_UserBufferMap_Handle_t Snpe_UserBufferMap_CreateCopy (Snpe_UserBufferMap_Handle_t other)
 
SNPE_API void Snpe_UserBufferMap_Add (Snpe_UserBufferMap_Handle_t handle, const char *name, Snpe_IUserBuffer_Handle_t bufferHandle)
 
SNPE_API Snpe_ErrorCode_t Snpe_UserBufferMap_Remove (Snpe_UserBufferMap_Handle_t handle, const char *name)
 
SNPE_API size_t Snpe_UserBufferMap_Size (Snpe_UserBufferMap_Handle_t handle)
 
SNPE_API Snpe_ErrorCode_t Snpe_UserBufferMap_Clear (Snpe_UserBufferMap_Handle_t handle)
 
SNPE_API Snpe_IUserBuffer_Handle_t Snpe_UserBufferMap_GetUserBuffer_Ref (Snpe_UserBufferMap_Handle_t handle, const char *name)
 
SNPE_API Snpe_StringList_Handle_t Snpe_UserBufferMap_GetUserBufferNames (Snpe_UserBufferMap_Handle_t handle)
 
SNPE_API Snpe_ErrorCode_t Snpe_UserBufferMap_Assign (Snpe_UserBufferMap_Handle_t srcHandle, Snpe_UserBufferMap_Handle_t dstHandle)
 
SNPE_API Snpe_ErrorCode_t Snpe_UserBufferMap_Delete (Snpe_UserBufferMap_Handle_t handle)
 

UserMemoryMap

Description of UserMemoryMap.

typedef void * Snpe_UserMemoryMap_Handle_t
 
SNPE_API Snpe_UserMemoryMap_Handle_t Snpe_UserMemoryMap_Create ()
 
SNPE_API Snpe_UserMemoryMap_Handle_t Snpe_UserMemoryMap_Copy (Snpe_UserMemoryMap_Handle_t other)
 
SNPE_API Snpe_ErrorCode_t Snpe_UserMemoryMap_Delete (Snpe_UserMemoryMap_Handle_t handle)
 
SNPE_API Snpe_ErrorCode_t Snpe_UserMemoryMap_Add (Snpe_UserMemoryMap_Handle_t handle, const char *name, void *address)
 
SNPE_API Snpe_ErrorCode_t Snpe_UserMemoryMap_Remove (Snpe_UserMemoryMap_Handle_t handle, const char *name)
 
SNPE_API size_t Snpe_UserMemoryMap_Size (Snpe_UserMemoryMap_Handle_t handle)
 
SNPE_API Snpe_ErrorCode_t Snpe_UserMemoryMap_Clear (Snpe_UserMemoryMap_Handle_t handle)
 
SNPE_API Snpe_StringList_Handle_t Snpe_UserMemoryMap_GetUserBufferNames (Snpe_UserMemoryMap_Handle_t handle)
 
SNPE_API size_t Snpe_UserMemoryMap_GetUserMemoryAddressCount (Snpe_UserMemoryMap_Handle_t handle, const char *name)
 
SNPE_API void * Snpe_UserMemoryMap_GetUserMemoryAddressAtIndex (Snpe_UserMemoryMap_Handle_t handle, const char *name, uint32_t index)
 

Detailed Description

This module defines the SNPE C APIs

Typedef Documentation

◆ Snpe_DlContainer_Handle_t

A typedef to indicate a SNPE DlContainer handle

◆ Snpe_DlcRecord_Handle_t

typedef void* Snpe_DlcRecord_Handle_t

A typedef to indicate a SNPE DlcRecord handle

◆ Snpe_DlVersion_Handle_t

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

◆ Snpe_IBufferAttributes_Handle_t

A typedef to indicate a SNPE IBufferAttributes handle

◆ Snpe_IDiagLog_Handle_t

typedef void* Snpe_IDiagLog_Handle_t

A typedef to indicate a SNPE IDiagLog handle

◆ Snpe_IOBufferDataTypeMap_Handle_t

A typedef to indicate a SNPE IOBufferDataTypeMap handle

◆ Snpe_ITensor_Handle_t

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.

◆ 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.

◆ Snpe_Options_Handle_t

typedef void* Snpe_Options_Handle_t

A typedef to indicate a SNPE Options handle

◆ Snpe_PlatformConfig_Handle_t

A typedef to indicate a SNPE PlatformConfig handle

◆ Snpe_PlatformValidator_Handle_t

A typedef to indicate a SNPE PlatformValidator handle

◆ Snpe_RuntimeList_Handle_t

A typedef to indicate a SNPE RuntimeList handle

◆ Snpe_SNPE_Handle_t

typedef void* Snpe_SNPE_Handle_t

A typedef to indicate a SNPE handle

◆ Snpe_SNPEBuilder_Handle_t

A typedef to indicate a SNPEBuilder handle

◆ Snpe_StringList_Handle_t

typedef void* Snpe_StringList_Handle_t

A typedef to indicate a SNPE StringList handle

◆ Snpe_TensorMap_Handle_t

typedef void* Snpe_TensorMap_Handle_t

A typedef to indicate a SNPE Tensor Map handle

◆ Snpe_TensorShape_Handle_t

A typedef to indicate a SNPE TensorShape handle

◆ Snpe_TensorShapeMap_Handle_t

A typedef to indicate a SNPE TensorShapeMap handle

◆ Snpe_UserBufferEncoding_Handle_t

A typedef to indicate a SNPE UserByfferEncoding handle

◆ Snpe_UserBufferMap_Handle_t

A typedef to indicate a SNPE UserBufferMap handle

◆ Snpe_UserBufferSource_Handle_t

A base class buffer source type

Note
User buffer from CPU support all kinds of runtimes; User buffer from GLBUFFER support only GPU runtime.

◆ Snpe_UserGLConfig_Handle_t

A structure OpenGL configuration

Note
When certain OpenGL context and display are provided to UserGLConfig for using GPU buffer as input directly, the user MUST ensure the particular OpenGL context and display remain vaild throughout the execution of neural network models.

◆ Snpe_UserGpuConfig_Handle_t

A structure Gpu configuration

◆ Snpe_UserMemoryMap_Handle_t

A typedef to indicate a SNPE User Memory handle

Enumeration Type Documentation

◆ Snpe_ErrorCode_t

Enumeration of error codes

Enumerator
SNPE_SUCCESS 

Indicate success: SNPE_SUCCESS = 0.

◆ Snpe_ExecutionPriorityHint_t

Enumeration of various execution priority hints.

Enumerator
SNPE_EXECUTION_PRIORITY_NORMAL 

Normal priority.

SNPE_EXECUTION_PRIORITY_HIGH 

Higher than normal priority.

SNPE_EXECUTION_PRIORITY_LOW 

Lower priority.

SNPE_EXECUTION_PRIORITY_NORMAL_HIGH 

Between Normal and High priority.

◆ Snpe_ImageEncoding_t

Enumeration that lists the supported image encoding formats.

Enumerator
SNPE_IMAGE_ENCODING_UNKNOWN 

For unknown image type. Also used as a default value for ImageEncoding_t.

SNPE_IMAGE_ENCODING_RGB 

The RGB format consists of 3 bytes per pixel: one byte for Red, one for Green, and one for Blue. The byte ordering is endian independent and is always in RGB byte order.

SNPE_IMAGE_ENCODING_ARGB32 

The ARGB32 format consists of 4 bytes per pixel: one byte for Red, one for Green, one for Blue, and one for the alpha channel. The alpha channel is ignored. The byte ordering depends on the underlying CPU. For little endian CPUs, the byte order is BGRA. For big endian CPUs, the byte order is ARGB.

SNPE_IMAGE_ENCODING_RGBA 

The RGBA format consists of 4 bytes per pixel: one byte for Red, one for Green, one for Blue, and one for the alpha channel. The alpha channel is ignored. The byte ordering is endian independent and is always in RGBA byte order.

SNPE_IMAGE_ENCODING_GRAYSCALE 

The GRAYSCALE format is for 8-bit grayscale.

SNPE_IMAGE_ENCODING_NV21 

NV21 is the Android version of YUV. The Chrominance is down sampled and has a subsampling ratio of 4:2:0. Note that this image format has 3 channels, but the U and V channels are subsampled. For every four Y pixels there is one U and one V pixel.

SNPE_IMAGE_ENCODING_BGR 

The BGR format consists of 3 bytes per pixel: one byte for Red, one for Green and one for Blue. The byte ordering is endian independent and is always BGR byte order.

◆ Snpe_IOBufferDataType_t

Enumeration that list the supported data types for buffers

Enumerator
SNPE_IO_BUFFER_DATATYPE_UNSPECIFIED 

Unspecified.

SNPE_IO_BUFFER_DATATYPE_FLOATING_POINT_32 

32-bit floating point

SNPE_IO_BUFFER_DATATYPE_FLOATING_POINT_16 

16-bit floating point

SNPE_IO_BUFFER_DATATYPE_FIXED_POINT_8 

8-bit fixed point

SNPE_IO_BUFFER_DATATYPE_FIXED_POINT_16 

16-bit fixed point

◆ Snpe_LogLevel_t

Enumeration that lists the supported LogLevels that can be set by users.

Enumerator
SNPE_LOG_LEVEL_FATAL 

Enumeration variable to be used by user to set logging level to FATAL.

SNPE_LOG_LEVEL_ERROR 

Enumeration variable to be used by user to set logging level to ERROR.

SNPE_LOG_LEVEL_WARN 

Enumeration variable to be used by user to set logging level to WARN.

SNPE_LOG_LEVEL_INFO 

Enumeration variable to be used by user to set logging level to INFO.

SNPE_LOG_LEVEL_VERBOSE 

Enumeration variable to be used by user to set logging level to VERBOSE.

◆ Snpe_PerformanceProfile_t

Enumeration of various performance profiles that can be requested.

Enumerator
SNPE_PERFORMANCE_PROFILE_DEFAULT 

Run in a standard mode. This mode will be deprecated in the future and replaced with BALANCED.

SNPE_PERFORMANCE_PROFILE_BALANCED 

Run in a balanced mode.

SNPE_PERFORMANCE_PROFILE_HIGH_PERFORMANCE 

Run in high performance mode.

SNPE_PERFORMANCE_PROFILE_POWER_SAVER 

Run in a power sensitive mode, at the expense of performance.

SNPE_PERFORMANCE_PROFILE_SYSTEM_SETTINGS 

Use system settings. SNPE makes no calls to any performance related APIs.

SNPE_PERFORMANCE_PROFILE_SUSTAINED_HIGH_PERFORMANCE 

Run in sustained high performance mode.

SNPE_PERFORMANCE_PROFILE_BURST 

Run in burst mode.

SNPE_PERFORMANCE_PROFILE_LOW_POWER_SAVER 

Run in lower clock than POWER_SAVER, at the expense of performance.

SNPE_PERFORMANCE_PROFILE_HIGH_POWER_SAVER 

Run in higher clock and provides better performance than POWER_SAVER.

SNPE_PERFORMANCE_PROFILE_LOW_BALANCED 

Run in lower balanced mode.

◆ Snpe_PlatformConfig_PlatformType_t

Enumerator
SNPE_PLATFORMCONFIG_PLATFORMTYPE_UNKNOWN 

Unknown platform type.

SNPE_PLATFORMCONFIG_PLATFORMTYPE_CPU 

Snapdragon CPU.

SNPE_PLATFORMCONFIG_PLATFORMTYPE_GPU 

Adreno GPU.

SNPE_PLATFORMCONFIG_PLATFORMTYPE_DSP 

Hexagon DSP.

◆ Snpe_ProfilingLevel_t

Enumeration of various profilngLevels that can be requested.

Enumerator
SNPE_PROFILING_LEVEL_OFF 

No profiling. Collects no runtime stats in the DiagLog

SNPE_PROFILING_LEVEL_BASIC 

Basic profiling Collects some runtime stats in the DiagLog

SNPE_PROFILING_LEVEL_DETAILED 

Detailed profiling Collects more runtime stats in the DiagLog, including per-layer statistics Performance may be impacted

SNPE_PROFILING_LEVEL_MODERATE 

Moderate profiling Collects more runtime stats in the DiagLog, no per-layer statistics

◆ Snpe_Runtime_t

Enumeration of supported target runtimes.

Enumerator
SNPE_RUNTIME_CPU_FLOAT32 

Run the processing on Snapdragon CPU. Data: float 32bit Math: float 32bit

SNPE_RUNTIME_GPU_FLOAT32_16_HYBRID 

Run the processing on the Adreno GPU. Data: float 16bit Math: float 32bit

SNPE_RUNTIME_DSP_FIXED8_TF 

Run the processing on the Hexagon DSP. Data: 8bit fixed point Tensorflow style format Math: 8bit fixed point Tensorflow style format

SNPE_RUNTIME_GPU_FLOAT16 

Run the processing on the Adreno GPU. Data: float 16bit Math: float 16bit

SNPE_RUNTIME_AIP_FIXED8_TF 

Run the processing on Snapdragon AIX+HVX. Data: 8bit fixed point Tensorflow style format Math: 8bit fixed point Tensorflow style format

SNPE_RUNTIME_CPU 

Default legacy enum to retain backward compatibility. CPU = CPU_FLOAT32

SNPE_RUNTIME_GPU 

Default legacy enum to retain backward compatibility. GPU = GPU_FLOAT32_16_HYBRID

SNPE_RUNTIME_DSP 

Default legacy enum to retain backward compatibility. DSP = DSP_FIXED8_TF

SNPE_RUNTIME_UNSET 

Special value indicating the property is unset.

◆ Snpe_RuntimeCheckOption_t

Enumeration of runtime available check options.

Enumerator
SNPE_RUNTIME_CHECK_OPTION_DEFAULT 

Perform standard runtime available check.

SNPE_RUNTIME_CHECK_OPTION_NORMAL_CHECK 

Perform standard runtime available check.

SNPE_RUNTIME_CHECK_OPTION_BASIC_CHECK 

Perform basic runtime available check, may be runtime specific.

SNPE_RUNTIME_CHECK_OPTION_UNSIGNEDPD_CHECK 

Perform unsignedPD runtime available check.

◆ Snpe_UserBufferEncoding_ElementType_t

An enum class of all supported element types in a IUserBuffer

Enumerator
SNPE_USERBUFFERENCODING_ELEMENTTYPE_UNKNOWN 

Unknown element type.

SNPE_USERBUFFERENCODING_ELEMENTTYPE_FLOAT 

Each element is presented by float.

SNPE_USERBUFFERENCODING_ELEMENTTYPE_UNSIGNED8BIT 

Each element is presented by an unsigned int.

SNPE_USERBUFFERENCODING_ELEMENTTYPE_FLOAT16 

Each element is presented by float16.

SNPE_USERBUFFERENCODING_ELEMENTTYPE_TF8 

Each element is presented by an 8-bit quantized value.

SNPE_USERBUFFERENCODING_ELEMENTTYPE_TF16 

Each element is presented by an 16-bit quantized value.

SNPE_USERBUFFERENCODING_ELEMENTTYPE_INT32 

Each element is presented by Int32.

SNPE_USERBUFFERENCODING_ELEMENTTYPE_UINT32 

Each element is presented by UInt32.

SNPE_USERBUFFERENCODING_ELEMENTTYPE_INT8 

Each element is presented by Int8.

SNPE_USERBUFFERENCODING_ELEMENTTYPE_UINT8 

Each element is presented by UInt8.

◆ Snpe_UserBufferSource_SourceType_t

Enumerator
SNPE_USERBUFFERSOURCE_SOURCETYPE_UNKNOWN 

Unknown buffer source type.

SNPE_USERBUFFERSOURCE_SOURCETYPE_CPU 

The network inputs are from CPU buffer.

SNPE_USERBUFFERSOURCE_SOURCETYPE_GLBUFFER 

The network inputs are from OpenGL buffer.

Function Documentation

◆ Snpe_DlContainer_Delete()

SNPE_API Snpe_ErrorCode_t Snpe_DlContainer_Delete ( Snpe_DlContainer_Handle_t  dlContainerHandle)

Destroys/frees a DlContainer

Parameters
[in]dlContainerHandle: Handle to access DlContainer
Returns
indication of success/failures

◆ Snpe_DlContainer_GetCatalog()

SNPE_API Snpe_StringList_Handle_t Snpe_DlContainer_GetCatalog ( Snpe_DlContainer_Handle_t  dlContainerHandle)

Get the record catalog for a container.

Parameters
[in]dlContainerHandle: Handle to access DlContainer
Returns
A Snpe_StringListHandle_t that holds the record names of the DlContainer

◆ Snpe_DlContainer_GetRecord()

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.

Parameters
[in]dlContainerHandle: Handle to access DlContainer
[in]recordName: Name of the record to fetch.
Returns
A Snpe_DlcRecordHandle_t that owns the record read from the DlContainer

◆ Snpe_DlContainer_Open()

SNPE_API Snpe_DlContainer_Handle_t Snpe_DlContainer_Open ( const char *  filename)

Initializes a container from a container archive file.

Parameters
[in]filenameContainer archive file path.
Returns
Status of container open call

◆ Snpe_DlContainer_OpenBuffer()

SNPE_API Snpe_DlContainer_Handle_t Snpe_DlContainer_OpenBuffer ( const uint8_t *  buffer,
const size_t  size 
)

Initializes a container from a byte buffer.

Parameters
[in]bufferByte buffer holding the contents of an archive file.
[in]sizeSize of the byte buffer.
Returns
A Snpe_DlContainer_Handle_t to access the dlContainer

◆ Snpe_DlContainer_Save()

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.

Parameters
[in]dlContainerHandle: Handle to access DlContainer
[in]filename: Container archive file path.
Returns
indication of success/failure

◆ Snpe_DlcRecord_Create()

SNPE_API Snpe_DlcRecord_Handle_t Snpe_DlcRecord_Create ( )

Constructs a DlcRecord and returns a handle to it

Returns
the handle to the created DlcRecord

◆ Snpe_DlcRecord_Data()

SNPE_API uint8_t* Snpe_DlcRecord_Data ( Snpe_DlcRecord_Handle_t  dlcRecordHandle)

Gets a pointer to the start of the DlcRecord's data

Parameters
[in]dlcRecordHandle: Handle to access DlcRecord
Returns
uint8_t pointer to the DlcRecord's data

◆ Snpe_DlcRecord_Delete()

SNPE_API Snpe_ErrorCode_t Snpe_DlcRecord_Delete ( Snpe_DlcRecord_Handle_t  dlcRecordHandle)

Destroys/frees a DlcRecord

Parameters
[in]dlcRecordHandle: Handle to access DlcRecord
Returns
indication of success/failures

◆ Snpe_DlcRecord_Size()

SNPE_API size_t Snpe_DlcRecord_Size ( Snpe_DlcRecord_Handle_t  dlcRecordHandle)

Gets the size of a DlcRecord in bytes

Parameters
[in]dlcRecordHandle: Handle to access DlcRecord
Returns
the size of the DlcRecord in bytes

◆ Snpe_DlVersion_Delete()

SNPE_API Snpe_ErrorCode_t Snpe_DlVersion_Delete ( Snpe_DlVersion_Handle_t  handle)

Destroys/frees DlVersion

Parameters
[in]handle: Handle to access DlVersion
Returns
SNPE_SUCCESS if Delete operation successful.

◆ Snpe_DlVersion_GetBuild()

SNPE_API const char* Snpe_DlVersion_GetBuild ( Snpe_DlVersion_Handle_t  handle)

Get the string holding information about the build version.

Parameters
[in]handle: Handle to access DlVersion
Returns
Build information

◆ Snpe_DlVersion_GetMajor()

SNPE_API int32_t Snpe_DlVersion_GetMajor ( Snpe_DlVersion_Handle_t  handle)

Get the major version number.

Parameters
[in]handle: Handle to access DlVersion
Returns
Major version

◆ Snpe_DlVersion_GetMinor()

SNPE_API int32_t Snpe_DlVersion_GetMinor ( Snpe_DlVersion_Handle_t  handle)

Get the minor version number.

Parameters
[in]handle: Handle to access DlVersion
Returns
Minor version

◆ Snpe_DlVersion_GetTeeny()

SNPE_API int32_t Snpe_DlVersion_GetTeeny ( Snpe_DlVersion_Handle_t  handle)

Get the teeny version number.

Parameters
[in]handle: Handle to access DlVersion
Returns
Teeny version

◆ Snpe_DlVersion_ToString()

SNPE_API const char* Snpe_DlVersion_ToString ( Snpe_DlVersion_Handle_t  handle)

Returns a string in the form Major.Minor.Teeny.Build.

Parameters
[in]handle: Handle to access DlVersion
Returns
A formatted char* holding the version information.
Note
the returned string will be invalidated by subsequent calls to this function

◆ Snpe_ErrorCode_clearLastErrorCode()

SNPE_API void Snpe_ErrorCode_clearLastErrorCode ( )

Clear the last error code

◆ Snpe_ErrorCode_enumToUInt32()

SNPE_API uint32_t Snpe_ErrorCode_enumToUInt32 ( Snpe_ErrorCode_t  code)

Returns the uint32_t representation of the error code enum.

Parameters
[in]codeThe error code to be converted.
Returns
uint32_t representation of the error code.

◆ Snpe_ErrorCode_getLastErrorCode()

SNPE_API Snpe_ErrorCode_t Snpe_ErrorCode_getLastErrorCode ( )

Returns the error code of the last error encountered.

Returns
The error code.
Note
The returned error code is significant only when the return value of the call indicated an error.

◆ Snpe_ErrorCode_GetLastErrorString()

SNPE_API const char* Snpe_ErrorCode_GetLastErrorString ( )

Returns the error string of the last error encountered.

Returns
The error string.
Note
The returned error string is significant only when the return value of the call indicated an error.

◆ Snpe_ErrorCode_getLastInfoString()

SNPE_API const char* Snpe_ErrorCode_getLastInfoString ( )

Returns the info string of the last error encountered.

◆ Snpe_IBufferAttributes_Delete()

SNPE_API Snpe_ErrorCode_t Snpe_IBufferAttributes_Delete ( Snpe_IBufferAttributes_Handle_t  handle)

Destroys the IBufferAttributes object.

Parameters
[handle]handle : Handle to access IBufferAttributes
Returns
Error code. Returns SNPE_SUCCESS if destruction successful

◆ Snpe_IBufferAttributes_GetAlignments()

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.

Parameters
[in]handle: Handle to access IBufferAttributes
Returns
Alignment in each dimension, in terms of multiple of number of elements

◆ Snpe_IBufferAttributes_GetDims()

SNPE_API Snpe_TensorShape_Handle_t Snpe_IBufferAttributes_GetDims ( Snpe_IBufferAttributes_Handle_t  handle)

Gets the number of elements in each dimension.

Parameters
[in]handle: Handle to access IBufferAttributes
Returns
Dimension size, in terms of number of elements

◆ Snpe_IBufferAttributes_GetElementSize()

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.

Parameters
[in]handle: Handle to access IBufferAttributes
Returns
Element size, in bytes

◆ Snpe_IBufferAttributes_GetEncoding_Ref()

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.

Parameters
[in]handle: Handle to access IBufferAttributes
Returns
Derived user buffer encoding object.

◆ Snpe_IBufferAttributes_GetEncodingType()

SNPE_API Snpe_UserBufferEncoding_ElementType_t Snpe_IBufferAttributes_GetEncodingType ( Snpe_IBufferAttributes_Handle_t  handle)

Gets the element's encoding type.

Parameters
[in]handle: Handle to access IBufferAttributes
Returns
encoding type

◆ Snpe_IDiagLog_GetOptions()

SNPE_API Snpe_Options_Handle_t Snpe_IDiagLog_GetOptions ( Snpe_IDiagLog_Handle_t  handle)

Gets the curent options for the diag logger.

Parameters
[in]handle: Handle to access IDiagLog
Returns
Handle to access DiagLog options.

◆ Snpe_IDiagLog_SetDiagLogMask()

SNPE_API Snpe_ErrorCode_t Snpe_IDiagLog_SetDiagLogMask ( Snpe_IDiagLog_Handle_t  handle,
const char *  mask 
)

Parameters
[in]handle: Handle to access IDiagLog
[in]mask: Allows for setting the log mask once diag logging has started
Returns
SNPE_SUCCESS if the level was set successfully.

◆ Snpe_IDiagLog_SetOptions()

SNPE_API Snpe_ErrorCode_t Snpe_IDiagLog_SetOptions ( Snpe_IDiagLog_Handle_t  handle,
Snpe_Options_Handle_t  loggingOptionsHandle 
)

Sets the options after initialization occurs.

Parameters
[in]handle: Handle to access IDiagLog
[in]loggingOptions: The options to set up diagnostic logging.
Returns
Error code if the options could not be set. Ensure logging is not started/ SNPE_SUCCESS otherwise

◆ Snpe_IDiagLog_Start()

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.

Parameters
[in]handle: Handle to access IDiagLog
Returns
SNPE_SUCCESS if diagnostic logging started successfully.

◆ Snpe_IDiagLog_Stop()

SNPE_API Snpe_ErrorCode_t Snpe_IDiagLog_Stop ( Snpe_IDiagLog_Handle_t  handle)

Disables logging.

Parameters
[in]handle: Handle to access IDiagLog
Returns
SNPE_SUCCESS if logging stopped successfully. Error code otherwise.

◆ Snpe_IOBufferDataTypeMap_Add()

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.

Parameters
[in]handle: Handle to access the IOBufferDataType map
[in]name: The name of the buffer
[in]bufferDataType: data type of the buffer
Note
If a buffer with the same name already exists, no new buffer is added.

◆ Snpe_IOBufferDataTypeMap_Create()

SNPE_API Snpe_IOBufferDataTypeMap_Handle_t Snpe_IOBufferDataTypeMap_Create ( )

Creates a new Buffer Data type map

◆ Snpe_IOBufferDataTypeMap_Delete()

SNPE_API Snpe_ErrorCode_t Snpe_IOBufferDataTypeMap_Delete ( Snpe_IOBufferDataTypeMap_Handle_t  handle)

Destroys the map.

Parameters
[in]handle: Handle to access the IOBufferDataType map
Returns
Error code. Returns SNPE_SUCCESS if destruction successful

◆ Snpe_IOBufferDataTypeMap_Empty()

SNPE_API int Snpe_IOBufferDataTypeMap_Empty ( Snpe_IOBufferDataTypeMap_Handle_t  handle)

Checks whether the map is empty.

Returns
1 if the map is empty, 0 otherwise.

◆ Snpe_IOBufferDataTypeMap_Find()

SNPE_API int Snpe_IOBufferDataTypeMap_Find ( Snpe_IOBufferDataTypeMap_Handle_t  handle,
const char *  name 
)

Checks the existence of the named buffer in the map.

Parameters
[in]handle: Handle to access the IOBufferDataType map
[in]name: The name of the buffer
Returns
1 if the named buffer exists, 0 otherwise.

◆ Snpe_IOBufferDataTypeMap_GetBufferDataType()

SNPE_API Snpe_IOBufferDataType_t Snpe_IOBufferDataTypeMap_GetBufferDataType ( Snpe_IOBufferDataTypeMap_Handle_t  handle,
const char *  name 
)

Returns the type of the named buffer.

Parameters
[in]handle: Handle to access the IOBufferDataType map
[in]name: The name of the buffer
Returns
The type of the buffer, or UNSPECIFIED if the buffer does not exist

◆ Snpe_IOBufferDataTypeMap_Remove()

SNPE_API Snpe_ErrorCode_t Snpe_IOBufferDataTypeMap_Remove ( Snpe_IOBufferDataTypeMap_Handle_t  handle,
const char *  name 
)

Removes a buffer name from the map.

Parameters
[in]handle: Handle to access the IOBufferDataType map
[in]name: The name of the buffer

◆ Snpe_IOBufferDataTypeMap_Size()

SNPE_API size_t Snpe_IOBufferDataTypeMap_Size ( Snpe_IOBufferDataTypeMap_Handle_t  handle)

Returns the size of the buffer type map.

Parameters
[in]handle: Handle to access the IOBufferDataType map
Returns
The size of the map

◆ Snpe_ITensor_Delete()

SNPE_API Snpe_ErrorCode_t Snpe_ITensor_Delete ( Snpe_ITensor_Handle_t  iTensorHandle)

Destroys/frees an ITensor

Parameters
[in]userBufferHandle: Handle to access the IUserBuffer
Returns
SNPE_SUCCESS if Delete operation successful.

◆ Snpe_ITensor_GetData()

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.

Parameters
[in]tensorHandle: Handle to access ITensor
Returns
The tensor data as a void pointer.

◆ Snpe_ITensor_GetShape()

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.

Parameters
[in]tensorHandle: Handle to access ITensor
Returns
A TensorShape handle holding the tensor dimensions.

◆ Snpe_ITensor_GetSize()

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.

Parameters
[in]tensorHandle: Handle to access ITensor
Returns
The size of the tensor (in elements).

◆ Snpe_IUserBuffer_Delete()

SNPE_API Snpe_ErrorCode_t Snpe_IUserBuffer_Delete ( Snpe_IUserBuffer_Handle_t  userBufferHandle)

Destroys/frees an IUserBuffer

Parameters
[in]userBufferHandle: Handle to access the IUserBuffer
Returns
SNPE_SUCCESS if Delete operation successful.

◆ Snpe_IUserBuffer_GetEncoding_Ref()

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.

Parameters
[in]userBufferHandle: Handle to access the user Buffer
Returns
Data encoding meta-data

◆ Snpe_IUserBuffer_GetOutputSize()

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.

Parameters
[in]userBufferHandle: Handle to access the user Buffer
Returns
Size required for the buffer to hold all inference results, which can be less or more than the size of the buffer, in bytes.

◆ Snpe_IUserBuffer_GetSize()

SNPE_API size_t Snpe_IUserBuffer_GetSize ( Snpe_IUserBuffer_Handle_t  userBufferHandle)

Retrieves the size of the buffer, in bytes.

Parameters
[in]userBufferHandle: Handle to access the user Buffer
Returns
Size of the underlying buffer, in bytes.

◆ Snpe_IUserBuffer_GetStrides_Ref()

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.

Parameters
[in]userBufferHandle: Handle to access the user Buffer
Warning
Do not modify the TensorShape returned by reference. Treat it as a const reference.
Returns
A const reference to the number of bytes between elements in each dimension. e.g. A tightly packed tensor of floats with dimensions [4, 3, 2] would return strides of [24, 8, 4].

◆ Snpe_IUserBuffer_SetBufferAddress()

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.

Parameters
[in]userBufferHandle: Handle to access the user Buffer
[in]buffer: Pointer to the memory location
Returns
Whether the set succeeds.

◆ Snpe_Options_Delete()

SNPE_API Snpe_ErrorCode_t Snpe_Options_Delete ( Snpe_Options_Handle_t  handle)

Destroys/frees a Options

Parameters
[in]handle: Handle to access Options object
Returns
indication of success/failures

◆ Snpe_Options_GetDiagLogMask()

SNPE_API const char* Snpe_Options_GetDiagLogMask ( Snpe_Options_Handle_t  handle)

Gets DiagLogMask diagLogMask: Enables diag logging only on the specified area mask

Parameters
[in]handle: Handle to access Options object
Returns
diagLogMask as a const char*

◆ Snpe_Options_GetLogFileDirectory()

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

Parameters
[in]handle: Handle to access Options object
Returns
logFileDirectory as a const char*

◆ Snpe_Options_GetLogFileName()

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.

Parameters
[in]handle: Handle to access Options object
Returns
logFileName as a const char*

◆ Snpe_Options_GetLogFileReplace()

SNPE_API int Snpe_Options_GetLogFileReplace ( Snpe_Options_Handle_t  handle)

If the log file already exists, control whether it will be replaced

Parameters
[in]handle: Handle to access options object
Returns
1 if log file will be replaced, 0 otherwise

◆ Snpe_Options_GetLogFileRotateCount()

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.

Parameters
[in]handle: Handle to access options object.
Returns
max log files to create

◆ Snpe_Options_SetDiagLogMask()

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

Parameters
[in]handle: Handle to access Options object
[in]diagLogMask: specific area where logging needs to be enabed

◆ Snpe_Options_SetLogFileDirectory()

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

Parameters
[in]handle: Handle to access Options object
[in]logFileDirectory: path for saving the log files

◆ Snpe_Options_SetLogFileName()

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.

Parameters
[in]handle: Handle to access Options object
[in]logFileName: name of log file

◆ Snpe_Options_SetLogFileReplace()

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

Parameters
[in]handle: Handle to access options object
[in]logFileReplace: 1 if log file to be replaced, 0 otherwise

◆ Snpe_Options_SetLogFileRotateCount()

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.

Parameters
[in]handle: Handle to access options object.
[in]logFileRotateCount: max log files to create

◆ Snpe_PlatformConfig_Create()

SNPE_API Snpe_PlatformConfig_Handle_t Snpe_PlatformConfig_Create ( )

Creates a new PlatformConfig

◆ Snpe_PlatformConfig_Delete()

SNPE_API Snpe_ErrorCode_t Snpe_PlatformConfig_Delete ( Snpe_PlatformConfig_Handle_t  handle)

Destroys the PlatformConfig.

Parameters
[in]handle: Handle needed to access the platformConfig
Returns
Error code. Returns SNPE_SUCCESS if destruction successful

◆ Snpe_PlatformConfig_GetPlatformOptions()

SNPE_API const char* Snpe_PlatformConfig_GetPlatformOptions ( Snpe_PlatformConfig_Handle_t  handle)

Gets the platform options.

Parameters
[in]handle: Handle needed to access the platformConfig
Returns
Options as a const char*

◆ Snpe_PlatformConfig_GetPlatformType()

SNPE_API Snpe_PlatformConfig_PlatformType_t Snpe_PlatformConfig_GetPlatformType ( Snpe_PlatformConfig_Handle_t  handle)

Retrieves the platform type.

Parameters
[in]handle: Handle needed to access the platformConfig
Returns
Platform type

◆ Snpe_PlatformConfig_GetUserGpuConfig()

SNPE_API Snpe_UserGpuConfig_Handle_t Snpe_PlatformConfig_GetUserGpuConfig ( Snpe_PlatformConfig_Handle_t  handle)

Retrieves the Gpu configuration.

Parameters
[in]handle: Handle needed to access the platformConfig
Returns
userGpuConfig populated with the Gpu configuration.

◆ Snpe_PlatformConfig_IsOptionsValid()

SNPE_API int Snpe_PlatformConfig_IsOptionsValid ( Snpe_PlatformConfig_Handle_t  handle)

Indicates whther the plaform configuration is valid.

Parameters
[in]handle: Handle needed to access the platformConfig
Returns
1 if the platform configuration is valid; 0 otherwise.

◆ Snpe_PlatformConfig_IsValid()

SNPE_API int Snpe_PlatformConfig_IsValid ( Snpe_PlatformConfig_Handle_t  handle)

Indicates whther the plaform configuration is valid.

Parameters
[in]handle: Handle needed to access the platformConfig
Returns
1 if the platform configuration is valid; 0 otherwise.

◆ Snpe_PlatformConfig_RemovePlatformOptionValue()

SNPE_API int Snpe_PlatformConfig_RemovePlatformOptionValue ( Snpe_PlatformConfig_Handle_t  handle,
const char *  optionName,
const char *  value 
)

Removes the platform options.

Parameters
[in]handle: Handle needed to access the platformConfig
[in]optionName: Name of platform options"
[in]value: Value of specified optionName
Returns
If 1, removed "optionName:value" to platform options if optionName don't exist, do nothing. If 0, the platform options will not be changed.

◆ Snpe_PlatformConfig_SetPlatformOptions()

SNPE_API int Snpe_PlatformConfig_SetPlatformOptions ( Snpe_PlatformConfig_Handle_t  handle,
const char *  options 
)

Sets the platform options.

Parameters
[in]handle: Handle needed to access the platformConfig
[in]options: Options as a const char* in the form of "keyword:options"
Returns
1 if options are pass validation; otherwise 0. If false, the options are not updated.

◆ Snpe_PlatformConfig_SetPlatformOptionValue()

SNPE_API int Snpe_PlatformConfig_SetPlatformOptionValue ( Snpe_PlatformConfig_Handle_t  handle,
const char *  optionName,
const char *  value 
)

Sets the platform options.

Note
the returned string will be invalidated by subsequent calls to this function
Parameters
[in]handle: Handle needed to access the platformConfig
[in]optionName: Name of platform options"
[in]value: Value of specified optionName
Returns
If 1, add "optionName:value" to platform options if optionName don't exist, otherwise update the value of specified optionName. If 0, the platform options will not be changed.

◆ Snpe_PlatformConfig_SetUserGpuConfig()

SNPE_API int Snpe_PlatformConfig_SetUserGpuConfig ( Snpe_PlatformConfig_Handle_t  handle,
Snpe_UserGpuConfig_Handle_t  gpuHandle 
)

Sets the Gpu configuration.

Parameters
[in]handle: Handle needed to access the platformConfig
[in]gpuHandle: Gpu Configuration handle
Returns
1 if Gpu configuration was successfully set; 0 otherwise.

◆ Snpe_PlatformValidator_Create()

SNPE_API Snpe_PlatformValidator_Handle_t Snpe_PlatformValidator_Create ( )

Creates a new Platform Validator

◆ Snpe_PlatformValidator_Delete()

SNPE_API Snpe_ErrorCode_t Snpe_PlatformValidator_Delete ( Snpe_PlatformValidator_Handle_t  handle)

Destroys/frees Platform Validator

Parameters
[in]handle: Handle to access Platform Validator
Returns
SNPE_SUCCESS if Delete operation successful.

◆ Snpe_PlatformValidator_GetCoreVersion()

SNPE_API const char* Snpe_PlatformValidator_GetCoreVersion ( Snpe_PlatformValidator_Handle_t  handle)

Returns the core version for the Runtime selected.

Returns
char* which contains the actual core version value

◆ Snpe_PlatformValidator_GetLibVersion()

SNPE_API const char* Snpe_PlatformValidator_GetLibVersion ( Snpe_PlatformValidator_Handle_t  handle)

Returns the library version for the Runtime selected.

Returns
char* which contains the actual lib version value

◆ Snpe_PlatformValidator_IsRuntimeAvailable()

SNPE_API int Snpe_PlatformValidator_IsRuntimeAvailable ( Snpe_PlatformValidator_Handle_t  handle)

Checks if the Runtime prerequisites for SNPE are available.

Returns
1 if the Runtime prerequisites are available, else 0.

◆ Snpe_PlatformValidator_RuntimeCheck()

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.

Returns
If 1, the device is ready for SNPE execution, else return 0.

◆ Snpe_PlatformValidator_SetRuntime()

SNPE_API void Snpe_PlatformValidator_SetRuntime ( Snpe_PlatformValidator_Handle_t  handle,
Snpe_Runtime_t  runtime 
)

Sets the runtime processor for compatibility check.

Returns
Void

◆ Snpe_RuntimeList_Add()

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.

Parameters
[in]runtimeListHandleHandle needed to access the runtimeList
[in]runtimeto add
Returns
Error code. Ruturns SNPE_SUCCESS If the runtime added successfully

◆ Snpe_RuntimeList_Clear()

SNPE_API Snpe_ErrorCode_t Snpe_RuntimeList_Clear ( Snpe_RuntimeList_Handle_t  runtimeListHandle)

Removes all runtime from the list

Parameters
[in]runtimeListHandleHandle needed to access the runtimeList
Returns
Error code. Returns SNPE_SUCCESS if runtime list is cleared successfully.

◆ Snpe_RuntimeList_Create()

SNPE_API Snpe_RuntimeList_Handle_t Snpe_RuntimeList_Create ( )

Creates a new runtime list

◆ Snpe_RuntimeList_Delete()

SNPE_API Snpe_ErrorCode_t Snpe_RuntimeList_Delete ( Snpe_RuntimeList_Handle_t  runtimeListHandle)

Destroys the RuntimeList.

Parameters
[in]runtimeListHandle: Handle needed to access the runtimeList
Returns
Error code. Returns SNPE_SUCCESS if destruction successful

◆ Snpe_RuntimeList_Empty()

SNPE_API int Snpe_RuntimeList_Empty ( Snpe_RuntimeList_Handle_t  runtimeListHandle)

Returns 1 if the list is empty.

Parameters
[in]runtimeListHandleHandle needed to access the runtimeList
Returns
1 if list empty, 0 otherwise.

◆ Snpe_RuntimeList_GetRuntime()

SNPE_API Snpe_Runtime_t Snpe_RuntimeList_GetRuntime ( Snpe_RuntimeList_Handle_t  runtimeListHandle,
int  index 
)

Returns the Runtime from list at position index.

Parameters
[in]runtimeListHandleHandle needed to access the runtimeList
[in]index: position in runtimeList
Returns
Error code. Returns SNPE_SUCCESS if destruction successful

◆ Snpe_RuntimeList_Remove()

SNPE_API Snpe_ErrorCode_t Snpe_RuntimeList_Remove ( Snpe_RuntimeList_Handle_t  runtimeListHandle,
Snpe_Runtime_t  runtime 
)

Removes the runtime from the list.

Parameters
[in]runtimeListHandleHandle needed to access the runtimeList
[in]runtimeto be removed
Returns
Error code. Ruturns SNPE_SUCCESS If the runtime added successfully

◆ Snpe_RuntimeList_RuntimeToString()

SNPE_API const char* Snpe_RuntimeList_RuntimeToString ( Snpe_Runtime_t  runtime)

Parameters
[in]runtimeReturns a const char* corresponding to the in param runtime enum

◆ Snpe_RuntimeList_Size()

SNPE_API size_t Snpe_RuntimeList_Size ( Snpe_RuntimeList_Handle_t  runtimeListHandle)

Returns the number of runtimes in the list.

Parameters
[in]runtimeListHandleHandle needed to access the runtimeList
Returns
number of entries in the runtimeList.

◆ Snpe_RuntimeList_StringToRuntime()

SNPE_API Snpe_Runtime_t Snpe_RuntimeList_StringToRuntime ( const char *  str)

Parameters
[in]runtimeconst char* Returns a Runtime enum corresponding to the in param string

◆ Snpe_SNPE_Delete()

SNPE_API Snpe_ErrorCode_t Snpe_SNPE_Delete ( Snpe_SNPE_Handle_t  snpeHandle)

Destroys/frees a SNPE object

Parameters
[in]snpeHandleHandle to access the SNPE object
Returns
SNPE_SUCCESS if Delete operation successful.

◆ Snpe_SNPE_DeregisterIonBuffers()

SNPE_API Snpe_ErrorCode_t Snpe_SNPE_DeregisterIonBuffers ( Snpe_SNPE_Handle_t  snpeHandle,
Snpe_StringList_Handle_t  ionBufferNamesHandle 
)

Deregister Client ION Buffers.

Parameters
[in]snpeHandleHandle to access the SNPE object
[in]ionBufferNamesHandleA StringList of ION Buffer names
Returns
SNPE_SUCCESS upon successful ION Buffer deregistration

◆ Snpe_SNPE_ExecuteITensors()

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.

Parameters
[in]snpeHandleHandle to access the SNPE object
[in]inputHandleA 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]outputHandleAn 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
Note
output TensorMap has to be empty. To forward propagate and get results in user-supplied tensors, use executeWithSuppliedOutputTensors.
Returns
SNPE_SUCCESS upon successful execution

◆ Snpe_SNPE_ExecuteUserBuffers()

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.

Parameters
[in]snpeHandleHandle to access the SNPE object
[in]inputHandleA 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]outputHandleA map of UserBuffers that will hold the output data of potentially multiple layers (the key in the map is the UserBuffer name)
Note
input and output UserBuffer maps must be fully pre-populated. with dimensions matching what the network expects. For example, if there are 5 output UserBuffers they all have to be present in map.

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.

Returns
SNPE_SUCCESS upon successful execution

◆ Snpe_SNPE_GetDiagLogInterface_Ref()

SNPE_API Snpe_IDiagLog_Handle_t Snpe_SNPE_GetDiagLogInterface_Ref ( Snpe_SNPE_Handle_t  snpeHandle)

Get the diagnostic logging interface

Parameters
[in]snpeHandleHandle to access the SNPE object

◆ Snpe_SNPE_GetInputDimensions()

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.

Parameters
[in]snpeHandleHandle to access the SNPE object
[in]nameinput name.
Note
Note that this function only makes sense for networks that have a fixed input size. For networks in which the input size varies with each call of Execute(), this function should not be used.
Returns
a TensorShape that maintains dimensions, matching the tensor dimensions for input to the model, where the last entry is the fastest varying dimension, etc.
See also
Snpe_ITensor_Handle_t
Snpe_TensorShape_Handle_t

◆ Snpe_SNPE_GetInputDimensionsOfFirstTensor()

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.

Parameters
[in]snpeHandleHandle to access the SNPE object
Note
Note that this function only makes sense for networks that have a fixed input size. For networks in which the input size varies with each call of Execute(), this function should not be used.
Returns
a TensorShape that maintains dimensions, matching the tensor dimensions for first input to the model, where the last entry is the fastest varying dimension, etc.
See also
Snpe_ITensor_Handle_t
Snpe_TensorShape_Handle_t

◆ Snpe_SNPE_GetInputOutputBufferAttributes()

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.

Parameters
[in]snpeHandleHandle to access the SNPE object
[in]nameTensor name.
Returns
BufferAttributes of input/output tensor named

◆ Snpe_SNPE_GetInputTensorNames()

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.

Parameters
[in]snpeHandleHandle to access the SNPE object
Returns
A StringList of input tensor names.

◆ Snpe_SNPE_GetModelVersion()

SNPE_API const char* Snpe_SNPE_GetModelVersion ( Snpe_SNPE_Handle_t  snpeHandle)

Returns the version string embedded at model conversion time.

Parameters
[in]snpeHandleHandle to access the SNPE object
Returns
Model version string, which is a free-form string supplied at the time of the conversion

◆ Snpe_SNPE_GetOutputLayerNames()

SNPE_API Snpe_StringList_Handle_t Snpe_SNPE_GetOutputLayerNames ( Snpe_SNPE_Handle_t  snpeHandle)

Gets the output layer(s) for the network.

Parameters
[in]snpeHandleHandle to access the SNPE object
Note
The output layers returned by this function may be different than those specified when the network was created via the SNPEBuilder. For example, if the network was created in debug mode with no explicit output layers specified, this will contain all layers.
Returns
A StringList of output layer names.

◆ Snpe_SNPE_GetOutputTensorNames()

SNPE_API Snpe_StringList_Handle_t Snpe_SNPE_GetOutputTensorNames ( Snpe_SNPE_Handle_t  snpeHandle)

Gets the names of output tensors to the network.

Parameters
[in]snpeHandleHandle to access the SNPE object
Returns
List of output tensor names.

◆ Snpe_SNPE_GetOutputTensorNamesByLayerName()

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.

Parameters
[in]snpeHandleHandle to access the SNPE object
[in]nameLayer name
Returns
Output tensor names.

◆ Snpe_SNPE_RegisterIonBuffers()

SNPE_API Snpe_ErrorCode_t Snpe_SNPE_RegisterIonBuffers ( Snpe_SNPE_Handle_t  snpeHandle,
Snpe_UserMemoryMap_Handle_t  ionBufferMapHandle 
)

Register Client ION Buffers.

Parameters
[in]snpeHandleHandle to access the SNPE object
[in]ionBufferMapHandleA UserMemoryMap of virtual addresses
Returns
SNPE_SUCCESS upon successful ION Buffer registration

◆ Snpe_SNPEBuilder_Build()

SNPE_API Snpe_SNPE_Handle_t Snpe_SNPEBuilder_Build ( Snpe_SNPEBuilder_Handle_t  snpeBuilderHandle)

Returns an instance of SNPE based on the current parameters.

Parameters
[in]snpeBuilderHandleHandle to access the SNPEBuilder object
Returns
A new instance of a SNPE object that can be used to execute models or null if any errors occur.

◆ Snpe_SNPEBuilder_Create()

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.

Parameters
[in]containerHandleA DlContainer holding the model.
Returns
A new instance of a SNPEBuilder object that can be used to configure and build an instance of SNPE.

◆ Snpe_SNPEBuilder_Delete()

SNPE_API Snpe_ErrorCode_t Snpe_SNPEBuilder_Delete ( Snpe_SNPEBuilder_Handle_t  snpeBuilderHandle)

Destroys/frees a SNPEBuilder object

Parameters
[in]snpeBuilderHandleHandle to access the SNPEBuilder object
Returns
SNPE_SUCCESS if Delete operation successful.

◆ Snpe_SNPEBuilder_SetBufferDataType()

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.

Parameters
[in]snpeBuilderHandleHandle to access the SNPEBuilder object
[in]dataTypeMapHandleMap of the buffer names and the datatype that needs to be set.

◆ Snpe_SNPEBuilder_SetCpuFixedPointMode()

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.

Parameters
[in]snpeBuilderHandleHandle to access the SNPEBuilder object
[in]cpuFxpModeBoolean If set to true, enables the fixed point mode.

◆ Snpe_SNPEBuilder_SetDebugMode()

SNPE_API Snpe_ErrorCode_t Snpe_SNPEBuilder_SetDebugMode ( Snpe_SNPEBuilder_Handle_t  snpeBuilderHandle,
int  debugMode 
)

Sets the debug mode of the runtime.

Parameters
[in]snpeBuilderHandleHandle to access the SNPEBuilder object
[in]debugModeThis 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_SNPEBuilder_SetExecutionPriorityHint()

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.

Parameters
[in]snpeBuilderHandleHandle to access the SNPEBuilder object
[in]priorityThe target performance profile.

◆ Snpe_SNPEBuilder_SetInitCacheMode()

SNPE_API Snpe_ErrorCode_t Snpe_SNPEBuilder_SetInitCacheMode ( Snpe_SNPEBuilder_Handle_t  snpeBuilderHandle,
int  cacheMode 
)

Sets the mode of init caching functionality.

Parameters
[in]snpeBuilderHandleHandle to access the SNPEBuilder object
[in]modeBoolean. 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_SNPEBuilder_SetInputDimensions()

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.

Parameters
[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_SNPEBuilder_SetOutputLayers()

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.

Parameters
[in]snpeBuilderHandleHandle to access the SNPEBuilder object
[in]outputLayerNamesList 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_SNPEBuilder_SetOutputTensors()

SNPE_API Snpe_ErrorCode_t Snpe_SNPEBuilder_SetOutputTensors ( Snpe_SNPEBuilder_Handle_t  snpeBuilderHandle,
Snpe_StringList_Handle_t  outputTensorNames 
)

Sets the output tensor names.

Parameters
[in]snpeBuilderHandleHandle to access the SNPEBuilder object
[in]outputTensorNamesList 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_SNPEBuilder_SetPerformanceProfile()

SNPE_API Snpe_ErrorCode_t Snpe_SNPEBuilder_SetPerformanceProfile ( Snpe_SNPEBuilder_Handle_t  snpeBuilderHandle,
Snpe_PerformanceProfile_t  performanceProfile 
)

Requests a performance profile.

Parameters
[in]snpeBuilderHandleHandle to access the SNPEBuilder object
[in]performanceProfileThe target performance profile.

◆ Snpe_SNPEBuilder_SetPlatformConfig()

SNPE_API Snpe_ErrorCode_t Snpe_SNPEBuilder_SetPlatformConfig ( Snpe_SNPEBuilder_Handle_t  snpeBuilderHandle,
Snpe_PlatformConfig_Handle_t  platformConfigHandle 
)

Sets the platform configuration.

Parameters
[in]snpeBuilderHandleHandle to access the SNPEBuilder object
[in]platformConfigThe platform configuration.

◆ Snpe_SNPEBuilder_SetProfilingLevel()

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.

Parameters
[in]snpeBuilderHandleHandle to access the SNPEBuilder object
[in]profilingLevelThe target profiling level.

◆ Snpe_SNPEBuilder_SetRuntimeProcessorOrder()

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.

Parameters
[in]snpeBuilderHandleHandle to access the SNPEBuilder object
[in]runtimeListHandleThe list of runtime in order of precedence

◆ Snpe_SNPEBuilder_SetSingleThreadedInit()

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.

Returns
The current instance of SNPEBuilder.

◆ Snpe_SNPEBuilder_SetTimeOut()

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.

Parameters
[in]snpeBuilderHandleHandle to access the SNPEBuilder object
[in]timeoutTime limit value

◆ Snpe_SNPEBuilder_SetUnconsumedTensorsAsOutputs()

SNPE_API Snpe_ErrorCode_t Snpe_SNPEBuilder_SetUnconsumedTensorsAsOutputs ( Snpe_SNPEBuilder_Handle_t  snpeBuilderHandle,
int  setOutput 
)

Sets the unconsumed tensors as output.

Parameters
[in]snpeBuilderHandleHandle to access the SNPEBuilder object
[in]setOutputBoolean. This enables unconsumed tensors (i.e) outputs which are not inputs to any layer (basically dead ends) to be marked for output

◆ Snpe_SNPEBuilder_SetUseUserSuppliedBuffers()

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.

Parameters
[in]snpeBuilderHandleHandle to access the SNPEBuilder object
[in]bufferModeBoolean whether to use user-supplied buffer or not.

◆ Snpe_StringList_Append()

SNPE_API Snpe_ErrorCode_t Snpe_StringList_Append ( Snpe_StringList_Handle_t  stringListHandle,
const char *  string 
)

Append a string to the list.

Parameters
[in]stringListHandle: Handle to access the stringList
[in]strNull-terminated ASCII string to append to the list.
Returns
SNPE_SUCCESS if Append operation successful.

◆ Snpe_StringList_Assign()

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

Parameters
srcSource StringList handle
dstDestination StringList handle
Returns
SNPE_SUCCESS on successful copy-assignment

◆ Snpe_StringList_At()

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.

Parameters
[in]stringListHandle: Handle to access the stringList
[in]idxPosition in the list of the desired string
Returns
the string at the indicated position

◆ Snpe_StringList_Begin()

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.

Parameters
[in]stringListHandle: Handle to access the stringList
Returns
Pointer to the first string in the list.

◆ Snpe_StringList_Create()

SNPE_API Snpe_StringList_Handle_t Snpe_StringList_Create ( )

Constructs a StringList and returns a handle to it

Returns
the handle to the created StringList

◆ Snpe_StringList_CreateCopy()

SNPE_API Snpe_StringList_Handle_t Snpe_StringList_CreateCopy ( Snpe_StringList_Handle_t  other)

Constructs a StringList and returns a handle to it

Parameters
[in]other: StringList handle to be copied from
Returns
the handle to the created StringList

◆ Snpe_StringList_CreateSize()

SNPE_API Snpe_StringList_Handle_t Snpe_StringList_CreateSize ( size_t  size)

Constructs a StringList and returns a handle to it

Parameters
[in]size: size of list
Returns
the handle to the created StringList

◆ Snpe_StringList_Delete()

SNPE_API Snpe_ErrorCode_t Snpe_StringList_Delete ( Snpe_StringList_Handle_t  stringListHandle)

Destroys/frees a StringList

Parameters
[in]stringListHandle: Handle to access the stringList
Returns
SNPE_SUCCESS if Delete operation successful.

◆ Snpe_StringList_End()

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.

Parameters
[in]stringListHandle: Handle to access the stringList
Returns
Pointer to one after the last string in the list

◆ Snpe_StringList_Size()

SNPE_API size_t Snpe_StringList_Size ( Snpe_StringList_Handle_t  stringListHandle)

Return the number of valid string pointers held by this list.

Parameters
[in]stringListHandle: Handle to access the stringList
Returns
The size of the StringList

◆ Snpe_TensorMap_Add()

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.

Parameters
[in]handle: Handle to tensorMap
[in]name: The name of the tensor
[in]tensorHandle: Handle to access ITensor
Note
If a tensor with the same name already exists, the tensor is replaced with the existing tensor.

◆ Snpe_TensorMap_Clear()

SNPE_API void Snpe_TensorMap_Clear ( Snpe_TensorMap_Handle_t  handle)

Parameters
[in]handle: Handle to tensorMap Removes all tensors from the map

◆ Snpe_TensorMap_Create()

SNPE_API Snpe_TensorMap_Handle_t Snpe_TensorMap_Create ( )

Constructs a TensorMap and returns a handle to it

Returns
the handle to the created TensorMap

◆ Snpe_TensorMap_Delete()

SNPE_API Snpe_ErrorCode_t Snpe_TensorMap_Delete ( Snpe_TensorMap_Handle_t  handle)

Destroys/frees Tensor Map

Parameters
[in]handle: handle to tensorMap
Returns
SNPE_SUCCESS if Delete operation successful.

◆ Snpe_TensorMap_GetTensor_Ref()

SNPE_API Snpe_ITensor_Handle_t Snpe_TensorMap_GetTensor_Ref ( Snpe_TensorMap_Handle_t  handle,
const char *  name 
)

Returns the tensor given its name.

Parameters
[in]handle: Handle to tensorMap
[in]name: The name of the tensor to get.
Returns
nullptr if no tensor with the specified name is found; otherwise, a valid pointer to the tensor.

◆ Snpe_TensorMap_GetTensorNames()

SNPE_API Snpe_StringList_Handle_t Snpe_TensorMap_GetTensorNames ( Snpe_TensorMap_Handle_t  handle)

Parameters
[in]handle: Handle to tensorMap
Returns
A StringList of the names of all tensors

◆ Snpe_TensorMap_Remove()

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.

Parameters
[in]handle: Handle to tensorMap
[in]name: The name of tensor to be removed
Note
If no tensor with the specified name is found, nothing is done.

◆ Snpe_TensorMap_Size()

SNPE_API size_t Snpe_TensorMap_Size ( Snpe_TensorMap_Handle_t  handle)

Returns the number of tensors in the map.

Parameters
[in]handle: Handle to tensorMap
Returns
Number of tensors in the map

◆ Snpe_TensorShape_Assign()

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

Parameters
srcHandleSource TensorShape handle
dstHandleDestination TensorShape handle
Returns
SNPE_SUCCESS on successful copy-assignment

◆ Snpe_TensorShape_At()

SNPE_API size_t Snpe_TensorShape_At ( Snpe_TensorShape_Handle_t  tensorShapeHandle,
size_t  index 
)

Parameters
[in]handle: handle to tensorShape
[in]index: Position in the dimension array.
Returns
The dimension value in tensor shape

◆ Snpe_TensorShape_Concatenate()

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.

Parameters
[in]handle: handle to tensorShape
[in]dimsThe 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]sizeSize of the array.

◆ Snpe_TensorShape_Create()

SNPE_API Snpe_TensorShape_Handle_t Snpe_TensorShape_Create ( )

Constructs a TensorShape and returns a handle to it

Returns
the handle to the created TensorShape

◆ Snpe_TensorShape_CreateCopy()

SNPE_API Snpe_TensorShape_Handle_t Snpe_TensorShape_CreateCopy ( Snpe_TensorShape_Handle_t  other)

copy constructor.

Parameters
[in]otherobject to copy.
Returns
the handle to the created TensorShape.

◆ Snpe_TensorShape_CreateDimsSize()

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

Parameters
[in]dimsThe 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]sizeSize of the array.
Returns
the handle to the created TensorShape

◆ Snpe_TensorShape_Delete()

SNPE_API Snpe_ErrorCode_t Snpe_TensorShape_Delete ( Snpe_TensorShape_Handle_t  tensorShapeHandle)

Destroys/frees Tensor Shape

Parameters
[in]handle: handle to tensorShape
Returns
SNPE_SUCCESS if Delete operation successful.

◆ Snpe_TensorShape_GetDimensions()

SNPE_API const size_t* Snpe_TensorShape_GetDimensions ( Snpe_TensorShape_Handle_t  tensorShape)

Retrieves a pointer to the first dimension of shape

Parameters
[in]handle: handle to tensorShape
Returns
nullptr if no dimension exists; otherwise, points to the first dimension.

◆ Snpe_TensorShape_Rank()

SNPE_API size_t Snpe_TensorShape_Rank ( Snpe_TensorShape_Handle_t  tensorShape)

Parameters
[in]handle: handle to tensorShape

Retrieves the rank i.e. number of dimensions.

Returns
The rank

◆ Snpe_TensorShapeMap_Add()

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.

Parameters
[in]tsmhandle: handle to access Tensor Shape Map
[in]nameThe name of the tensor
[in]tsHandle: Handle to access Tensor Shape
Returns
Returns SNPE_SUCCESS if Add operation successful
Note
If a tensor with the same name already exists, no new tensor is added.

◆ Snpe_TensorShapeMap_Assign()

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

Parameters
[in]srcHandle: handle to source Tensor Shape Map object
[out]dstHandle: handle to destination Tensor Shape Map object
Returns
Returns SNPE_SUCCESS if Assignment successful

◆ Snpe_TensorShapeMap_Clear()

SNPE_API Snpe_ErrorCode_t Snpe_TensorShapeMap_Clear ( Snpe_TensorShapeMap_Handle_t  tsmHandle)

Removes all tensors from the map

Parameters
[in]tsmhandle: handle to access Tensor Shape Map
Returns
Returns SNPE_SUCCESS if Clear operation successful

◆ Snpe_TensorShapeMap_Create()

SNPE_API Snpe_TensorShapeMap_Handle_t Snpe_TensorShapeMap_Create ( )

Constructs a TensorShapeMap and returns a handle to it

Returns
the handle to the created TensorShapeMap

◆ Snpe_TensorShapeMap_CreateCopy()

SNPE_API Snpe_TensorShapeMap_Handle_t Snpe_TensorShapeMap_CreateCopy ( Snpe_TensorShapeMap_Handle_t  tsmHandle)

copy constructor.

Parameters
[in]tsmHandle: Handle to the other object to copy.
Returns
the handle to the created TensorShapeMap

◆ Snpe_TensorShapeMap_Delete()

SNPE_API Snpe_ErrorCode_t Snpe_TensorShapeMap_Delete ( Snpe_TensorShapeMap_Handle_t  tsmHandle)

Destroys/frees Tensor Shape Map

Parameters
[in]tsmhandle: handle to access Tensor Shape Map
Returns
SNPE_SUCCESS if Delete operation successful.

◆ Snpe_TensorShapeMap_GetTensorShape()

SNPE_API Snpe_TensorShape_Handle_t Snpe_TensorShapeMap_GetTensorShape ( Snpe_TensorShapeMap_Handle_t  tsmHandle,
const char *  name 
)

Returns the tensor given its name.

Parameters
[in]tsmhandle: handle to access Tensor Shape Map
[in]nameThe name of the tensor to get.
Returns
nullptr if no tensor with the specified name is found; otherwise, a valid Tensor Shape Handle.

◆ Snpe_TensorShapeMap_GetTensorShapeNames()

SNPE_API Snpe_StringList_Handle_t Snpe_TensorShapeMap_GetTensorShapeNames ( Snpe_TensorShapeMap_Handle_t  tsmHandle)

Parameters
[in]tsmHandle: handle to access Tensor Shape Map
Returns
A stringList Handle to access names of all tensor shapes

◆ Snpe_TensorShapeMap_Remove()

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.

Parameters
[in]tsmhandle: handle to access Tensor Shape Map
[in]nameThe name of tensor to be removed
Returns
Returns SNPE_SUCCESS if Remove operation successful
Note
If no tensor with the specified name is found, nothing is done.

◆ Snpe_TensorShapeMap_Size()

SNPE_API size_t Snpe_TensorShapeMap_Size ( Snpe_TensorShapeMap_Handle_t  tsmHandle)

Returns the number of tensors in the map.

Parameters
[in]tsmhandle: handle to access Tensor Shape Map
Returns
Returns number entries in TensorShapeMap

◆ Snpe_UserBufferEncoding_GetElementType()

SNPE_API Snpe_UserBufferEncoding_ElementType_t Snpe_UserBufferEncoding_GetElementType ( Snpe_UserBufferEncoding_Handle_t  userBufferHandle)

Retrieves the element type.

Parameters
[in]userBufferHandle: Handle to access userBufferEncoding
Returns
Element type

◆ Snpe_UserBufferEncodingFloat_Create()

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_UserBufferEncodingFloat_Delete()

SNPE_API Snpe_ErrorCode_t Snpe_UserBufferEncodingFloat_Delete ( Snpe_UserBufferEncoding_Handle_t  userBufferHandle)

Destroys the encodingFloat.

Parameters
[in]userBufferHandle: Handle to access the encoding
Returns
Error code. Returns SNPE_SUCCESS if destruction successful

◆ Snpe_UserBufferEncodingFloat_GetElementSize()

SNPE_API size_t Snpe_UserBufferEncodingFloat_GetElementSize ( Snpe_UserBufferEncoding_Handle_t  userBufferHandle)

Retrieves the size of the element, in bytes.

Parameters
[in]userBufferHandle: Handle to access the encoding
Returns
Size of the element, in bytes.

◆ Snpe_UserBufferEncodingFloatN_Create()

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_UserBufferEncodingFloatN_Delete()

SNPE_API Snpe_ErrorCode_t Snpe_UserBufferEncodingFloatN_Delete ( Snpe_UserBufferEncoding_Handle_t  userBufferHandle)

Destroys the encodingFloatN.

Parameters
[in]userBufferHandle: Handle to access the encoding
Returns
Error code. Returns SNPE_SUCCESS if destruction successful

◆ Snpe_UserBufferEncodingFloatN_GetElementSize()

SNPE_API size_t Snpe_UserBufferEncodingFloatN_GetElementSize ( Snpe_UserBufferEncoding_Handle_t  userBufferHandle)

Retrieves the size of the element, in bytes.

Parameters
[in]userBufferHandle: Handle to access the encoding
Returns
Size of the element, in bytes.

◆ Snpe_UserBufferEncodingIntN_Create()

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_UserBufferEncodingIntN_Delete()

SNPE_API Snpe_ErrorCode_t Snpe_UserBufferEncodingIntN_Delete ( Snpe_UserBufferEncoding_Handle_t  userBufferHandle)

Destroys the encodingIntN.

Parameters
[in]userBufferHandle: Handle to access the encoding
Returns
Error code. Returns SNPE_SUCCESS if destruction successful

◆ Snpe_UserBufferEncodingIntN_GetElementSize()

SNPE_API size_t Snpe_UserBufferEncodingIntN_GetElementSize ( Snpe_UserBufferEncoding_Handle_t  userBufferHandle)

Retrieves the size of the element, in bytes.

Parameters
[in]userBufferHandle: Handle to access the encoding
Returns
Size of the element, in bytes.

◆ Snpe_UserBufferEncodingTfN_Create()

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_UserBufferEncodingTfN_Delete()

SNPE_API Snpe_ErrorCode_t Snpe_UserBufferEncodingTfN_Delete ( Snpe_UserBufferEncoding_Handle_t  userBufferHandle)

Destroys the encodingTfN.

Parameters
[in]userBufferHandle: Handle to access the encoding
Returns
Error code. Returns SNPE_SUCCESS if destruction successful

◆ Snpe_UserBufferEncodingTfN_GetElementSize()

SNPE_API size_t Snpe_UserBufferEncodingTfN_GetElementSize ( Snpe_UserBufferEncoding_Handle_t  userBufferHandle)

Retrieves the size of the element, in bytes.

Parameters
[in]userBufferHandle: Handle to access the encoding
Returns
Size of the element, in bytes.

◆ Snpe_UserBufferEncodingTfN_GetMax()

SNPE_API float Snpe_UserBufferEncodingTfN_GetMax ( Snpe_UserBufferEncoding_Handle_t  userBufferHandle)

Calculates the maximum floating point value that can be represented with this encoding.

Parameters
[in]userBufferHandle: Handle to access the encoding
Returns
Maximum representable floating point value

◆ Snpe_UserBufferEncodingTfN_GetMin()

SNPE_API float Snpe_UserBufferEncodingTfN_GetMin ( Snpe_UserBufferEncoding_Handle_t  userBufferHandle)

Calculates the minimum floating point value that can be represented with this encoding.

Parameters
[in]userBufferHandle: Handle to access the encoding
Returns
Minimum representable floating point value

◆ Snpe_UserBufferEncodingTfN_GetQuantizedStepSize()

SNPE_API float Snpe_UserBufferEncodingTfN_GetQuantizedStepSize ( Snpe_UserBufferEncoding_Handle_t  userBufferHandle)

Retrieves the step size.

Parameters
[in]userBufferHandle: Handle to access the encoding
Returns
Step size

◆ Snpe_UserBufferEncodingTfN_GetStepExactly0()

SNPE_API uint64_t Snpe_UserBufferEncodingTfN_GetStepExactly0 ( Snpe_UserBufferEncoding_Handle_t  userBufferHandle)

Retrieves the step that represents 0.0.

Parameters
[in]userBufferHandle: Handle to access the encoding
Returns
Step value

◆ Snpe_UserBufferEncodingTfN_SetQuantizedStepSize()

SNPE_API void Snpe_UserBufferEncodingTfN_SetQuantizedStepSize ( Snpe_UserBufferEncoding_Handle_t  userBufferHandle,
float  quantizedStepSize 
)

Sets the float value that each step represents.

Parameters
[in]userBufferHandle: Handle to access the encoding
[in]quantizedStepSize: The float value of each step size

◆ Snpe_UserBufferEncodingTfN_SetStepExactly0()

SNPE_API void Snpe_UserBufferEncodingTfN_SetStepExactly0 ( Snpe_UserBufferEncoding_Handle_t  userBufferHandle,
uint64_t  stepExactly0 
)

Sets the step value that represents 0.

Parameters
[in]userBufferHandle: Handle to access the encoding
[in]stepExactly0: The step value that represents 0

◆ Snpe_UserBufferEncodingUintN_Create()

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_UserBufferEncodingUintN_Delete()

SNPE_API Snpe_ErrorCode_t Snpe_UserBufferEncodingUintN_Delete ( Snpe_UserBufferEncoding_Handle_t  userBufferHandle)

Destroys the encodingUintN.

Parameters
[in]userBufferHandle: Handle to access the encoding
Returns
Error code. Returns SNPE_SUCCESS if destruction successful

◆ Snpe_UserBufferEncodingUintN_GetElementSize()

SNPE_API size_t Snpe_UserBufferEncodingUintN_GetElementSize ( Snpe_UserBufferEncoding_Handle_t  userBufferHandle)

Retrieves the size of the element, in bytes.

Parameters
[in]userBufferHandle: Handle to access the encoding
Returns
Size of the element, in bytes.

◆ Snpe_UserBufferEncodingUnsigned8Bit_Create()

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_UserBufferEncodingUnsigned8Bit_Delete()

SNPE_API Snpe_ErrorCode_t Snpe_UserBufferEncodingUnsigned8Bit_Delete ( Snpe_UserBufferEncoding_Handle_t  userBufferHandle)

Destroys the encodingUnsigned8Bit.

Parameters
[in]userBufferHandle: Handle to access the encodingUnsigned8Bit
Returns
Error code. Returns SNPE_SUCCESS if destruction successful

◆ Snpe_UserBufferEncodingUnsigned8Bit_GetElementSize()

SNPE_API size_t Snpe_UserBufferEncodingUnsigned8Bit_GetElementSize ( Snpe_UserBufferEncoding_Handle_t  userBufferHandle)

Retrieves the size of the element, in bytes.

Parameters
[in]userBufferHandle: Handle to access the encoding
Returns
Size of the element, in bytes.

◆ Snpe_UserBufferMap_Add()

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.

Parameters
[in]handle: Handle to access UserBufferMap
[in]name: The name of the UserBuffer
[in]bufferHandle: Handle to access UserBuffer
Note
If a UserBuffer with the same name already exists, the new UserBuffer pointer would be updated.

◆ Snpe_UserBufferMap_Assign()

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

Parameters
srcSource UserBufferMap handle
dstDestination UserBufferMap handle
Returns
SNPE_SUCCESS on successful copy-assignment

◆ Snpe_UserBufferMap_Clear()

SNPE_API Snpe_ErrorCode_t Snpe_UserBufferMap_Clear ( Snpe_UserBufferMap_Handle_t  handle)

Parameters
[in]handle: Handle to access UserBufferMap Removes all UserBuffers from the map

◆ Snpe_UserBufferMap_Create()

SNPE_API Snpe_UserBufferMap_Handle_t Snpe_UserBufferMap_Create ( )

Creates a new empty UserBuffer map

◆ Snpe_UserBufferMap_CreateCopy()

SNPE_API Snpe_UserBufferMap_Handle_t Snpe_UserBufferMap_CreateCopy ( Snpe_UserBufferMap_Handle_t  other)

copy constructor.

Parameters
[in]other: Handle to the other userBufferMap to be copied from.

◆ Snpe_UserBufferMap_Delete()

SNPE_API Snpe_ErrorCode_t Snpe_UserBufferMap_Delete ( Snpe_UserBufferMap_Handle_t  handle)

Destroys/frees UserBuffer Map

Parameters
[in]handle: Handle to access UserBuffer Map
Returns
SNPE_SUCCESS if Delete operation successful.

◆ Snpe_UserBufferMap_GetUserBuffer_Ref()

SNPE_API Snpe_IUserBuffer_Handle_t Snpe_UserBufferMap_GetUserBuffer_Ref ( Snpe_UserBufferMap_Handle_t  handle,
const char *  name 
)

Returns the UserBuffer given its name.

Parameters
[in]handle: Handle to access UserBufferMap
[in]name: The name of the UserBuffer to get.
Returns
nullptr if no UserBuffer with the specified name is found; otherwise, a valid pointer to the UserBuffer.

◆ Snpe_UserBufferMap_GetUserBufferNames()

SNPE_API Snpe_StringList_Handle_t Snpe_UserBufferMap_GetUserBufferNames ( Snpe_UserBufferMap_Handle_t  handle)

Returns the names of all UserBuffers

Parameters
[in]handle: Handle to access UserBufferMap
Returns
A list of UserBuffer names.

◆ Snpe_UserBufferMap_Remove()

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.

Parameters
[in]handle: Handle to access UserBufferMap
[in]name: The name of UserBuffer to be removed
Note
If no UserBuffer with the specified name is found, nothing is done.

◆ Snpe_UserBufferMap_Size()

SNPE_API size_t Snpe_UserBufferMap_Size ( Snpe_UserBufferMap_Handle_t  handle)

Returns the number of UserBuffers in the map.

Parameters
[in]handle: Handle to access UserBufferMap

◆ Snpe_UserBufferSource_GetSourceType()

SNPE_API Snpe_UserBufferSource_SourceType_t Snpe_UserBufferSource_GetSourceType ( Snpe_UserBufferSource_Handle_t  userBufferHandle)

Retrieves the source type.

Parameters
[in]userBufferHandle: Handle to access userBufferSource
Returns
Source type

◆ Snpe_UserBufferSourceGLBuffer_Create()

SNPE_API Snpe_UserBufferSource_Handle_t Snpe_UserBufferSourceGLBuffer_Create ( )

An source type where input data is delivered from OpenGL buffer

◆ Snpe_UserBufferSourceGLBuffer_Delete()

SNPE_API Snpe_ErrorCode_t Snpe_UserBufferSourceGLBuffer_Delete ( Snpe_UserBufferSource_Handle_t  userBufferHandle)

Destroys the userBuffer.

Parameters
[in]userBufferHandle: Handle to access the UserBuffer
Returns
Error code. Returns SNPE_SUCCESS if destruction successful

◆ Snpe_UserGLConfig_Create()

SNPE_API Snpe_UserGLConfig_Handle_t Snpe_UserGLConfig_Create ( )

Creates a new userGLConfig

◆ Snpe_UserGLConfig_Delete()

SNPE_API Snpe_ErrorCode_t Snpe_UserGLConfig_Delete ( Snpe_UserGLConfig_Handle_t  handle)

Destroys the userGLConfig.

Parameters
[in]handle: Handle to access the userGLConfig
Returns
Error code. Returns SNPE_SUCCESS if destruction successful

◆ Snpe_UserGLConfig_GetUserGLContext()

SNPE_API void* Snpe_UserGLConfig_GetUserGLContext ( Snpe_UserGLConfig_Handle_t  handle)

Get EGL context.

Parameters
[in]handle: Handle to access userGLConfig
Returns
userGLContext of type void pointer

◆ Snpe_UserGLConfig_GetUserGLDisplay()

SNPE_API void* Snpe_UserGLConfig_GetUserGLDisplay ( Snpe_UserGLConfig_Handle_t  handle)

Get EGL Display.

Parameters
[in]handle: Handle to access userGLConfig
Returns
userGLDisplay of type void pointer

◆ Snpe_UserGLConfig_SetUserGLContext()

SNPE_API void Snpe_UserGLConfig_SetUserGLContext ( Snpe_UserGLConfig_Handle_t  handle,
void *  userGLContext 
)

Sets the EGL context.

Parameters
[in]handle: Handle to access userGLConfig
[in]userGLContext: void pointer

◆ Snpe_UserGLConfig_SetUserGLDisplay()

SNPE_API void Snpe_UserGLConfig_SetUserGLDisplay ( Snpe_UserGLConfig_Handle_t  handle,
void *  userGLDisplay 
)

Sets the EGL Display.

Parameters
[in]handle: Handle to access userGLConfig
[in]userGLDisplay: void pointer

◆ Snpe_UserGpuConfig_Create()

SNPE_API Snpe_UserGpuConfig_Handle_t Snpe_UserGpuConfig_Create ( )

Creates a new userGpuConfig

◆ Snpe_UserGpuConfig_Delete()

SNPE_API Snpe_ErrorCode_t Snpe_UserGpuConfig_Delete ( Snpe_UserGpuConfig_Handle_t  handle)

Destroys the userGpuConfig.

Parameters
[in]handle: Handle to access userGLConfig
Returns
Error code. Returns SNPE_SUCCESS if destruction successful

◆ Snpe_UserGpuConfig_Get_Ref()

SNPE_API Snpe_UserGLConfig_Handle_t Snpe_UserGpuConfig_Get_Ref ( Snpe_UserGpuConfig_Handle_t  handle)

Get the userGpuConfig.

Parameters
[in]handle: Handle to access userGpuConfig
Returns
Handle needed to access userGlConfig

◆ Snpe_UserGpuConfig_Set()

SNPE_API void Snpe_UserGpuConfig_Set ( Snpe_UserGpuConfig_Handle_t  handle,
Snpe_UserGLConfig_Handle_t  glHandle 
)

Set the userGpuConfig.

Parameters
[in]handle: Handle to access userGpuConfig
[in]glHandle: Handle needed to access userGlConfig
Returns
Error code. Returns SNPE_SUCCESS if destruction successful

◆ Snpe_UserMemoryMap_Add()

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.

Parameters
[in]handle: Handle to access UserMemory Map
[in]name: The name of the UserMemory
[in]address: The pointer to the Buffer Memory
Note
If a UserBuffer with the same name already exists, the new address would be updated.

◆ Snpe_UserMemoryMap_Clear()

SNPE_API Snpe_ErrorCode_t Snpe_UserMemoryMap_Clear ( Snpe_UserMemoryMap_Handle_t  handle)

Removes all User Memory from the map

Parameters
[in]handle: Handle to access UserMemory Map

◆ Snpe_UserMemoryMap_Copy()

SNPE_API Snpe_UserMemoryMap_Handle_t Snpe_UserMemoryMap_Copy ( Snpe_UserMemoryMap_Handle_t  other)

copy constructor.

Parameters
[in]other: Handle to the other object to copy.

◆ Snpe_UserMemoryMap_Create()

SNPE_API Snpe_UserMemoryMap_Handle_t Snpe_UserMemoryMap_Create ( )

Creates a new empty UserMemory map

◆ Snpe_UserMemoryMap_Delete()

SNPE_API Snpe_ErrorCode_t Snpe_UserMemoryMap_Delete ( Snpe_UserMemoryMap_Handle_t  handle)

Destroys/frees UserMemory Map

Parameters
[in]handle: Handle to access UserMemory Map
Returns
SNPE_SUCCESS if Delete operation successful.

◆ Snpe_UserMemoryMap_GetUserBufferNames()

SNPE_API Snpe_StringList_Handle_t Snpe_UserMemoryMap_GetUserBufferNames ( Snpe_UserMemoryMap_Handle_t  handle)

Returns the names of all User Memory

Parameters
[in]handle: Handle to access UserMemory Map
Returns
Returns a handle to the stringList.

◆ Snpe_UserMemoryMap_GetUserMemoryAddressAtIndex()

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.

Parameters
[in]handle: Handle to access UserMemory Map
[in]name: The name of the buffer
[in]index: The index in the list of addresses

◆ Snpe_UserMemoryMap_GetUserMemoryAddressCount()

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.

Parameters
[in]handle: Handle to access UserMemory Map
[in]name: The name of the UserMemory

◆ Snpe_UserMemoryMap_Remove()

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.

Parameters
[in]handle: Handle to access UserMemory Map
[in]name: The name of Memory address to be removed
Note
If no UserBuffer with the specified name is found, nothing is done.

◆ Snpe_UserMemoryMap_Size()

SNPE_API size_t Snpe_UserMemoryMap_Size ( Snpe_UserMemoryMap_Handle_t  handle)

Returns the number of User Memory addresses in the map.

Parameters
[in]handle: Handle to access UserMemory Map

◆ Snpe_Util_AddOpPackage()

SNPE_API int Snpe_Util_AddOpPackage ( const char *  regLibraryPath)

Register a user-defined op package with SNPE.

Parameters
[in]regLibraryPathPath 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
Returns
Boolean: Non-zero if successful, 0 otherwise.

◆ Snpe_Util_CreateITensor()

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).

Parameters
[in]shapeHandleThe 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.
Returns
The created tensor

◆ Snpe_Util_CreateITensor_NV21()

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

Parameters
[in]shapeHandleThe 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]dataThe actual data with which the Tensor object is filled.
[in]dataSizeThe size of data
Returns
the created tensor

◆ Snpe_Util_CreateUserBuffer()

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.

Parameters
[in]bufferPointer to the buffer that the caller supplies
[in]bufSizeBuffer size, in bytes
[in]stridesHandleTotal 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]userBufferEncodingHandleReference to an UserBufferEncoding object
Note
Caller has to ensure that memory pointed to by buffer stays accessible for the lifetime of the object created
Returns
the created UserBuffer

◆ Snpe_Util_CreateUserGlBuffer()

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.

Parameters
[in]bufferPointer to the buffer that the caller supplies
[in]bufSizeBuffer size, in bytes
[in]stridesHandleTotal 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]userBufferEncodingHandleReference to an UserBufferEncoding object
[in]userBufferSourceHandleReference to an UserBufferSource object
Note
Caller has to ensure that memory pointed to by buffer stays accessible for the lifetime of the object created
Returns
the created UserBuffer

◆ Snpe_Util_GetLastError()

SNPE_API const char* Snpe_Util_GetLastError ( )
Returns
A string description of the last error

◆ Snpe_Util_GetLibraryVersion()

SNPE_API Snpe_DlVersion_Handle_t Snpe_Util_GetLibraryVersion ( )

Gets the version of the SNPE library.

Returns
Version of the SNPE library.

◆ Snpe_Util_InitializeLogging()

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()

  • setLogLevel() - optional - can be called anytime between initializeLogging & terminateLogging SNPE instance creation, inference, destroy terminateLogging().

Please note, enabling logging can have performance impact.

Parameters
[in]levelLog level (LOG_INFO, LOG_WARN, etc.).
Returns
Boolean: non-zero if successful, 0 otherwise.

◆ Snpe_Util_InitializeLoggingPath()

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()

  • setLogLevel() - optional - can be called anytime between initializeLogging & terminateLogging SNPE instance creation, inference, destroy terminateLogging()

Please note, enabling logging can have performance impact

Parameters
[in]levelLog level (LOG_INFO, LOG_WARN, etc.).
[in]logPathof directory to store logs. If path is empty, the default path is "./Log". For android, the log path is ignored.
Returns
Boolean: non-zero if successful, 0 otherwise.

◆ Snpe_Util_IsGLCLInteropSupported()

SNPE_API int Snpe_Util_IsGLCLInteropSupported ( )

Indicates whether the OpenGL and OpenCL interoperability is supported on GPU platform.

Returns
Boolean: Non-zero if the OpenGL and OpenCl interop is supported; 0 otherwise

◆ Snpe_Util_IsRuntimeAvailable()

SNPE_API int Snpe_Util_IsRuntimeAvailable ( Snpe_Runtime_t  runtime)

Indicates whether the supplied runtime is available on the current platform.

Parameters
[in]runtimeThe target runtime to check.
Returns
Boolean: Non-zero if the supplied runtime is available; 0 otherwise

◆ Snpe_Util_IsRuntimeAvailableCheckOption()

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.

Parameters
[in]runtimeThe target runtime to check.
[in]runtimeCheckOptionExtent to perform runtime available check.
Returns
Boolean: Non-zero if the supplied runtime is available; 0 otherwise

◆ Snpe_Util_SetLogLevel()

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()

Parameters
[in]levelLog level (LOG_INFO, LOG_WARN, etc.).
Returns
Boolean: non-zero if successful, 0 otherwise.

◆ Snpe_Util_SetSNPEStorageLocation()

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.

Parameters
[in]storagePathAbsolute path to a directory which SNPE may use for caching and other storage purposes.
Returns
Boolean: Non-zero if the supplied path was succesfully set as the SNPE storage location, 0 otherwise.

◆ Snpe_Util_TerminateLogging()

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.

Returns
Boolean: non-zero if successful, 0 otherwise.