Snapdragon Neural Processing Engine SDK
Reference Guide
|
Typedefs | |
using | Dimension = size_t |
typedef SnpeUdo_ErrorType_t(* | SnpeUdo_ExternalNotify_t) (const uint32_t ID) |
typedef struct dspGlobalInfrastructure | SnpeUdo_DspGlobalInfrastructure_t |
typedef struct hexnnv2OpFactoryInfra | SnpeUdo_HexNNv2OpFactoryInfra_t |
typedef void * | SnpeUdo_HexNNv2OpInfra_t |
typedef SnpeUdo_ErrorType_t(* | SnpeUdo_getProgram_t) (void *programCache, const char *programName, cl_program *program) |
typedef SnpeUdo_ErrorType_t(* | SnpeUdo_storeProgram_t) (void *programCache, const char *programName, cl_program program) |
Enumerations | |
enum | Runtime_t { CPU_FLOAT32 = 0, GPU_FLOAT32_16_HYBRID = 1, DSP_FIXED8_TF = 2, GPU_FLOAT16 = 3, AIP_FIXED8_TF = 5 , CPU = CPU_FLOAT32, GPU = GPU_FLOAT32_16_HYBRID, DSP = DSP_FIXED8_TF } |
enum | RuntimeCheckOption_t |
enum | PerformanceProfile_t { DEFAULT = 0 } |
enum | ProfilingLevel_t { OFF = 0, BASIC = 1, DETAILED = 2, MODERATE = 3 } |
enum | ExecutionPriorityHint_t |
enum | SnpeUdo_ErrorType_t |
enum | SnpeUdo_DataType_t |
enum | SnpeUdo_TensorLayout_t |
enum | SnpeUdo_CoreType_t |
enum | SnpeUdo_ParamType_t |
enum | SnpeUdo_QuantizationType_t |
Functions | |
ZDL_EXPORT ErrorCode | getLastErrorCode () |
ZDL_EXPORT const char * | getLastErrorString () |
ZDL_EXPORT const char * | getLastInfoString () |
ZDL_EXPORT uint32_t | enumToUInt32 (zdl::DlSystem::ErrorCode code) |
Optional () | |
template<typename Q = T> | |
Optional (const T &v, typename std::enable_if<!std::is_pointer< Q >::value >::type *=0) | |
operator bool () const noexcept | |
const T & | operator* () |
const T & | operator* () const |
const std::string | toString () const |
const zdl::DlSystem::String | asString () const |
virtual bool | setOptions (const Options &loggingOptions)=0 |
virtual Options | getOptions ()=0 |
virtual bool | setDiagLogMask (const std::string &mask)=0 |
virtual bool | setDiagLogMask (const zdl::DlSystem::String &mask)=0 |
virtual bool | start (void)=0 |
static std::unique_ptr< IDlContainer > | open (const std::string &filename) noexcept |
static std::unique_ptr< IDlContainer > | open (const zdl::DlSystem::String &filename) noexcept |
static std::unique_ptr< IDlContainer > | open (const std::vector< uint8_t > &buffer) noexcept |
static std::unique_ptr< IDlContainer > | open (const uint8_t *buffer, const size_t size) noexcept |
IOBufferDataTypeMap () | |
void | add (const char *name, zdl::DlSystem::IOBufferDataType_t bufferDataType) |
void | remove (const char *name) |
zdl::DlSystem::IOBufferDataType_t | getBufferDataType (const char *name) |
zdl::DlSystem::IOBufferDataType_t | getBufferDataType () |
size_t | size () |
bool | find (const char *name) |
bool | empty () |
virtual iterator | begin ()=0 |
virtual const_iterator | cbegin () const =0 |
virtual iterator | end ()=0 |
virtual const_iterator | cend () const =0 |
virtual TensorShape | getShape () const =0 |
virtual size_t | getSize () const =0 |
virtual void | serialize (std::ostream &output) const =0 |
virtual std::unique_ptr< ITensor > | createTensor (const TensorShape &shape) noexcept=0 |
virtual std::unique_ptr< ITensor > | createTensor (std::istream &input) noexcept=0 |
virtual std::unique_ptr< ITensor > | createTensor (const TensorShape &shape, const unsigned char *data, size_t dataSize) noexcept=0 |
RuntimeList () | |
RuntimeList (const RuntimeList &other) | |
RuntimeList (const zdl::DlSystem::Runtime_t &runtime) | |
RuntimeList & | operator= (const RuntimeList &other) |
Runtime_t & | operator[] (size_t index) |
bool | add (const zdl::DlSystem::Runtime_t &runtime) |
void | remove (const zdl::DlSystem::Runtime_t runtime) noexcept |
void | clear () noexcept |
zdl::DlSystem::StringList | getRuntimeListNames () const |
static zdl::DlSystem::Runtime_t | stringToRuntime (const char *runtimeStr) |
static const char * | runtimeToString (const zdl::DlSystem::Runtime_t runtime) |
StringList (size_t length) | |
void | append (const char *str) |
const char * | at (size_t idx) const noexcept |
const char ** | begin () const noexcept |
const char ** | end () const noexcept |
size_t | size () const noexcept |
StringList & | operator= (const StringList &) noexcept |
StringList (const StringList &other) | |
StringList (StringList &&other) noexcept | |
TensorMap () | |
TensorMap (const TensorMap &other) | |
TensorMap & | operator= (const TensorMap &other) |
void | add (const char *name, zdl::DlSystem::ITensor *tensor) |
void | remove (const char *name) noexcept |
void | clear () noexcept |
zdl::DlSystem::ITensor * | getTensor (const char *name) const noexcept |
zdl::DlSystem::StringList | getTensorNames () const |
TensorShape (std::initializer_list< Dimension > dims) | |
TensorShape (const Dimension *dims, size_t size) | |
TensorShape (std::vector< Dimension > dims) | |
TensorShape (const TensorShape &other) | |
TensorShape & | operator= (const TensorShape &other) |
TensorShape () | |
void | concatenate (std::initializer_list< Dimension > dims) |
void | concatenate (const Dimension *dims, size_t size) |
void | concatenate (const Dimension &dim) |
Dimension & | operator[] (size_t index) |
size_t | rank () const |
const Dimension * | getDimensions () const |
TensorShapeMap () | |
TensorShapeMap (const TensorShapeMap &other) | |
TensorShapeMap & | operator= (const TensorShapeMap &other) |
void | add (const char *name, const zdl::DlSystem::TensorShape &tensorShape) |
void | remove (const char *name) noexcept |
void | clear () noexcept |
zdl::DlSystem::TensorShape | getTensorShape (const char *name) const noexcept |
zdl::DlSystem::StringList | getTensorShapeNames () const |
SnpeUdo_ErrorType_t | SnpeUdo_initImplLibrary (void *globalInfrastructure) |
SnpeUdo_ErrorType_t | SnpeUdo_getImplVersion (SnpeUdo_LibVersion_t **version) |
SnpeUdo_ErrorType_t | SnpeUdo_terminateImplLibrary (void) |
SnpeUdo_ErrorType_t | SnpeUdo_getImpInfo (SnpeUdo_ImpInfo_t **implementationInfo) |
SnpeUdo_ErrorType_t | SnpeUdo_createOpFactory (SnpeUdo_CoreType_t udoCoreType, void *perFactoryInfrastructure, SnpeUdo_String_t operationType, uint32_t numOfStaticParams, SnpeUdo_Param_t *staticParams, SnpeUdo_OpFactory_t *opFactory) |
SnpeUdo_ErrorType_t | SnpeUdo_releaseOpFactory (SnpeUdo_OpFactory_t opFactory) |
SnpeUdo_ErrorType_t | SnpeUdo_createOperation (SnpeUdo_OpFactory_t opFactory, void *perOpInfrastructure, uint32_t numOfInputs, SnpeUdo_TensorParam_t *inputs, uint32_t numOfOutputs, SnpeUdo_TensorParam_t *outputs, SnpeUdo_Operation_t *operation) |
SnpeUdo_ErrorType_t | SnpeUdo_executeOp (SnpeUdo_Operation_t operation, bool blocking, const uint32_t ID, SnpeUdo_ExternalNotify_t notifyFunc) |
SnpeUdo_ErrorType_t | SnpeUdo_setOpIO (SnpeUdo_Operation_t operation, SnpeUdo_TensorParam_t *inputs, SnpeUdo_TensorParam_t *outputs) |
SnpeUdo_ErrorType_t | SnpeUdo_profileOp (SnpeUdo_Operation_t operation, uint32_t *executionTime) |
SnpeUdo_ErrorType_t | SnpeUdo_releaseOp (SnpeUdo_Operation_t operation) |
SnpeUdo_ErrorType_t | SnpeUdo_validateOperation (SnpeUdo_String_t operationType, uint32_t numOfStaticParams, const SnpeUdo_Param_t *staticParams) |
SnpeUdo_ErrorType_t | SnpeUdo_queryOperation (SnpeUdo_String_t operationType, uint32_t numOfStaticParams, const SnpeUdo_Param_t *staticParams, uint32_t *numOfInputs, SnpeUdo_QuantizationType_t **inputsQuantTypes, SnpeUdo_HexNNTensorLayout_t **inputsLayouts, uint32_t *numOfOutputs, SnpeUdo_QuantizationType_t **outputsQuantTypes, SnpeUdo_HexNNTensorLayout_t **outputsLayouts) |
SnpeUdo_ErrorType_t | SnpeUdo_initRegLibrary (void) |
SnpeUdo_ErrorType_t | SnpeUdo_getRegLibraryVersion (SnpeUdo_LibVersion_t **version) |
SnpeUdo_ErrorType_t | SnpeUdo_terminateRegLibrary (void) |
SnpeUdo_ErrorType_t | SnpeUdo_getRegInfo (SnpeUdo_RegInfo_t **registrationInfo) |
SnpeUdo_ErrorType_t | SnpeUdo_validateOperation (SnpeUdo_OpDefinition_t *opDefinition) |
SnpeUdo_ErrorType_t | SnpeUdo_getVersion (SnpeUdo_LibVersion_t **version) |
Variables | |
int32_t | Major |
int32_t | Minor |
int32_t | Teeny |
std::string | Build |
This module defines the SNPE C++ APIs
class zdl::DlSystem::Optional |
Class to manage a value that may or may not exist. The boolean value of the Optional class is true if the object contains a value and false if it does not contain a value.
The class must be evaluated and confirmed as true (containing a value) before being dereferenced.
Public Member Functions | |
Optional () | |
template<typename Q = T> | |
Optional (const T &v, typename std::enable_if<!std::is_pointer< Q >::value >::type *=0) | |
operator bool () const noexcept | |
const T & | operator* () |
const T & | operator* () const |
class zdl::DlSystem::Version_t |
class zdl::DiagLog::IDiagLog |
Interface for controlling logging for zdl components.
Public Member Functions | |
virtual bool | setOptions (const Options &loggingOptions)=0 |
virtual Options | getOptions ()=0 |
virtual bool | setDiagLogMask (const std::string &mask)=0 |
virtual bool | setDiagLogMask (const zdl::DlSystem::String &mask)=0 |
virtual bool | start (void)=0 |
class zdl::DlContainer::IDlContainer |
Represents a container for a neural network model which can be used to load the model into the SNPE runtime.
Public Member Functions | |
virtual bool | save (const std::string &filename)=0 |
virtual bool | save (const zdl::DlSystem::String &filename)=0 |
Static Public Member Functions | |
static std::unique_ptr< IDlContainer > | open (const std::string &filename) noexcept |
static std::unique_ptr< IDlContainer > | open (const zdl::DlSystem::String &filename) noexcept |
static std::unique_ptr< IDlContainer > | open (const std::vector< uint8_t > &buffer) noexcept |
static std::unique_ptr< IDlContainer > | open (const uint8_t *buffer, const size_t size) noexcept |
|
pure virtual |
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.
filename | Container archive file path. |
|
pure virtual |
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.
filename | Container archive file path. |
class zdl::DlSystem::IOBufferDataTypeMap |
The IoBufferDataTypeMap class definition
Public Member Functions | |
IOBufferDataTypeMap () | |
void | add (const char *name, zdl::DlSystem::IOBufferDataType_t bufferDataType) |
void | remove (const char *name) |
zdl::DlSystem::IOBufferDataType_t | getBufferDataType (const char *name) |
zdl::DlSystem::IOBufferDataType_t | getBufferDataType () |
size_t | size () |
bool | find (const char *name) |
bool | empty () |
class zdl::DlSystem::ITensor |
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.
Public Member Functions | |
virtual iterator | begin ()=0 |
virtual const_iterator | cbegin () const =0 |
virtual iterator | end ()=0 |
virtual const_iterator | cend () const =0 |
virtual TensorShape | getShape () const =0 |
virtual size_t | getSize () const =0 |
virtual void | serialize (std::ostream &output) const =0 |
class zdl::DlSystem::ITensorFactory |
Factory interface class to create ITensor objects.
Public Member Functions | |
virtual std::unique_ptr< ITensor > | createTensor (const TensorShape &shape) noexcept=0 |
virtual std::unique_ptr< ITensor > | createTensor (std::istream &input) noexcept=0 |
virtual std::unique_ptr< ITensor > | createTensor (const TensorShape &shape, const unsigned char *data, size_t dataSize) noexcept=0 |
class zdl::DlSystem::UserBufferEncoding |
A base class buffer encoding type
Public Types | |
enum | ElementType_t |
Public Member Functions | |
virtual size_t | getElementSize () const noexcept=0 |
ElementType_t | getElementType () const noexcept |
|
strong |
An enum class of all supported element types in a IUserBuffer
|
pure virtualnoexcept |
Retrieves the size of the element, in bytes.
Implemented in UserBufferEncodingUintN, UserBufferEncodingIntN, UserBufferEncodingTfN, UserBufferEncodingFloatN, and UserBufferEncodingUnsigned8Bit.
|
inlinenoexcept |
Retrieves the element type.
class zdl::DlSystem::UserBufferSource |
A base class buffer source type
Public Member Functions | |
SourceType_t | getSourceType () const noexcept |
|
strong |
|
inlinenoexcept |
Retrieves the source type.
class zdl::DlSystem::UserBufferSourceGLBuffer |
An source type where input data is delivered from OpenGL buffer
Additional Inherited Members | |
Public Member Functions inherited from UserBufferSource | |
SourceType_t | getSourceType () const noexcept |
class zdl::DlSystem::UserBufferEncodingUnsigned8Bit |
An encoding type where each element is represented by an unsigned int
Public Member Functions | |
size_t | getElementSize () const noexcept override |
Public Member Functions inherited from UserBufferEncoding | |
ElementType_t | getElementType () const noexcept |
Additional Inherited Members | |
Public Types inherited from UserBufferEncoding | |
enum | ElementType_t |
|
overridevirtualnoexcept |
Retrieves the size of the element, in bytes.
Implements UserBufferEncoding.
class zdl::DlSystem::UserBufferEncodingFloatN |
An encoding type where each element is represented by a N-bit float
Public Member Functions | |
size_t | getElementSize () const noexcept override |
Public Member Functions inherited from UserBufferEncoding | |
ElementType_t | getElementType () const noexcept |
Additional Inherited Members | |
Public Types inherited from UserBufferEncoding | |
enum | ElementType_t |
|
overridevirtualnoexcept |
Retrieves the size of the element, in bytes.
Implements UserBufferEncoding.
class zdl::DlSystem::UserBufferEncodingFloat |
An encoding type where each element is represented by a 32-bit float
Additional Inherited Members | |
Public Types inherited from UserBufferEncoding | |
enum | ElementType_t |
Public Member Functions inherited from UserBufferEncodingFloatN | |
size_t | getElementSize () const noexcept override |
Public Member Functions inherited from UserBufferEncoding | |
ElementType_t | getElementType () const noexcept |
class zdl::DlSystem::UserBufferEncodingTfN |
An encoding type where each element is represented by tf8, which is an 8-bit quantizd value, which has an exact representation of 0.0
Public Member Functions | |
size_t | getElementSize () const noexcept override |
void | setStepExactly0 (uint64_t stepExactly0) |
void | setQuantizedStepSize (const float quantizedStepSize) |
uint64_t | getStepExactly0 () const |
float | getMin () const |
float | getMax () const |
float | getQuantizedStepSize () const |
Public Member Functions inherited from UserBufferEncoding | |
ElementType_t | getElementType () const noexcept |
Additional Inherited Members | |
Public Types inherited from UserBufferEncoding | |
enum | ElementType_t |
|
overridevirtualnoexcept |
Retrieves the size of the element, in bytes.
Implements UserBufferEncoding.
|
inline |
Calculates the maximum floating point value that can be represented with this encoding.
|
inline |
Calculates the minimum floating point value that can be represented with this encoding.
|
inline |
Retrieves the step size.
|
inline |
Retrieves the step that represents 0.0.
|
inline |
Sets the float value that each step represents.
[in] | quantizedStepSize | The float value of each step size |
|
inline |
Sets the step value that represents 0.
[in] | stepExactly0 | The step value that represents 0 |
class zdl::DlSystem::UserBufferEncodingIntN |
An encoding type where each element is represented by intN, which is an
Public Member Functions | |
size_t | getElementSize () const noexcept override |
Public Member Functions inherited from UserBufferEncoding | |
ElementType_t | getElementType () const noexcept |
Additional Inherited Members | |
Public Types inherited from UserBufferEncoding | |
enum | ElementType_t |
|
overridevirtualnoexcept |
Retrieves the size of the element, in bytes.
Implements UserBufferEncoding.
class zdl::DlSystem::UserBufferEncodingUintN |
An encoding type where each element is represented by UintN, which is an
Public Member Functions | |
size_t | getElementSize () const noexcept override |
Public Member Functions inherited from UserBufferEncoding | |
ElementType_t | getElementType () const noexcept |
Additional Inherited Members | |
Public Types inherited from UserBufferEncoding | |
enum | ElementType_t |
|
overridevirtualnoexcept |
Retrieves the size of the element, in bytes.
Implements UserBufferEncoding.
class zdl::DlSystem::IUserBuffer |
Public Member Functions | |
virtual const TensorShape & | getStrides () const =0 |
virtual size_t | getSize () const =0 |
virtual size_t | getOutputSize () const =0 |
virtual bool | setBufferAddress (void *buffer) noexcept=0 |
virtual const UserBufferEncoding & | getEncoding () const noexcept=0 |
virtual UserBufferEncoding & | getEncoding () noexcept=0 |
|
pure virtualnoexcept |
Gets a const reference to the data encoding object of the underlying buffer.
This is necessary when the UserBuffer is filled by SNPE with data types such as TF8, where the caller needs to know the quantization parameters in order to interpret the data properly
|
pure virtualnoexcept |
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.
|
pure virtual |
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.
|
pure virtual |
Retrieves the size of the buffer, in bytes.
|
pure virtual |
Retrieves the total number of bytes between elements in each dimension if the buffer were to be interpreted as a multi-dimensional array.
|
pure virtualnoexcept |
Changes the underlying memory that backs the UserBuffer.
This can be used to avoid creating multiple UserBuffer objects when the only thing that differs is the memory location.
[in] | buffer | Pointer to the memory location |
class zdl::DlSystem::IUserBufferFactory |
Factory interface class to create IUserBuffer objects.
Public Member Functions | |
virtual std::unique_ptr< IUserBuffer > | createUserBuffer (void *buffer, size_t bufSize, const zdl::DlSystem::TensorShape &strides, zdl::DlSystem::UserBufferEncoding *userBufferEncoding) noexcept=0 |
virtual std::unique_ptr< IUserBuffer > | createUserBuffer (void *buffer, size_t bufSize, const zdl::DlSystem::TensorShape &strides, zdl::DlSystem::UserBufferEncoding *userBufferEncoding, zdl::DlSystem::UserBufferSource *userBufferSource) noexcept=0 |
|
pure virtualnoexcept |
Creates a UserBuffer.
[in] | buffer | Pointer to the buffer that the caller supplies |
[in] | bufSize | Buffer size, in bytes |
[in] | strides | Total number of bytes between elements in each dimension. E.g. A tightly packed tensor of floats with dimensions [4, 3, 2] would have strides of [24, 8, 4]. |
[in] | userBufferEncoding | Reference to an UserBufferEncoding object |
|
pure virtualnoexcept |
Creates a UserBuffer.
[in] | buffer | Pointer to the buffer that the caller supplies |
[in] | bufSize | Buffer size, in bytes |
[in] | strides | Total number of bytes between elements in each dimension. E.g. A tightly packed tensor of floats with dimensions [4, 3, 2] would have strides of [24, 8, 4]. |
[in] | userBufferEncoding | Reference to an UserBufferEncoding object |
[in] | userBufferSource | Reference to an UserBufferSource object |
class zdl::DiagLog::Options |
Options for setting up diagnostic logging for zdl components.
Public Attributes | |
std::string | DiagLogMask |
std::string | LogFileDirectory |
std::string | LogFileName |
uint32_t | LogFileRotateCount |
std::string DiagLogMask |
Enables diag logging only on the specified area mask (DNN_RUNTIME=ON | OFF)
std::string LogFileDirectory |
The path to the directory where log files will be written. The path may be relative or absolute. Relative paths are interpreted from the current working directory. Default value is "diaglogs"
std::string LogFileName |
The name used for log files. If this value is empty then BaseName will be used as the default file name. Default value is "DiagLog"
uint32_t LogFileRotateCount |
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. Default value is 20
struct zdl::DlSystem::UserGLConfig |
A structure OpenGL configuration
Class Members | ||
---|---|---|
void * | userGLContext |
Holds user EGL context. |
void * | userGLDisplay | Holds user EGL display. |
struct zdl::DlSystem::UserGpuConfig |
A structure Gpu configuration
Class Members | ||
---|---|---|
UserGLConfig | userGLConfig |
Holds user OpenGL configuration. |
class zdl::DlSystem::PlatformConfig |
A class user platform configuration
Public Types | |
enum | PlatformType_t |
Public Member Functions | |
PlatformType_t | getPlatformType () const |
bool | isValid () const |
bool | getUserGpuConfig (UserGpuConfig &userGpuConfig) const |
bool | setUserGpuConfig (UserGpuConfig &userGpuConfig) |
bool | setPlatformOptions (std::string options) |
bool | isOptionsValid () const |
std::string | getPlatformOptions () const |
bool | setPlatformOptionValue (const std::string &optionName, const std::string &value) |
bool | removePlatformOptionValue (const std::string &optionName, const std::string &value) |
|
strong |
|
inline |
Gets the platform options.
|
inline |
Retrieves the platform type.
|
inline |
Retrieves the Gpu configuration.
[out] | userGpuConfig | The passed in userGpuConfig populated with the Gpu configuration on return. |
bool isOptionsValid | ( | ) | const |
Indicates whther the plaform configuration is valid.
|
inline |
Indicates whther the plaform configuration is valid.
bool removePlatformOptionValue | ( | const std::string & | optionName, |
const std::string & | value | ||
) |
Removes the platform options.
[in] | optionName | Name of platform options" |
[in] | value | Value of specified optionName |
|
inline |
Sets the platform options.
[in] | options | Options as a string in the form of "keyword:options" |
bool setPlatformOptionValue | ( | const std::string & | optionName, |
const std::string & | value | ||
) |
Sets the platform options.
[in] | optionName | Name of platform options" |
[in] | value | Value of specified optionName |
|
inline |
Sets the Gpu configuration.
[in] | userGpuConfig | Gpu Configuration |
class zdl |
The class for checking SNPE compatibility/capability of a device.
Public Member Functions | |
PlatformValidator () | |
void | setRuntime (zdl::DlSystem::Runtime_t runtime) |
bool | isRuntimeAvailable () |
std::string | getCoreVersion () |
std::string | getLibVersion () |
bool | runtimeCheck () |
std::string getCoreVersion | ( | ) |
Returns the core version for the Runtime selected.
std::string getLibVersion | ( | ) |
Returns the library version for the Runtime selected.
bool isRuntimeAvailable | ( | ) |
Checks if the Runtime prerequisites for SNPE are available.
PlatformValidator | ( | ) |
Default Constructor of the PlatformValidator Class.
bool runtimeCheck | ( | ) |
Runs a small program on the runtime and Checks if SNPE is supported for Runtime.
void setRuntime | ( | zdl::DlSystem::Runtime_t | runtime | ) |
Sets the runtime processor for compatibility check.
class zdl::DlSystem::RuntimeList |
A class representing list of runtimes
Public Member Functions | |
RuntimeList () | |
RuntimeList (const RuntimeList &other) | |
RuntimeList (const zdl::DlSystem::Runtime_t &runtime) | |
RuntimeList & | operator= (const RuntimeList &other) |
Runtime_t & | operator[] (size_t index) |
bool | add (const zdl::DlSystem::Runtime_t &runtime) |
void | remove (const zdl::DlSystem::Runtime_t runtime) noexcept |
void | clear () noexcept |
zdl::DlSystem::StringList | getRuntimeListNames () const |
Static Public Member Functions | |
static zdl::DlSystem::Runtime_t | stringToRuntime (const char *runtimeStr) |
static const char * | runtimeToString (const zdl::DlSystem::Runtime_t runtime) |
class zdl::SNPE::SNPE |
The SNPE interface class definition
|
noexcept |
Deregister Client ION Buffers.
[in] | A | StringList of ION Buffer names |
|
noexcept |
Processes the input data and returns the output.
[in] | A | map of tensors that contains the input data for each input. The names of tensors needs to be matched with names retrieved through getInputTensorNames() |
[in,out] | An | empty map of tensors that will contain the output data of potentially multiple layers (the key in the map is the layer name) upon return |
|
noexcept |
Processes the input data and returns the output.
[in] | A | single tensor contains the input data. |
[in,out] | An | empty map of tensors that will contain the output data of potentially multiple layers (the key in the map is the layer name) upon return |
|
noexcept |
Processes the input data and returns the output, using user-supplied buffers.
[in] | A | map of UserBuffers that contains the input data for each input. The names of UserBuffers needs to be matched with names retrieved through getInputTensorNames() |
[in,out] | A | map of UserBuffers that will hold the output data of potentially multiple layers (the key in the map is the UserBuffer name) |
Caller must guarantee that for the duration of execute(), the buffer stored in UserBuffer would remain valid. For more detail on buffer ownership and lifetime requirements, please refer to zdl::DlSystem::UserBuffer documentation.
|
noexcept |
Get the diagnostic logging interface
|
noexcept |
Returns the dimensions of the input data to the model in the form of TensorShape. The dimensions in TensorShape corresponds to what the tensor dimensions would need to be for an input tensor to the model.
[in] | layer | input name. |
|
noexcept |
Returns attributes of buffers used to feed input tensors and receive result from output tensors.
[in] | Tensor | name. |
|
noexcept |
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.
|
noexcept |
Returns the version string embedded at model conversion time.
|
noexcept |
Gets the output layer(s) for the network.
Note that the output layers returned by this function may be different than those specified when the network was created via the zdl::SNPE::SNPEBuilder. For example, if the network was created in debug mode with no explicit output layers specified, this will contain all layers.
|
noexcept |
Gets the names of output tensors to the network.
|
noexcept |
Gets the name of output tensor from the input layer name.
|
noexcept |
Register Client ION Buffers.
[in] | A | UserMemoryMap of virtual addresses |
class zdl::SNPE::SNPEBuilder |
The builder class for creating SNPE objects. Not meant to be extended.
|
explicit |
Constructor of NeuralNetwork Builder with a supplied model.
[in] | container | A container holding the model. |
|
noexcept |
SNPEBuilder& setBufferDataType | ( | const zdl::DlSystem::IOBufferDataTypeMap & | dataTypeMap | ) |
Sets the datatype of the buffer. Only valid for dsp runtime currently.
[in] | Map | of the buffer names and the datatype that needs to be set. |
SNPEBuilder& setCPUFallbackMode | ( | bool | mode | ) |
Sets the mode of CPU fallback functionality.
NOTE: DEPRECATED, MAY BE REMOVED IN THE FUTURE. Please use setRuntimeProcessorOrder()
[in] | mode | This flag enables/disables the functionality of CPU fallback. When the CPU fallback functionality is enabled, layers in model that violates runtime constraints will run on CPU while the rest of non-violating layers will run on the chosen runtime processor. In disabled mode, models with layers violating runtime constraints will NOT run on the chosen runtime processor and will result in runtime exception. By default, the functionality is enabled. |
SNPEBuilder& setDebugMode | ( | bool | debugMode | ) |
Sets the debug mode of the runtime.
[in] | debugMode | This enables debug mode for the runtime. It does two things. For an empty outputLayerNames list, all layers will be output. It might also disable some internal runtime optimizations (e.g., some networks might be optimized by combining layers, etc.). |
SNPEBuilder& setExecutionPriorityHint | ( | zdl::DlSystem::ExecutionPriorityHint_t | priority | ) |
Sets a preference for execution priority.
This allows the caller to give coarse hint to SNPE runtime about the priority of the network. SNPE runtime is free to use this information to co-ordinate between different workloads that may or may not extend beyond SNPE.
[in] | ExecutionPriorityHint_t | The target performance profile. |
SNPEBuilder& setInitCacheMode | ( | bool | cacheMode | ) |
Sets the mode of init caching functionality.
[in] | mode | 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. |
SNPEBuilder& setInputDimensions | ( | const zdl::DlSystem::TensorShapeMap & | inputDimensionsMap | ) |
Sets network's input dimensions to enable resizing of the spatial dimensions of each layer for fully convolutional networks, and the batch dimension for all networks.
[in] | tensorShapeMap | 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. |
SNPEBuilder& setOutputLayers | ( | const zdl::DlSystem::StringList & | outputLayerNames | ) |
Sets the layers that will generate output.
[in] | outputLayerNames | List of layer names to output. An empty list will result in only the final layer of the model being the output layer. The list will be copied. |
SNPEBuilder& setOutputTensors | ( | const zdl::DlSystem::StringList & | outputTensorNames | ) |
Sets the output tensor names.
[in] | outputTensorNames | List of tensor names to output. An empty list will result in producing output for the final output tensor of the model. The list will be copied. |
SNPEBuilder& setPerformanceProfile | ( | zdl::DlSystem::PerformanceProfile_t | performanceProfile | ) |
Requests a performance profile.
[in] | targetRuntimeProfile | The target performance profile. |
SNPEBuilder& setPlatformConfig | ( | const zdl::DlSystem::PlatformConfig & | platformConfig | ) |
Sets the platform configuration.
[in] | platformConfig | The platform configuration. |
SNPEBuilder& setProfilingLevel | ( | zdl::DlSystem::ProfilingLevel_t | profilingLevel | ) |
Sets the profiling level. Default profiling level for SNPEBuilder is off. Off and basic only applies to DSP runtime.
[in] | profilingLevel | The target profiling level. |
SNPEBuilder& setRuntimeProcessor | ( | zdl::DlSystem::Runtime_t | targetRuntimeProcessor | ) |
Sets the runtime processor.
NOTE: DEPRECATED, MAY BE REMOVED IN THE FUTURE. Please use setRuntimeProcessorOrder()
[in] | targetRuntimeProcessor | The target runtime. |
SNPEBuilder& setRuntimeProcessorOrder | ( | const zdl::DlSystem::RuntimeList & | runtimeList | ) |
Sets network's runtime order of precedence. Example: CPU_FLOAT32, GPU_FLOAT16, AIP_FIXED8_TF Note:- setRuntimeProcessor() or setCPUFallbackMode() will be silently ignored when setRuntimeProcessorOrder() is invoked.
[in] | runtimeList | The list of runtime in order of precedence |
SNPEBuilder& setSingleThreadedInit | ( | bool | singleThreadedInit | ) |
Sets up the entire initialization callflow to happen on the user's thread.
SNPEBuilder& setTimeOut | ( | uint64_t | timeout | ) |
Execution terminated when exceeding time limit. Only valid for dsp runtime currently.
[in] | timeout | Time limit value |
SNPEBuilder& setUdlBundle | ( | zdl::DlSystem::UDLBundle | udlBundle | ) |
Passes in a User-defined layer.
udlBundle | Bundle of udl factory function and a cookie |
SNPEBuilder& setUnconsumedTensorsAsOutputs | ( | bool | setOutput | ) |
Sets the unconsumed tensors as output.
[in] | setOutput | This enables unconsumed tensors (i.e) outputs which are not inputs to any layer (basically dead ends) to be marked for output |
SNPEBuilder& setUseUserSuppliedBuffers | ( | bool | bufferMode | ) |
Sets whether this neural network will perform inference with input from user-supplied buffers, and write output to user-supplied buffers. Default behaviour is to use tensors created by ITensorFactory.
[in] | bufferMode | Whether to use user-supplied buffer or not. |
class zdl::SNPE::SNPEFactory |
The factory class for creating SNPE objects.
Static Public Member Functions | |
static bool | isRuntimeAvailable (zdl::DlSystem::Runtime_t runtime) |
static bool | isRuntimeAvailable (zdl::DlSystem::Runtime_t runtime, zdl::DlSystem::RuntimeCheckOption_t option) |
static zdl::DlSystem::ITensorFactory & | getTensorFactory () |
static zdl::DlSystem::IUserBufferFactory & | getUserBufferFactory () |
static zdl::DlSystem::Version_t | getLibraryVersion () |
static bool | setSNPEStorageLocation (const char *storagePath) |
static bool | addOpPackage (const std::string ®LibraryPath) |
static bool | isGLCLInteropSupported () |
static bool | initializeLogging (const zdl::DlSystem::LogLevel_t &level) |
static bool | initializeLogging (const zdl::DlSystem::LogLevel_t &level, const std::string &logPath) |
static bool | setLogLevel (const zdl::DlSystem::LogLevel_t &level) |
static bool | terminateLogging (void) |
|
static |
|
static |
|
static |
Gets a reference to the tensor factory.
|
static |
Gets a reference to the UserBuffer factory.
|
static |
Initializes logging with the specified log level. initializeLogging with level, is used on Android platforms and after successful initialization, SNPE logs are printed in android logcat logs.
It is recommended to initializeLogging before creating any SNPE instances, in order to capture information related to core initialization. If this is called again after first time initialization, subsequent calls are ignored. Also, Logging can be re-initialized after a call to terminateLogging API by calling initializeLogging again.
A typical usage of Logging life cycle can be initializeLogging() any other SNPE API like isRuntimeAvailable()
Please note, enabling logging can have performance impact.
[in] | LogLevel_t | Log level (LOG_INFO, LOG_WARN, etc.). |
|
static |
Initializes logging with the specified log level and log path. initializeLogging with level & log path, is used on non Android platforms and after successful initialization, SNPE logs are printed in std output & into log files created in the log path.
It is recommended to initializeLogging before creating any SNPE instances, in order to capture information related to core initialization. If this is called again after first time initialization, subsequent calls are ignored. Also, Logging can be re-initialized after a call to terminateLogging API by calling initializeLogging again.
A typical usage of Logging life cycle can be initializeLogging() any other SNPE API like isRuntimeAvailable()
Please note, enabling logging can have performance impact
[in] | LogLevel_t | Log level (LOG_INFO, LOG_WARN, etc.). |
[in] | Path | of directory to store logs. If path is empty, the default path is "./Log". For android, the log path is ignored. |
|
static |
Indicates whether the OpenGL and OpenCL interoperability is supported on GPU platform.
|
static |
Indicates whether the supplied runtime is available on the current platform.
[in] | runtime | The target runtime to check. |
|
static |
Indicates whether the supplied runtime is available on the current platform.
[in] | runtime | The target runtime to check. |
[in] | option | Extent to perform runtime available check. |
|
static |
Updates the current logging level with the specified level. setLogLevel is optional, called anytime after initializeLogging and before terminateLogging, to update the log level set. Log levels can be updated multiple times by calling setLogLevel A call to setLogLevel() is ignored if it is made before initializeLogging() or after terminateLogging()
[in] | LogLevel_t | Log level (LOG_INFO, LOG_WARN, etc.). |
|
static |
Set the SNPE storage location for all SNPE instances in this process. Note that this may only be called once, and if so must be called before creating any SNPE instances.
[in] | storagePath | Absolute path to a directory which SNPE may use for caching and other storage purposes. |
|
static |
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.
class zdl::DlSystem::StringList |
Class for holding an order list of null-terminated ASCII strings.
Public Member Functions | |
StringList (size_t length) | |
void | append (const char *str) |
const char * | at (size_t idx) const noexcept |
const char ** | begin () const noexcept |
const char ** | end () const noexcept |
size_t | size () const noexcept |
StringList & | operator= (const StringList &) noexcept |
StringList (const StringList &other) | |
StringList (StringList &&other) noexcept | |
class zdl::DlSystem::TensorMap |
A class representing the map of tensor.
Public Member Functions | |
TensorMap () | |
TensorMap (const TensorMap &other) | |
TensorMap & | operator= (const TensorMap &other) |
void | add (const char *name, zdl::DlSystem::ITensor *tensor) |
void | remove (const char *name) noexcept |
void | clear () noexcept |
zdl::DlSystem::ITensor * | getTensor (const char *name) const noexcept |
zdl::DlSystem::StringList | getTensorNames () const |
class zdl::DlSystem::TensorShape |
A class representing the shape of tensor. It is used at the time of creation of tensor.
Public Member Functions | |
TensorShape (std::initializer_list< Dimension > dims) | |
TensorShape (const Dimension *dims, size_t size) | |
TensorShape (std::vector< Dimension > dims) | |
TensorShape (const TensorShape &other) | |
TensorShape & | operator= (const TensorShape &other) |
TensorShape () | |
void | concatenate (std::initializer_list< Dimension > dims) |
void | concatenate (const Dimension *dims, size_t size) |
void | concatenate (const Dimension &dim) |
Dimension & | operator[] (size_t index) |
size_t | rank () const |
const Dimension * | getDimensions () const |
class zdl::DlSystem::TensorShapeMap |
A class representing the map of names and tensorshapes.
Public Member Functions | |
TensorShapeMap () | |
TensorShapeMap (const TensorShapeMap &other) | |
TensorShapeMap & | operator= (const TensorShapeMap &other) |
void | add (const char *name, const zdl::DlSystem::TensorShape &tensorShape) |
void | remove (const char *name) noexcept |
void | clear () noexcept |
zdl::DlSystem::TensorShape | getTensorShape (const char *name) const noexcept |
zdl::DlSystem::StringList | getTensorShapeNames () const |
struct SnpeUdo_Version_t |
struct SnpeUdo_LibVersion_t |
struct Udo_PkgVersion_t |
union SnpeUdo_Value_t |
struct SnpeUdo_ScalarParam_t |
struct SnpeUdo_TFQuantize_t |
struct SnpeUdo_QuantizeParams_t |
struct SnpeUdo_PerCoreDatatype_t |
struct SnpeUdo_TensorParam_t |
Class Members | ||
---|---|---|
uint32_t * | currDimensions |
The current dimensions of the tensor. An operation may modify the current dimensions of its output, to indicate cases where the output has been "resized". Note that for static parameters, the current and max dimensions must match. |
SnpeUdo_DataType_t | dataType | The parameter data type: float, int, etc. |
SnpeUdo_TensorLayout_t | layout | The tensor layout type: NCHW, NHWC, etc. |
uint32_t * | maxDimensions |
The maximum allowable dimensions of the tensor. The memory held in tensorData is guaranteed to be large enough for this. |
SnpeUdo_QuantizeParams_t | quantizeParams |
Quantization params applicable to the tensor. Currently only supports Tensorflow quantization style. |
void * | tensorData |
Opaque pointer to tensor data. User may be required to re-interpret the pointer based on core-specific definitions. |
uint32_t | tensorRank | Number of dimensions to the tensor: 3D, 4D, etc. |
struct SnpeUdo_TensorInfo_t |
It describes an activation tensor object using its name, the intended layout and the datatype it will take depending on the intended runtime core. The repeated field indicates that that the tensor info describes several input/output activation tensors, which all share the aforementioned properties.
struct SnpeUdo_Param_t |
struct SnpeUdo_OpCoreInfo_t |
Class Members | ||
---|---|---|
SnpeUdo_Bitmask_t | operationCalculationTypes |
Bitmask, defines supported internal calculation types (like FLOAT_32, etc) Based on SnpeUdo_DataType |
SnpeUdo_CoreType_t | udoCoreType | The IP Core. |
struct SnpeUdo_OperationInfo_t |
Class Members | ||
---|---|---|
SnpeUdo_TensorInfo_t * | inputInfos | Array of input tensor infos for this operation. |
SnpeUdo_String_t * | inputNames | Array of input tensor names to this operation. |
uint32_t | numOfCoreInfo | Number of cores that the op can execute on. |
uint32_t | numOfInputs | Number of input tensors this op receives. |
uint32_t | numOfOutputs | Number of output tensors this op receives. |
uint32_t | numOfStaticParams | Number of static parameters defined by the op. |
SnpeUdo_String_t | operationType | Operation type. |
SnpeUdo_OpCoreInfo_t * | opPerCoreInfo | Array of per-core information entries. |
SnpeUdo_TensorInfo_t * | outputInfos | Array of output tensor infos for this operation. |
SnpeUdo_String_t * | outputNames | Array of output tensor names to this operation. |
SnpeUdo_Param_t * | staticParams | Array of static parameters. Can be scalar or tensor params. |
SnpeUdo_Bitmask_t | supportedByCores |
A bitmask describing which IP Cores (CPU, GPU, DSP ...) support this operation Translated based on SnpeUdo_CoreType |
struct SnpeUdo_LibraryInfo_t |
struct SnpeUdo_RegInfo_t |
Class Members | ||
---|---|---|
SnpeUdo_LibraryInfo_t * | implementationLib | Array of implementation libraries names/types. |
uint32_t | numOfImplementationLib | The number of implementation libraries in the package. |
uint32_t | numOfOperations | Number of supported operations. |
SnpeUdo_OperationInfo_t * | operationsInfo |
Array of Operation info structs. Each entry describes one Operation (name, params, inputs, outputs) |
SnpeUdo_String_t | operationsString | A string containing all operation types separated by space. |
SnpeUdo_String_t | packageName | A string containing the package name. |
SnpeUdo_Bitmask_t | supportedCoreTypes |
A bitmask describing supported IP cores (CPU, GPU, DSP ...) Translated based on SnpeUdo_CoreType |
struct SnpeUdo_ImpInfo_t |
struct SnpeUdo_OpDefinition_t |
Class Members | ||
---|---|---|
SnpeUdo_TensorParam_t * | inputs |
Array of input tensors, providing layout, data type, sizes, etc When used to create an operation, also contains the initial location of the data |
uint32_t | numOfInputs |
The number of input parameters provided in inputs array. this number has to match the number provided by the UDO Registration library information |
uint32_t | numOfOutputs |
The number of output parameters provided in inputs array. this number has to match the number provided by the UDO Registration library information |
uint32_t | numOfStaticParams |
The number of static parameters provided in the staticParams array. this number has to match the number provided by the UDO Registration library information |
SnpeUdo_String_t | operationType | Operation type. |
SnpeUdo_TensorParam_t * | outputs |
Array of output tensors, providing layout, data type, sizes, etc When used to create an operation, also contains the initial location of the data |
SnpeUdo_Param_t * | staticParams | Array of static parameters. |
SnpeUdo_CoreType_t | udoCoreType | The IP Core that the operation is defined for - CPU, GPU, DSP... |
struct SnpeUdo_CpuInfrastructure_t |
The framework/runtime which loads the CPU UDO implementation library provides this infrastructure data to the loaded library at the time of op factory creation. as an opaque pointer. It contains hooks for the UDO library to invoke supported functionality at the time of execution
getData | function pointer to retrieve raw tensor data from opaque pointer passed into the UDO when creating an instance. |
getDataSize | function pointer to retrieve tensor data size from opaque pointer |
Public Attributes | |
float *(* | getData )(void *) |
float*(* getData) (void *) |
function pointer to retrieve raw tensor data from opaque pointer passed into the UDO when creating an instance.
struct dspGlobalInfrastructure |
The framework/runtime which loads the Hexnn UDO implementation library provides this infrastructure to the loaded library by calling "SnpeUdo_initImplLibrary" function, and passing it (cast to void*). The Hexnn UDO library is expected to cast it back to this structure.
struct hexnnv2OpFactoryInfra |
hexnn v2 per op factory infrastructure
The framework/runtime passes per op factory infrastructure as a void pointer to HexNN UDO implementation library by calling function "SnpeUdo_createOpFactory". UDO implementation library is expected to cast it back to this following struct.
struct SnpeUdo_GpuInfrastructure_t |
struct SnpeUdo_GpuOpFactoryInfrastructure_t |
struct SnpeUdo_GpuTensorData_t |
The following is a list of all SnpeUdoTensorLayout_t values supported by the GPU UDO implementation, and how the parameters of the struct should be interpreted in each case:
SNPE_UDO_LAYOUT_NHWC: mem shall be single-element array, pointing to a cl buffer memory object. the dimensions of this object match the dimensions specified in the encompassing SnpeUdoTensorParam_t's currDimensions.
memCount shall be 1.
paddedRank and paddedDimensions are undefined and shall be ignored by the UDO implementation.
class zdl::DlSystem::UserBufferMap |
A class representing the map of UserBuffer.
Public Member Functions | |
UserBufferMap () | |
UserBufferMap (const UserBufferMap &other) | |
UserBufferMap & | operator= (const UserBufferMap &other) |
void | add (const char *name, zdl::DlSystem::IUserBuffer *buffer) |
void | remove (const char *name) noexcept |
void | clear () noexcept |
zdl::DlSystem::IUserBuffer * | getUserBuffer (const char *name) const noexcept |
zdl::DlSystem::StringList | getUserBufferNames () const |
UserBufferMap | ( | ) |
Creates a new empty UserBuffer map
UserBufferMap | ( | const UserBufferMap & | other | ) |
copy constructor.
[in] | other | object to copy. |
void add | ( | const char * | name, |
zdl::DlSystem::IUserBuffer * | buffer | ||
) |
Adds a name and the corresponding UserBuffer pointer to the map.
[in] | name | The name of the UserBuffer |
[in] | userBuffer | The pointer to the UserBuffer |
|
noexcept |
Removes all UserBuffers from the map
|
noexcept |
Returns the UserBuffer given its name.
[in] | name | The name of the UserBuffer to get. |
zdl::DlSystem::StringList getUserBufferNames | ( | ) | const |
Returns the names of all UserBuffers
UserBufferMap& operator= | ( | const UserBufferMap & | other | ) |
assignment operator.
|
noexcept |
Removes a mapping of one UserBuffer and its name by its name.
[in] | name | The name of UserBuffer to be removed |
class zdl::DlSystem::UserMemoryMap |
A class representing the map of UserMemory.
Public Member Functions | |
UserMemoryMap () | |
UserMemoryMap (const UserMemoryMap &other) | |
UserMemoryMap & | operator= (const UserMemoryMap &other) |
void | add (const char *name, void *address) |
void | remove (const char *name) noexcept |
void | clear () noexcept |
zdl::DlSystem::StringList | getUserBufferNames () const |
size_t | getUserMemoryAddressCount (const char *name) const noexcept |
void * | getUserMemoryAddressAtIndex (const char *name, uint32_t index) const noexcept |
UserMemoryMap | ( | ) |
Creates a new empty UserMemory map
UserMemoryMap | ( | const UserMemoryMap & | other | ) |
copy constructor.
[in] | other | object to copy. |
void add | ( | const char * | name, |
void * | address | ||
) |
Adds a name and the corresponding buffer address to the map.
[in] | name | The name of the UserMemory |
[in] | address | The pointer to the Buffer Memory |
|
noexcept |
Removes all User Memory from the map
zdl::DlSystem::StringList getUserBufferNames | ( | ) | const |
Returns the names of all User Memory
|
noexcept |
Returns address at a specified index corresponding to a UserMemory buffer name.
[in] | name | The name of the buffer |
[in] | index | The index in the list of addresses |
|
noexcept |
Returns the no of UserMemory addresses mapped to the buffer.
[in] | name | The name of the UserMemory |
UserMemoryMap& operator= | ( | const UserMemoryMap & | other | ) |
assignment operator.
|
noexcept |
Removes a mapping of one Buffer address and its name by its name.
[in] | name | The name of Memory address to be removed |
using Dimension = size_t |
Convenient typedef to represent dimension
typedef struct dspGlobalInfrastructure SnpeUdo_DspGlobalInfrastructure_t |
Infrastructures needed by a developer of DSP Hexnn UDO Implementation library.
The framework/runtime which loads the Hexnn UDO implementation library provides this infrastructure to the loaded library by calling "SnpeUdo_initImplLibrary" function, and passing it (cast to void*). The Hexnn UDO library is expected to cast it back to this structure.
typedef SnpeUdo_ErrorType_t(* SnpeUdo_ExternalNotify_t) (const uint32_t ID) |
A pointer to notification function.
The notification function supports the non-blocking (e.g. asynchronous) execution use-case. In case an "executeUdoOp" function is called with "blocking" set to zero, and a notify function, this function will be called by the implementation library at the end of execution. The implementation library will pass the notify function the ID that was provided to it when "executeUdoOp" was called.
[in] | ID | 32-bit value, that was provided to executeUdoOp by the calling entity. Can be used to track the notifications, in case of multiple execute calls issued. |
typedef SnpeUdo_ErrorType_t(* SnpeUdo_getProgram_t) (void *programCache, const char *programName, cl_program *program) |
Function to retrieve opencl program from Program Cache repository.
This header defines version 0.0.0 of the GPU UDO Infrastructure. It defines the interpretation of the global and per-OpFactory infrastructure pointers as well as the interpretation of tensorData pointers.
The per-Operation infrastructure pointer is defined to be null, and should not be used.
The SnpeUdoTensorParam_t struct below provides the interpretation for the tensorData opaque pointer for SnpeUdoTensorParams representing inputs or outputs.
The tensorData opaque pointer populated in SnpeUdoScalarParam_t structs should be interpreted as a host-readable data pointer.
programCache | is opaque pointer to Program Cache repository provided by SNPE GPU UDO runtime. |
programName | is name associated with opencl program for UDO. |
program | is pointer to opencl program which will be populated with valid opencl program if found in Program Cache repository. |
typedef struct hexnnv2OpFactoryInfra SnpeUdo_HexNNv2OpFactoryInfra_t |
hexnn v2 per op factory infrastructure
The framework/runtime passes per op factory infrastructure as a void pointer to HexNN UDO implementation library by calling function "SnpeUdo_createOpFactory". UDO implementation library is expected to cast it back to this following struct.
typedef void* SnpeUdo_HexNNv2OpInfra_t |
hexnn v2 per operation infrastructure
The framework/runtime passes per operation infrastructure as a void pointer to HexNN UDO implementation library by calling function "SnpeUdo_createOperation". UDO implementation library is expected to cast it to the following type and save it.
This is needed to be passed back into some functions from global infrastructure.
typedef SnpeUdo_ErrorType_t(* SnpeUdo_storeProgram_t) (void *programCache, const char *programName, cl_program program) |
Function to store valid opencl program in Program Cache repository.
programCache | is opaque pointer to Program Cache repository provided by SNPE GPU UDO runtime. |
programName | is name associated with opencl program for UDO. |
program | is valid opencl program after program is built. |
|
strong |
|
strong |
Enumeration of various performance profiles that can be requested.
|
strong |
Enumeration of various profilngLevels that can be requested.
|
strong |
Enumeration of supported target runtimes.
|
strong |
enum SnpeUdo_CoreType_t |
An enum which holds the UDO library Core type . Designed to be used as single values or combined into a bitfield parameter (0x1, 0x2, 0x4, etc)
enum SnpeUdo_DataType_t |
An enum which holds the various data types. Designed to be used as single values or combined into a bitfield parameter (0x1, 0x2, 0x4, etc)
FIXED_XX types are targeted for data in tensors.
UINT / INT types are targeted for scalar params
enum SnpeUdo_ErrorType_t |
An enum which holds the various error types. The error types are divided to classes : 0 - 99 : generic errors 100 - 200 : errors related to configuration
enum SnpeUdo_ParamType_t |
An enum which holds the various layouts. Designed to be used as single values or combined into a bitfield parameter (0x1, 0x2, 0x4, etc)
void add | ( | const char * | name, |
zdl::DlSystem::IOBufferDataType_t | bufferDataType | ||
) |
Adds a name and the corresponding buffer data type to the map.
[name] | name The name of the buffer |
[bufferDataType] | buffer Data Type of the buffer |
void add | ( | const char * | name, |
zdl::DlSystem::ITensor * | tensor | ||
) |
Adds a name and the corresponding tensor pointer to the map.
[in] | name | The name of the tensor |
[out] | tensor | The pointer to the tensor |
void add | ( | const char * | name, |
const zdl::DlSystem::TensorShape & | tensorShape | ||
) |
Adds a name and the corresponding tensor pointer to the map.
[in] | name | The name of the tensor |
[out] | tensor | The pointer to the tensor |
bool add | ( | const zdl::DlSystem::Runtime_t & | runtime | ) |
Adds runtime to the end of the runtime list order of precedence is former followed by latter entry.
[in] | runtime | to add |
Ruturns false If the runtime already exists
void append | ( | const char * | str | ) |
Append a string to the list.
[in] | str | Null-terminated ASCII string to append to the list. |
const zdl::DlSystem::String asString | ( | ) | const |
Returns a string in the form Major.Minor.Teeny.Build.
|
noexcept |
Returns the string at the indicated position, or an empty string if the positions is greater than the size of the list.
[in] | idx | Position in the list of the desired string |
|
noexcept |
Pointer to the first string in the list. Can be used to iterate through the list.
|
pure virtual |
Returns a tensor iterator pointing to the beginning of the data in the tensor.
|
pure virtual |
Returns the const version of a tensor iterator pointing to the beginning of the data in the tensor.
|
pure virtual |
Returns the const version of a tensor iterator pointing to the end of the data in the tensor. This tensor should not be dereferenced.
|
noexcept |
Removes all tensors from the map
|
noexcept |
Removes all tensors from the map
|
noexcept |
Removes all runtime from the list
void concatenate | ( | std::initializer_list< Dimension > | dims | ) |
Concatenates additional dimensions specified in initializer list fashion to the existing dimensions.
[in] | dims | The dimensions are specified in which the last element of the vector represents the fastest varying dimension and the zeroth element represents the slowest varying, etc. |
void concatenate | ( | const Dimension * | dims, |
size_t | size | ||
) |
Concatenates additional dimensions specified in the array to the existing dimensions.
[in] | dims | The dimensions are specified in which the last element of the vector represents the fastest varying dimension and the zeroth element represents the slowest varying, etc. |
[in] | size | Size of the array. |
void concatenate | ( | const Dimension & | dim | ) |
Concatenates an additional dimension to the existing dimensions.
[in] | dim | The dimensions are specified in which the last element of the vector represents the fastest varying dimension and the zeroth element represents the slowest varying, etc. |
|
pure virtualnoexcept |
Creates a new ITensor with uninitialized data.
The strides for the tensor will match the tensor dimensions (i.e., the tensor data is contiguous in memory).
[in] | shape | The dimensions for the tensor in which the last element of the vector represents the fastest varying dimension and the zeroth element represents the slowest varying, etc. |
|
pure virtualnoexcept |
Creates a new ITensor by loading it from a file.
[in] | input | The input stream from which to read the tensor data. |
|
pure virtualnoexcept |
Create a new ITensor with specific data. (i.e. the tensor data is contiguous in memory). This tensor is primarily used to create a tensor where tensor size can't be computed directly from dimension. One such example is NV21-formatted image, or any YUV formatted image
[in] | shape | The dimensions for the tensor in which the last element of the vector represents the fastest varying dimension and the zeroth element represents the slowest varying, etc. |
[in] | data | The actual data with which the Tensor object is filled. |
[in] | dataSize | The size of data |
bool empty | ( | ) |
Checks whether the map is empty.
|
noexcept |
Pointer to one after the last string in the list. Can be used to iterate through the list.
|
pure virtual |
Returns a tensor iterator pointing to the end of the data in the tensor. This tensor should not be dereferenced.
ZDL_EXPORT uint32_t zdl::DlSystem::enumToUInt32 | ( | zdl::DlSystem::ErrorCode | code | ) |
Returns the uint32_t representation of the error code enum.
[in] | code | The error code to be converted. |
bool find | ( | const char * | name | ) |
Checks the existence of the named buffer in the map.
zdl::DlSystem::IOBufferDataType_t getBufferDataType | ( | const char * | name | ) |
Returns the type of the named buffer.
[name] | name The name of the buffer |
zdl::DlSystem::IOBufferDataType_t getBufferDataType | ( | ) |
Returns the type of the first buffer.
const Dimension* getDimensions | ( | ) | const |
Retrieves a pointer to the first dimension of shape
ZDL_EXPORT ErrorCode zdl::DlSystem::getLastErrorCode | ( | ) |
Returns the error code of the last error encountered.
ZDL_EXPORT const char* zdl::DlSystem::getLastErrorString | ( | ) |
Returns the error string of the last error encountered.
ZDL_EXPORT const char* zdl::DlSystem::getLastInfoString | ( | ) |
Returns the info string of the last error encountered.
|
pure virtual |
Gets the curent options for the diag logger.
zdl::DlSystem::StringList getRuntimeListNames | ( | ) | const |
Returns a StringList of names from the runtime list in order of precedence
|
pure virtual |
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.
|
pure virtual |
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.
|
noexcept |
Returns the tensor given its name.
[in] | name | The name of the tensor to get. |
zdl::DlSystem::StringList getTensorNames | ( | ) | const |
Returns the names of all tensors
|
noexcept |
Returns the tensor given its name.
[in] | name | The name of the tensor to get. |
zdl::DlSystem::StringList getTensorShapeNames | ( | ) | const |
Returns the names of all tensor shapes
Creates a new Buffer Data type map
|
staticnoexcept |
Initializes a container from a container archive file.
[in] | filename | Container archive file path. |
|
staticnoexcept |
Initializes a container from a container archive file.
[in] | filename | Container archive file path. |
|
staticnoexcept |
Initializes a container from a byte buffer.
[in] | buffer | Byte buffer holding the contents of an archive file. |
|
staticnoexcept |
Initializes a container from a byte buffer.
[in] | buffer | Byte buffer holding the contents of an archive file. |
[in] | size | Size of the byte buffer. |
|
inlinenoexcept |
Boolean value of Optional class is only true when there exists a value.
|
inline |
|
inline |
TensorShapeMap& operator= | ( | const TensorShapeMap & | other | ) |
assignment operator.
RuntimeList& operator= | ( | const RuntimeList & | other | ) |
assignment operator.
|
noexcept |
assignment operator.
TensorShape& operator= | ( | const TensorShape & | other | ) |
assignment operator.
Runtime_t& operator[] | ( | size_t | index | ) |
subscript operator.
Dimension& operator[] | ( | size_t | index | ) |
Retrieves a single dimension, based on its index.
std::out_of_range | if the index is >= the number of dimensions (or rank). |
|
inline |
The default constructor is set to not have any value, and is therefore evaluated as false.
|
inline |
size_t rank | ( | ) | const |
Retrieves the rank i.e. number of dimensions.
void remove | ( | const char * | name | ) |
Removes a buffer name from the map.
[name] | name The name of the buffer |
|
noexcept |
Removes a mapping of tensor and its name by its name.
[in] | name | The name of tensor to be removed |
|
noexcept |
Removes a mapping of tensor and its name by its name.
[in] | name | The name of tensor to be removed |
|
noexcept |
Removes the runtime from the list.
[in] | runtime | to be removed |
RuntimeList | ( | ) |
Creates a new runtime list
RuntimeList | ( | const RuntimeList & | other | ) |
copy constructor.
[in] | other | object to copy. |
RuntimeList | ( | const zdl::DlSystem::Runtime_t & | runtime | ) |
constructor with single Runtime_t object
[in] | Runtime_t | object |
|
static |
[in] | runtime | Returns a string corresponding to the in param runtime enum |
|
pure virtual |
Serializes the tensor to an output stream.
[in] | output | The output stream to which to write the tensor |
std::runtime_error | If the stream is ever in a bad state before the tensor is fully serialized. |
|
pure virtual |
Allows for setting the log mask once diag logging has started
|
pure virtual |
Allows for setting the log mask once diag logging has started
|
pure virtual |
Sets the options after initialization occurs.
[in] | loggingOptions | The options to set up diagnostic logging. |
|
noexcept |
Return the number of valid string pointers held by this list.
size_t size | ( | ) |
Returns the size of the buffer type map.
SnpeUdo_ErrorType_t SnpeUdo_createOperation | ( | SnpeUdo_OpFactory_t | opFactory, |
void * | perOpInfrastructure, | ||
uint32_t | numOfInputs, | ||
SnpeUdo_TensorParam_t * | inputs, | ||
uint32_t | numOfOutputs, | ||
SnpeUdo_TensorParam_t * | outputs, | ||
SnpeUdo_Operation_t * | operation | ||
) |
A function to create an operation from the factory. The function receives array of inputs and array of outputs, and creates an operation instance, returning the operation instance handler.
[in] | opFactory | OpFactory instance containing the parameters for this operation. |
[in] | perOpInfrastructure | Per-Op infrastructure for this operation. The definition and semantics of this object will be defined in the implementation header appropriate to this core type. |
[in] | numOfInputs | The number of input tensors this operation will receive. |
[in] | inputs | Array of input tensors, providing both the sizes and initial location of the data. |
[in] | numOfOutputs | Number of output tensors this operation will produce. |
[in] | outputs | Array of output tensors, providing both the sizes and initial location of the data. |
[in,out] | operation | Handle for newly created operation instance. |
SnpeUdo_ErrorType_t SnpeUdo_createOpFactory | ( | SnpeUdo_CoreType_t | udoCoreType, |
void * | perFactoryInfrastructure, | ||
SnpeUdo_String_t | operationType, | ||
uint32_t | numOfStaticParams, | ||
SnpeUdo_Param_t * | staticParams, | ||
SnpeUdo_OpFactory_t * | opFactory | ||
) |
A function to create an operation factory. The function receives the operation type, and an array of static parameters, and returns operation factory handler.
[in] | udoCoreType | The Core type to create the operation on. An error will be returned if this does not match the core type of the library. |
[in] | perFactoryInfrastructure | CreateOpFactory infrastructure appropriate to this core type. The definition and semantics of this object will be defined in the corresponding implementation header for the core type. |
[in] | operationType | A string containing Operation type. for example "MY_CONV" |
[in] | numOfStaticParams | The number of static parameters. |
[in] | staticParams | Array of static parameters |
[in,out] | opFactory | Handler to Operation Factory, to be used when creating operations |
SnpeUdo_ErrorType_t SnpeUdo_executeOp | ( | SnpeUdo_Operation_t | operation, |
bool | blocking, | ||
const uint32_t | ID, | ||
SnpeUdo_ExternalNotify_t | notifyFunc | ||
) |
Operation execution function.
Calling this function will run the operation on set of inputs, generating a set of outputs. The call can be blocking (synchronous) or non-blocking (asynchronous). To support the non-blocking mode, the calling entity can pass an ID and a notification function. At the end of the execution this notification function would be called, passing it the ID. NOTE: Asynchronous execution mode not supported in this release.
[in] | operation | handle to the operation on which execute is invoked |
[in] | blocking | flag to indicate execution mode. If set, execution is blocking, e.g SnpeUdo_executeOp call does not return until execution is done. If not set, SnpeUdo_executeOp returns immediately, and the library will call the notification function (if set) when execution is done. |
[in] | ID | 32-bit number that can be used by the calling entity to track execution in case of non-blocking execution. For example, it can be a sequence number, increased by one on each call. |
[in] | notifyFunc | Pointer to notification function. if the pointer is set, and execution is non-blocking, the library will call this function at end of execution, passing the number provided as ID |
SnpeUdo_ErrorType_t SnpeUdo_getImpInfo | ( | SnpeUdo_ImpInfo_t ** | implementationInfo | ) |
A function to query info on the UDO implementation library. The function populates a structure which contains information about operations that are part of this library.
[in,out] | implementationInfo | A pointer to struct which contains information on the operations |
SnpeUdo_ErrorType_t SnpeUdo_getImplVersion | ( | SnpeUdo_LibVersion_t ** | version | ) |
A function to query the API version of the UDO implementation library. The function populates a SnpeUdo_LibVersion_t struct, which contains a SnpeUdo_Version_t struct for API version and library version.
[in,out] | version | A pointer to struct which contains major, minor, teeny information for library and api versions. |
SnpeUdo_ErrorType_t SnpeUdo_getRegInfo | ( | SnpeUdo_RegInfo_t ** | registrationInfo | ) |
A function to query the info on the UDO set. The function populates a structure which contains information about the package and operations contained in it.
[in,out] | registrationInfo | A struct which contains information on the set of UDOs |
SnpeUdo_ErrorType_t SnpeUdo_getRegLibraryVersion | ( | SnpeUdo_LibVersion_t ** | version | ) |
A function to query the API version of the UDO registration library. The function populates a SnpeUdo_LibVersion_t struct, which contains a SnpeUdo_Version_t struct for API version and library version.
[in,out] | version | A pointer to struct which contains major, minor, teeny information for library and api versions. |
SnpeUdo_ErrorType_t SnpeUdo_getVersion | ( | SnpeUdo_LibVersion_t ** | version | ) |
A function to return the various versions as they relate to the UDO The function returns a struct containing the the following: libVersion: the version of the implementation library compiled for the UDO. Set by user apiVersion: the version of the UDO API used in compiling the implementation library. Set by SNPE.
[in,out] | version | A pointer to Version struct of type SnpeUdo_LibVersion_t |
SnpeUdo_ErrorType_t SnpeUdo_initImplLibrary | ( | void * | globalInfrastructure | ) |
Initialize the shared library's data structures. Calling any other library function before this one will result in error.
[in] | globalInfrastructure | Global core-specific infrastructure to be used by operations created in this library. The definition and semantics of this object will be defined in the corresponding implementation header for the core type. |
SnpeUdo_ErrorType_t SnpeUdo_initRegLibrary | ( | void | ) |
Initialize the shared library's data structures. Calling any other library function before this one will result in an error being returned.
SnpeUdo_ErrorType_t SnpeUdo_profileOp | ( | SnpeUdo_Operation_t | operation, |
uint32_t * | executionTime | ||
) |
A function to return execution times.
This function can be called to query the operation execution times on the IP core on which the operation is run. The time is provided in micro-seconds
[in] | operation | Handle to operation whose execution time is being profiled |
[in,out] | executionTime | pointer to a uint32 value.This function writes the operation execution time in usec into this value. |
SnpeUdo_ErrorType_t SnpeUdo_queryOperation | ( | SnpeUdo_String_t | operationType, |
uint32_t | numOfStaticParams, | ||
const SnpeUdo_Param_t * | staticParams, | ||
uint32_t * | numOfInputs, | ||
SnpeUdo_QuantizationType_t ** | inputsQuantTypes, | ||
SnpeUdo_HexNNTensorLayout_t ** | inputsLayouts, | ||
uint32_t * | numOfOutputs, | ||
SnpeUdo_QuantizationType_t ** | outputsQuantTypes, | ||
SnpeUdo_HexNNTensorLayout_t ** | outputsLayouts | ||
) |
A function to query numbers of inputs and outputs, quantization type of each input and each output as arrays, and data layout (plain vs d32) of each input and each output as arrays of an operation. inputsQuantTypes and inputsLayouts should point to arrays of size numOfInputs outputsQuantTypes and outputsLayouts should point to arrays of size numOfOutputs.
Note: inputsLayouts and inputsLayouts can point to NULL, in this case, it is assumed all inputs and/or outputs have plain data layouts, i.e. no D32
[in] | operationType | Operation type |
[in] | numOfStaticParams | Number of static params defined by the op |
[in] | staticParams | Array of static params to the op |
[in,out] | numOfInputs | Number of input tensors to the op |
[in,out] | inputsQuantTypes | Array of Quantization info for each input tensor |
[in,out] | inputsLayouts | Array of layout type for each input tensor |
[in,out] | numOfOutputs | Number of output tensors to the op |
[in,out] | outputsQuantTypes | Array of Quantization info for each output tensor |
[in,out] | outputsLayouts | Array of layout type for each output tensor |
SnpeUdo_ErrorType_t SnpeUdo_releaseOp | ( | SnpeUdo_Operation_t | operation | ) |
A function to release the operation instance
When it is called, the implementation library needs to release all resources allocated for this operation instance.
Note that all function pointers which are part of SnpeUdo_Operation become invalid once releaseUdoOp call returns.
[in] | operation | Handle to operation to be released |
SnpeUdo_ErrorType_t SnpeUdo_releaseOpFactory | ( | SnpeUdo_OpFactory_t | opFactory | ) |
A function to release the resources allocated for an operation factory created by this library.
[in] | factory | The operation factory to release. Upon success this handle will be invalidated. |
SnpeUdo_ErrorType_t SnpeUdo_setOpIO | ( | SnpeUdo_Operation_t | operation, |
SnpeUdo_TensorParam_t * | inputs, | ||
SnpeUdo_TensorParam_t * | outputs | ||
) |
A function to setting the inputs & outputs. part of SnpeUdo_Operation struct, returned from creation of a new operation instance. Not supported in this release.
This function allows the calling entity to change some of the inputs and outputs between calls to execute. Note that the change is limited to changing the pointer to the tensor data only. Any other change may be rejected by the implementation library, causing immediate invalidation of the operation instance
[in] | operation | Operation on which IO tensors are set |
[in] | inputs | array of tensor parameters. The calling entity may provide a subset of the operation inputs, providing only those that it wants to change. |
[in] | outputs | array of tensor parameters. The calling entity may provide a subset of the operation outputs, providing only those that it wants to change. |
SnpeUdo_ErrorType_t SnpeUdo_terminateImplLibrary | ( | void | ) |
Release the shared library's data structures, and invalidate any handles returned by the library. The behavior of any outstanding asynchronous calls made to this library when this function is called are undefined. All library functions (except SnpeUdo_initImplLibrary) will return an error after this function has been successfully called.
It should be possible to call SnpeUdo_initImplLibrary after calling this function, and re-initialize the library.
SnpeUdo_ErrorType_t SnpeUdo_terminateRegLibrary | ( | void | ) |
Release the shared library's data structures, and invalidate any handles returned by the library. The behavior of any outstanding asynchronous calls made to this library when this function is called are undefined. All library functions (except SnpeUdo_InitRegLibrary) will return an error after this function has been successfully called.
It should be possible to call SnpeUdo_InitRegLibrary after calling this function, and re-initialize the library.
SnpeUdo_ErrorType_t SnpeUdo_validateOperation | ( | SnpeUdo_String_t | operationType, |
uint32_t | numOfStaticParams, | ||
const SnpeUdo_Param_t * | staticParams | ||
) |
A function to validate that a set of params is supported by an operation This function is HexNN specific, use case is when registration library is not in use. Optional function.
[in] | operationType | Operation type |
[in] | numOfStaticParams | Number of static params defined by the op |
[in] | staticParams | Array of static params to the op |
SnpeUdo_ErrorType_t SnpeUdo_validateOperation | ( | SnpeUdo_OpDefinition_t * | opDefinition | ) |
A function to validate that a set of params is supported by an operation The function receives an operation definition struct, and returns if this configuration is supported (e.g. if an operation can be created using this configuration)
[in] | opDefinition | A struct of SnpeUdo_OpDefinition type, containing the information needed to validate that an operation can be created with this configuration. |
|
pure virtual |
Enables logging for zdl components.
Logging should be started prior to the instantiation of zdl components to ensure all events are captured.
|
explicit |
Construct a string list with some pre-allocated memory.
[in] | length | Number of elements for which to pre-allocate space. |
StringList | ( | const StringList & | other | ) |
copy constructor.
[in] | other | object to copy. |
|
noexcept |
move constructor.
[in] | other | object to move. |
|
static |
[in] | runtime | string Returns a Runtime enum corresponding to the in param string |
TensorMap | ( | ) |
Creates a new empty tensor map
TensorShape | ( | std::initializer_list< Dimension > | dims | ) |
Creates a new shape with a list of dims specified in initializer list fashion.
[in] | dims | The dimensions are specified in which the last element of the vector represents the fastest varying dimension and the zeroth element represents the slowest varying, etc. |
TensorShape | ( | const Dimension * | dims, |
size_t | size | ||
) |
Creates a new shape with a list of dims specified in array
[in] | dims | The dimensions are specified in which the last element of the vector represents the fastest varying dimension and the zeroth element represents the slowest varying, etc. |
[in] | size | Size of the array. |
TensorShape | ( | std::vector< Dimension > | dims | ) |
Creates a new shape with a vector of dims specified in vector fashion.
[in] | dims | The dimensions are specified in which the last element of the vector represents the fastest varying dimension and the zeroth element represents the slowest varying, etc. |
TensorShape | ( | const TensorShape & | other | ) |
copy constructor.
[in] | other | object to copy. |
TensorShape | ( | ) |
Creates a new shape with no dims. It can be extended later by invoking concatenate.
TensorShapeMap | ( | ) |
Creates a new tensor shape map
TensorShapeMap | ( | const TensorShapeMap & | other | ) |
copy constructor.
[in] | other | object to copy. |
const std::string toString | ( | ) | const |
Returns a string in the form Major.Minor.Teeny.Build.
std::string Build |
This string holds information about the build version.
int32_t Major |
Holds the major version number. Changes in this value indicate major changes that break backward compatibility.
int32_t Minor |
Holds the minor version number. Changes in this value indicate minor changes made to library that are backwards compatible (such as additions to the interface).
int32_t Teeny |
Holds the teeny version number. Changes in this value indicate changes such as bug fixes and patches made to the library that do not affect the interface.