diff --git a/release/files_tici b/release/files_tici index f63a750f4d..68e075c971 100644 --- a/release/files_tici +++ b/release/files_tici @@ -1,5 +1,5 @@ third_party/snpe/larch64** -third_party/snpe/aarch64-linux-gcc4.9/* +third_party/snpe/aarch64-ubuntu-gcc7.5/* third_party/mapbox-gl-native-qt/include/* selfdrive/timezoned.py diff --git a/selfdrive/modeld/SConscript b/selfdrive/modeld/SConscript index 77d5787367..c6855e8c38 100644 --- a/selfdrive/modeld/SConscript +++ b/selfdrive/modeld/SConscript @@ -4,7 +4,7 @@ Import('env', 'arch', 'cereal', 'messaging', 'common', 'gpucommon', 'visionipc') lenv = env.Clone() libs = [cereal, messaging, common, visionipc, gpucommon, - 'OpenCL', 'SNPE', 'symphony-cpu', 'capnp', 'zmq', 'kj', 'yuv'] + 'OpenCL', 'SNPE', 'capnp', 'zmq', 'kj', 'yuv'] def get_dlsym_offset(): """Returns the offset between dlopen and dlsym in libdl.so""" @@ -57,7 +57,6 @@ else: # no SNPE on Mac del libs[libs.index('SNPE')] - del libs[libs.index('symphony-cpu')] del common_src[common_src.index('runners/snpemodel.cc')] common_model = lenv.Object(common_src) diff --git a/third_party/snpe/aarch64-linux-gcc4.9/libPlatformValidatorShared.so b/third_party/snpe/aarch64-linux-gcc4.9/libPlatformValidatorShared.so deleted file mode 100644 index d184ebd3b0..0000000000 --- a/third_party/snpe/aarch64-linux-gcc4.9/libPlatformValidatorShared.so +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:282c2b7490834ff1daae1f1e567bd9553ee78e7cd532e06f960f5f11a77a2cd5 -size 1114072 diff --git a/third_party/snpe/aarch64-linux-gcc4.9/libSNPE.so b/third_party/snpe/aarch64-linux-gcc4.9/libSNPE.so deleted file mode 100644 index 4245830c8c..0000000000 --- a/third_party/snpe/aarch64-linux-gcc4.9/libSNPE.so +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:47c77da6a5002e3100e7bec4aee72c5ae0f25ba9b3f7cb967b756dde6ee98a13 -size 9447816 diff --git a/third_party/snpe/aarch64-linux-gcc4.9/libatomic.so.1 b/third_party/snpe/aarch64-linux-gcc4.9/libatomic.so.1 deleted file mode 100644 index 4fbe5cd851..0000000000 --- a/third_party/snpe/aarch64-linux-gcc4.9/libatomic.so.1 +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:0841acd6dc55213906c8532b866e475e494c50635ef379f5986e2323db137c2a -size 123705 diff --git a/third_party/snpe/aarch64-linux-gcc4.9/libcalculator.so b/third_party/snpe/aarch64-linux-gcc4.9/libcalculator.so deleted file mode 100644 index a9ecbedad3..0000000000 --- a/third_party/snpe/aarch64-linux-gcc4.9/libcalculator.so +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:a61ee40b3bfd9099a7fb342228be98f838c170c44ba15f7a3f6d57f6e5685a19 -size 12832 diff --git a/third_party/snpe/aarch64-linux-gcc4.9/libcalculator_domains.so b/third_party/snpe/aarch64-linux-gcc4.9/libcalculator_domains.so deleted file mode 100644 index e1ffa5b43a..0000000000 --- a/third_party/snpe/aarch64-linux-gcc4.9/libcalculator_domains.so +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:9553e076de8016e8d8b8800f95fc1be8dd342a5455914eb6a136e40a6c01e58b -size 12832 diff --git a/third_party/snpe/aarch64-linux-gcc4.9/libsnpe_adsp.so b/third_party/snpe/aarch64-linux-gcc4.9/libsnpe_adsp.so deleted file mode 100644 index 1facc6bba0..0000000000 --- a/third_party/snpe/aarch64-linux-gcc4.9/libsnpe_adsp.so +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:14de0b1a5775fb17ac266919523eaf8ddc4cb960ddfe4e34a6505b84c4ad69b6 -size 19392 diff --git a/third_party/snpe/aarch64-linux-gcc4.9/libsnpe_dsp_domains_v2.so b/third_party/snpe/aarch64-linux-gcc4.9/libsnpe_dsp_domains_v2.so deleted file mode 100644 index 9857b76508..0000000000 --- a/third_party/snpe/aarch64-linux-gcc4.9/libsnpe_dsp_domains_v2.so +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:ad7ff523977263e5c89b5299d63990594a2de02435ff309851b6f676ba42a322 -size 20192 diff --git a/third_party/snpe/aarch64-linux-gcc4.9/libsymphony-cpu.so b/third_party/snpe/aarch64-linux-gcc4.9/libsymphony-cpu.so deleted file mode 100644 index 4cad3b2c83..0000000000 --- a/third_party/snpe/aarch64-linux-gcc4.9/libsymphony-cpu.so +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:4c8a1bd8aa6d5977896562b61083b3cd26247d54d52456a2ddf333d010c21685 -size 648120 diff --git a/third_party/snpe/aarch64-ubuntu-gcc7.5/libPlatformValidatorShared.so b/third_party/snpe/aarch64-ubuntu-gcc7.5/libPlatformValidatorShared.so new file mode 100644 index 0000000000..a1c6fed910 --- /dev/null +++ b/third_party/snpe/aarch64-ubuntu-gcc7.5/libPlatformValidatorShared.so @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:fb3b1fd29d958e9a3a6625eac9fac9e7cd6eb40309b285ad973324761db0b4c9 +size 1202792 diff --git a/third_party/snpe/aarch64-ubuntu-gcc7.5/libSNPE.so b/third_party/snpe/aarch64-ubuntu-gcc7.5/libSNPE.so new file mode 100644 index 0000000000..54c0c32e41 --- /dev/null +++ b/third_party/snpe/aarch64-ubuntu-gcc7.5/libSNPE.so @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:161a5d0bf7347465b53ae49690a38fbacf03d606ef204147b3b148a5f59188da +size 9008016 diff --git a/third_party/snpe/aarch64-ubuntu-gcc7.5/libcalculator.so b/third_party/snpe/aarch64-ubuntu-gcc7.5/libcalculator.so new file mode 100644 index 0000000000..2154203026 --- /dev/null +++ b/third_party/snpe/aarch64-ubuntu-gcc7.5/libcalculator.so @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7e0e66c12a1eb3b5b4b2b2694831ca51e5132818f400dad789adbcc30e0e0793 +size 14032 diff --git a/third_party/snpe/aarch64-ubuntu-gcc7.5/libhta.so b/third_party/snpe/aarch64-ubuntu-gcc7.5/libhta.so new file mode 100644 index 0000000000..1d81abd3a5 --- /dev/null +++ b/third_party/snpe/aarch64-ubuntu-gcc7.5/libhta.so @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:784f2e80fa3534cf7934c5ecbbda37db633104380f2b41d896b4721ad6006eb2 +size 2420312 diff --git a/third_party/snpe/aarch64-ubuntu-gcc7.5/libsnpe_dsp_domains_v2.so b/third_party/snpe/aarch64-ubuntu-gcc7.5/libsnpe_dsp_domains_v2.so new file mode 100644 index 0000000000..40e3d5af74 --- /dev/null +++ b/third_party/snpe/aarch64-ubuntu-gcc7.5/libsnpe_dsp_domains_v2.so @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:33afe465e74bbe2c409350d2ca8e86cfadf050ceb8feac75a86adc19ff1f9c48 +size 26016 diff --git a/third_party/snpe/dsp/libcalculator_domains_skel.so b/third_party/snpe/dsp/libcalculator_domains_skel.so deleted file mode 100644 index 81c89469ad..0000000000 --- a/third_party/snpe/dsp/libcalculator_domains_skel.so +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:6c2f2d3bf9fd0562d6d84cf3d004bf5ab19e5e613692f2757468251158f91fa0 -size 20828 diff --git a/third_party/snpe/dsp/libcalculator_skel.so b/third_party/snpe/dsp/libcalculator_skel.so index 0c8be90746..9e9e9221be 100644 --- a/third_party/snpe/dsp/libcalculator_skel.so +++ b/third_party/snpe/dsp/libcalculator_skel.so @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:90a36a16943fbb6c1a6e09cefd552878047daa20d1d5cbb8f08e32f67ea721e4 -size 20816 +oid sha256:7bee94d38195478ffdd0ce15292a2dfa7813377f4c3b7d99c270e05079d1746b +size 20828 diff --git a/third_party/snpe/dsp/libsnpe_dsp_domains_skel.so b/third_party/snpe/dsp/libsnpe_dsp_domains_skel.so deleted file mode 100644 index 0d514aef4b..0000000000 --- a/third_party/snpe/dsp/libsnpe_dsp_domains_skel.so +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:b1a93ade8c97a82e51d5fad809f5b024e0dab013e1a06d05fb57d566204c5648 -size 1434132 diff --git a/third_party/snpe/dsp/libsnpe_dsp_skel.so b/third_party/snpe/dsp/libsnpe_dsp_skel.so deleted file mode 100644 index 1380e72b07..0000000000 --- a/third_party/snpe/dsp/libsnpe_dsp_skel.so +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:73439783c54e02a66a10280023b9fd6fa0f2f420f57da58b131756da4877739c -size 1431408 diff --git a/third_party/snpe/dsp/libsnpe_dsp_v65_domains_v2_skel.so b/third_party/snpe/dsp/libsnpe_dsp_v65_domains_v2_skel.so index 7b3733a956..3f1b7a8b8c 100644 --- a/third_party/snpe/dsp/libsnpe_dsp_v65_domains_v2_skel.so +++ b/third_party/snpe/dsp/libsnpe_dsp_v65_domains_v2_skel.so @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:5fdb14a91986b001cb5b517ec0595411e09a37d60e0bdab2cfbd72b22274eb3e -size 1492098 +oid sha256:4e040c87072aa915c47859c8c7f74076b98c6919b83ddd5dc4bb555870d586a7 +size 1813866 diff --git a/third_party/snpe/dsp/libsnpe_dsp_v66_domains_v2_skel.so b/third_party/snpe/dsp/libsnpe_dsp_v66_domains_v2_skel.so index 90b55874eb..aa42b5e830 100644 --- a/third_party/snpe/dsp/libsnpe_dsp_v66_domains_v2_skel.so +++ b/third_party/snpe/dsp/libsnpe_dsp_v66_domains_v2_skel.so @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:868616a42ddaef80b605078ae8864d05635349283527d665fcc5a7639b87a28a -size 1492098 +oid sha256:838bc58ac0094ba9593cf7c44ab6e8a94ae3dbbe176e320d9fbe86ceead53c5e +size 1817962 diff --git a/third_party/snpe/dsp/libsnpe_dsp_v68_domains_v3_skel.so b/third_party/snpe/dsp/libsnpe_dsp_v68_domains_v3_skel.so new file mode 100644 index 0000000000..9423da1b94 --- /dev/null +++ b/third_party/snpe/dsp/libsnpe_dsp_v68_domains_v3_skel.so @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:77d025d59521e13e4ed012f0d9d2b684cdb858208d70426078df51219eaeb9bd +size 10098673 diff --git a/third_party/snpe/include/DlSystem/DlEnums.hpp b/third_party/snpe/include/DlSystem/DlEnums.hpp index 1447063553..c9b3ef970a 100644 --- a/third_party/snpe/include/DlSystem/DlEnums.hpp +++ b/third_party/snpe/include/DlSystem/DlEnums.hpp @@ -1,6 +1,6 @@ //============================================================================== // -// Copyright (c) 2014-2020 Qualcomm Technologies, Inc. +// Copyright (c) 2014-2021 Qualcomm Technologies, Inc. // All Rights Reserved. // Confidential and Proprietary - Qualcomm Technologies, Inc. // @@ -76,6 +76,8 @@ enum class RuntimeCheckOption_t NORMAL_CHECK = 0, /// Perform basic runtime available check, may be runtime specific BASIC_CHECK = 1, + /// Perform unsignedPD runtime available check + UNSIGNEDPD_CHECK = 2, }; /** @@ -196,6 +198,36 @@ enum class ImageEncoding_t BGR = 6 }; +/** + * Enumeration that lists the supported LogLevels that can be set by users. + */ +enum class LogLevel_t +{ + /// Enumeration variable to be used by user to set logging level to FATAL. + LOG_FATAL = 0, + + /// Enumeration variable to be used by user to set logging level to ERROR. + LOG_ERROR = 1, + + /// Enumeration variable to be used by user to set logging level to WARN. + LOG_WARN = 2, + + /// Enumeration variable to be used by user to set logging level to INFO. + LOG_INFO = 3, + + /// Enumeration variable to be used by user to set logging level to VERBOSE. + LOG_VERBOSE = 4 +}; + +typedef enum : int +{ + UNSPECIFIED = 0, + FLOATING_POINT_32 = 1, + FLOATING_POINT_16 = 2, + FIXED_POINT_8 = 3, + FIXED_POINT_16 = 4 +} IOBufferDataType_t; + }} // namespaces end diff --git a/third_party/snpe/include/DlSystem/DlError.hpp b/third_party/snpe/include/DlSystem/DlError.hpp index f0a66e8e45..57592f01ba 100644 --- a/third_party/snpe/include/DlSystem/DlError.hpp +++ b/third_party/snpe/include/DlSystem/DlError.hpp @@ -1,6 +1,6 @@ //============================================================================== // -// Copyright (c) 2016-2020 Qualcomm Technologies, Inc. +// Copyright (c) 2016-2021 Qualcomm Technologies, Inc. // All Rights Reserved. // Confidential and Proprietary - Qualcomm Technologies, Inc. // @@ -59,6 +59,7 @@ enum class ZDL_EXPORT ErrorCode : uint32_t { SNPE_DLSYSTEM_BUFFER_CAST_FAILED = 216, SNPE_DLSYSTEM_WRONG_TRANSITION_TYPE = 217, SNPE_DLSYSTEM_LAYER_ALREADY_REGISTERED = 218, + SNPE_DLSYSTEM_TENSOR_DIM_INVALID = 219, SNPE_DLSYSTEM_BUFFERENCODING_UNKNOWN = 240, SNPE_DLSYSTEM_BUFFER_INVALID_PARAM = 241, @@ -89,6 +90,7 @@ enum class ZDL_EXPORT ErrorCode : uint32_t { SNPE_NETWORK_MISMATCH_BETWEEN_NAMES_AND_DIMS = 404, SNPE_NETWORK_MISSING_INPUT_NAMES = 405, SNPE_NETWORK_MISSING_OUTPUT_NAMES = 406, + SNPE_NETWORK_EXECUTION_FAILED = 407, // Host runtime errors SNPE_HOST_RUNTIME_TARGET_UNAVAILABLE = 500, @@ -140,6 +142,13 @@ enum class ZDL_EXPORT ErrorCode : uint32_t { SNPE_DSP_RUNTIME_INVALID_PARAM_ERROR = 909, SNPE_DSP_RUNTIME_SYSTEM_ERROR = 910, SNPE_DSP_RUNTIME_CRASHED_ERROR = 911, + SNPE_DSP_BUFFER_SIZE_ERROR = 912, + SNPE_DSP_UDO_EXECUTE_ERROR = 913, + SNPE_DSP_UDO_LIB_NOT_REGISTERED_ERROR = 914, + SNPE_DSP_UDO_INVALID_QUANTIZATION_TYPE_ERROR = 915, + SNPE_DSP_RUNTIME_INVALID_RPC_DRIVER = 916, + SNPE_DSP_RUNTIME_RPC_PERMISSION_ERROR = 917, + SNPE_DSP_RUNTIME_DSP_FILE_OPEN_ERROR = 918, // Model validataion errors SNPE_MODEL_VALIDATION_LAYER_NOT_SUPPORTED = 1000, @@ -196,7 +205,10 @@ enum class ZDL_EXPORT ErrorCode : uint32_t { // Infrastructure Errors SNPE_INFRA_CLUSTERMGR_INSTANCE_INVALID = 1600, - SNPE_INFRA_CLUSTERMGR_EXECUTE_SYNC_FAILED = 1601 + SNPE_INFRA_CLUSTERMGR_EXECUTE_SYNC_FAILED = 1601, + + // Memory Errors + SNPE_MEMORY_CORRUPTION_ERROR = 1700 }; diff --git a/third_party/snpe/include/DlSystem/IOBufferDataTypeMap.hpp b/third_party/snpe/include/DlSystem/IOBufferDataTypeMap.hpp new file mode 100644 index 0000000000..e36b1fbd7e --- /dev/null +++ b/third_party/snpe/include/DlSystem/IOBufferDataTypeMap.hpp @@ -0,0 +1,127 @@ +//============================================================================= +// +// Copyright (c) 2021-2022 Qualcomm Technologies, Inc. +// All Rights Reserved. +// Confidential and Proprietary - Qualcomm Technologies, Inc. +// +//============================================================================= + + +#ifndef DL_SYSTEM_IOBUFFER_DATATYPE_MAP_HPP +#define DL_SYSTEM_IOBUFFER_DATATYPE_MAP_HPP + +#include +#include +#include "DlSystem/DlEnums.hpp" + +namespace DlSystem +{ + // Forward declaration of IOBufferDataTypeMapImpl implementation. + class IOBufferDataTypeMapImpl; +} + +namespace zdl +{ +namespace DlSystem +{ +/** @addtogroup c_plus_plus_apis C++ +@{ */ + +/** + * @brief . + * + * The IoBufferDataTypeMap class definition + */ +class ZDL_EXPORT IOBufferDataTypeMap final +{ +public: + + /** + * @brief . + * + * Creates a new Buffer Data type map + * + */ + IOBufferDataTypeMap(); + + /** + * @brief Adds a name and the corresponding buffer data type + * to the map + * + * @param[name] name The name of the buffer + * @param[bufferDataType] buffer Data Type of the buffer + * + * @note If a buffer with the same name already exists, no new + * buffer is added. + */ + void add(const char* name, zdl::DlSystem::IOBufferDataType_t bufferDataType); + + /** + * @brief Removes a buffer name from the map + * + * @param[name] name The name of the buffer + * + */ + void remove(const char* name); + + /** + * @brief Returns the type of the named buffer + * + * @param[name] name The name of the buffer + * + * @return The type of the buffer, or UNSPECIFIED if the buffer does not exist + * + */ + zdl::DlSystem::IOBufferDataType_t getBufferDataType(const char* name); + + /** + * @brief Returns the type of the first buffer + * + * @return The type of the first buffer, or UNSPECIFIED if the map is empty. + * + */ + zdl::DlSystem::IOBufferDataType_t getBufferDataType(); + + /** + * @brief Returns the size of the buffer type map. + * + * @return The size of the map + * + */ + size_t size(); + + /** + * @brief Checks the existence of the named buffer in the map + * + * @return True if the named buffer exists, false otherwise. + * + */ + bool find(const char* name); + + /** + * @brief Resets the map + * + */ + void clear(); + + /** + * @brief Checks whether the map is empty + * + * @return True if the map is empty, false otherwise. + * + */ + bool empty(); + + /** + * @brief Destroys the map + * + */ + ~IOBufferDataTypeMap(); + +private: + std::shared_ptr<::DlSystem::IOBufferDataTypeMapImpl> m_IOBufferDataTypeMapImpl; +}; +} + +} +#endif diff --git a/third_party/snpe/include/DlSystem/IUDL.hpp b/third_party/snpe/include/DlSystem/IUDL.hpp index 2e9dddc48f..a171ac7e81 100644 --- a/third_party/snpe/include/DlSystem/IUDL.hpp +++ b/third_party/snpe/include/DlSystem/IUDL.hpp @@ -1,6 +1,6 @@ //============================================================================= // -// Copyright (c) 2016-2017 Qualcomm Technologies, Inc. +// Copyright (c) 2016-2021 Qualcomm Technologies, Inc. // All Rights Reserved. // Confidential and Proprietary - Qualcomm Technologies, Inc. // @@ -13,10 +13,10 @@ namespace zdl { namespace DlSystem { -/** @addtogroup c_plus_plus_apis C++ -@{ */ /** + * NOTE: DEPRECATED, MAY BE REMOVED IN THE FUTURE. + * * @brief . * * Base class user concrete UDL implementation. @@ -32,6 +32,8 @@ namespace DlSystem { class ZDL_EXPORT IUDL { public: /** + * NOTE: DEPRECATED, MAY BE REMOVED IN THE FUTURE. + * * @brief . * * Destructor @@ -39,6 +41,8 @@ public: virtual ~IUDL() = default; /** + * NOTE: DEPRECATED, MAY BE REMOVED IN THE FUTURE. + * * @brief Sets up the user's environment. * This is called by the SNPE framework to allow the user the * opportunity to setup anything which is needed for running @@ -66,6 +70,8 @@ public: size_t outsz, const size_t **outdim, const size_t *outdimsz) = 0; /** + * NOTE: DEPRECATED, MAY BE REMOVED IN THE FUTURE. + * * @brief Close the instance. Invoked by the SNPE * framework to allow the user the opportunity to release any resources * allocated during setup. @@ -75,6 +81,8 @@ public: virtual void close(void *cookie) noexcept = 0; /** + * NOTE: DEPRECATED, MAY BE REMOVED IN THE FUTURE. + * * @brief Execute the user defined layer * * @param cookie User provided opaque data returned by the SNPE @@ -89,7 +97,6 @@ public: */ virtual bool execute(void *cookie, const float **input, float **output) = 0; }; -/** @} */ /* end_addtogroup c_plus_plus_apis C++ */ } // ns DlSystem diff --git a/third_party/snpe/include/DlSystem/IUserBuffer.hpp b/third_party/snpe/include/DlSystem/IUserBuffer.hpp index 5e5731dd83..ea491a545b 100644 --- a/third_party/snpe/include/DlSystem/IUserBuffer.hpp +++ b/third_party/snpe/include/DlSystem/IUserBuffer.hpp @@ -151,101 +151,6 @@ public: * 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 */ - -class ZDL_EXPORT UserBufferEncodingTf8 : public UserBufferEncodingUnsigned8Bit { -public: - UserBufferEncodingTf8() = delete; - UserBufferEncodingTf8(unsigned char stepFor0, float stepSize) : - UserBufferEncodingUnsigned8Bit(ElementType_t::TF8), - m_StepExactly0(stepFor0), - m_QuantizedStepSize(stepSize) {}; - - UserBufferEncodingTf8(const zdl::DlSystem::UserBufferEncoding &ubEncoding) : UserBufferEncodingUnsigned8Bit(ubEncoding.getElementType()){ - const zdl::DlSystem::UserBufferEncodingTf8* ubEncodingTf8 - = dynamic_cast (&ubEncoding); - if (ubEncodingTf8) { - m_StepExactly0 = ubEncodingTf8->getStepExactly0(); - m_QuantizedStepSize = ubEncodingTf8->getQuantizedStepSize(); - } - } - -/** - * @brief Sets the step value that represents 0 - * - * @param[in] stepExactly0 The step value that represents 0 - * - */ - - void setStepExactly0(const unsigned char stepExactly0) { - m_StepExactly0 = stepExactly0; - } - - -/** - * @brief Sets the float value that each step represents - * - * @param[in] quantizedStepSize The float value of each step size - * - */ - - void setQuantizedStepSize(const float quantizedStepSize) { - m_QuantizedStepSize = quantizedStepSize; - } - - -/** - * @brief Retrieves the step that represents 0.0 - * - * @return Step value - */ - - unsigned char getStepExactly0() const { - return m_StepExactly0; - } - - -/** - * Calculates the minimum floating point value that - * can be represented with this encoding. - * - * @return Minimum representable floating point value - */ - - float getMin() const { - return m_QuantizedStepSize * (0 - m_StepExactly0); - } - - -/** - * Calculates the maximum floating point value that - * can be represented with this encoding. - * - * @return Maximum representable floating point value - */ - - float getMax() const { - return m_QuantizedStepSize * (255 - m_StepExactly0); - } - - -/** - * @brief Retrieves the step size - * - * @return Step size - */ - - float getQuantizedStepSize() const { - return m_QuantizedStepSize; - } - -private: - unsigned char m_StepExactly0; - - float m_QuantizedStepSize; -}; - - - class ZDL_EXPORT UserBufferEncodingTfN : public UserBufferEncoding { public: UserBufferEncodingTfN() = delete; @@ -327,12 +232,44 @@ public: ElementType_t getTypeFromWidth(uint8_t width); uint8_t bitWidth; -private: +protected: uint64_t m_StepExactly0; float m_QuantizedStepSize; }; +class ZDL_EXPORT UserBufferEncodingTf8 : public UserBufferEncodingTfN { +public: + UserBufferEncodingTf8() = delete; + UserBufferEncodingTf8(unsigned char stepFor0, float stepSize) : + UserBufferEncodingTfN(stepFor0, stepSize) {}; + + UserBufferEncodingTf8(const zdl::DlSystem::UserBufferEncoding &ubEncoding) : UserBufferEncodingTfN(ubEncoding){} + +/** + * @brief Sets the step value that represents 0 + * + * @param[in] stepExactly0 The step value that represents 0 + * + */ + + void setStepExactly0(const unsigned char stepExactly0) { + UserBufferEncodingTfN::m_StepExactly0 = stepExactly0; + } + +/** + * @brief Retrieves the step that represents 0.0 + * + * @return Step value + */ + + unsigned char getStepExactly0() const { + return UserBufferEncodingTfN::m_StepExactly0; + } + +}; + + /** * @brief UserBuffer contains a pointer and info on how to walk it and interpret its content. */ diff --git a/third_party/snpe/include/DlSystem/PlatformConfig.hpp b/third_party/snpe/include/DlSystem/PlatformConfig.hpp index 3f15f177e3..c7b85f43c1 100644 --- a/third_party/snpe/include/DlSystem/PlatformConfig.hpp +++ b/third_party/snpe/include/DlSystem/PlatformConfig.hpp @@ -1,6 +1,6 @@ //============================================================================= // -// Copyright (c) 2017-2018 Qualcomm Technologies, Inc. +// Copyright (c) 2017-2018,2021 Qualcomm Technologies, Inc. // All Rights Reserved. // Confidential and Proprietary - Qualcomm Technologies, Inc. // @@ -190,10 +190,37 @@ public: */ std::string getPlatformOptions() const { return m_PlatformOptions; } + /** + * @brief Sets the platform options + * + * @param[in] optionName Name of platform options" + * @param[in] value Value of specified optionName + * + * @return If true, add "optionName:value" to platform options if optionName don't exist, otherwise update the + * value of specified optionName. + * If false, the platform options will not be changed. + */ + bool setPlatformOptionValue(const std::string& optionName, const std::string& value); + + /** + * @brief Removes the platform options + * + * @param[in] optionName Name of platform options" + * @param[in] value Value of specified optionName + * + * @return If true, removed "optionName:value" to platform options if optionName don't exist, do nothing. + * If false, the platform options will not be changed. + */ + bool removePlatformOptionValue(const std::string& optionName, const std::string& value); + + static void SetIsUserGLBuffer(bool isUserGLBuffer); + static bool GetIsUserGLBuffer(); + private: PlatformType_t m_PlatformType; PlatformConfigInfo m_PlatformConfigInfo; std::string m_PlatformOptions; + static bool m_IsUserGLBuffer; }; /** @} */ /* end_addtogroup c_plus_plus_apis C++ */ diff --git a/third_party/snpe/include/DlSystem/UDLContext.hpp b/third_party/snpe/include/DlSystem/UDLContext.hpp index 6b7c07d3eb..21fce1b04a 100644 --- a/third_party/snpe/include/DlSystem/UDLContext.hpp +++ b/third_party/snpe/include/DlSystem/UDLContext.hpp @@ -1,6 +1,6 @@ //============================================================================== // -// Copyright (c) 2016 Qualcomm Technologies, Inc. +// Copyright (c) 2016-2021 Qualcomm Technologies, Inc. // All Rights Reserved. // Confidential and Proprietary - Qualcomm Technologies, Inc. // @@ -15,10 +15,10 @@ #include "ZdlExportDefine.hpp" namespace zdl { namespace DlSystem { -/** @addtogroup c_plus_plus_apis C++ -@{ */ /** + * NOTE: DEPRECATED, MAY BE REMOVED IN THE FUTURE. + * * @brief . * * UDLContext holds the user defined layer context which @@ -237,7 +237,6 @@ private: size_t m_Size = 0; int32_t m_Id = -1; }; -/** @} */ /* end_addtogroup c_plus_plus_apis C++ */ }} diff --git a/third_party/snpe/include/DlSystem/UDLFunc.hpp b/third_party/snpe/include/DlSystem/UDLFunc.hpp index 633ce985bf..6a95eef170 100644 --- a/third_party/snpe/include/DlSystem/UDLFunc.hpp +++ b/third_party/snpe/include/DlSystem/UDLFunc.hpp @@ -1,6 +1,6 @@ //============================================================================== // -// Copyright (c) 2015 Qualcomm Technologies, Inc. +// Copyright (c) 2015-2021 Qualcomm Technologies, Inc. // All Rights Reserved. // Confidential and Proprietary - Qualcomm Technologies, Inc. // @@ -21,9 +21,9 @@ namespace zdl { } namespace zdl { namespace DlSystem { -/** @addtogroup c_plus_plus_apis C++ -@{ */ /** + * NOTE: DEPRECATED, MAY BE REMOVED IN THE FUTURE. + * * @brief . * * Definition of UDLFactoyFunc, using/typedef and default FactoryFunction @@ -47,6 +47,8 @@ namespace zdl { namespace DlSystem { using UDLFactoryFunc = std::function; /** + * NOTE: DEPRECATED, MAY BE REMOVED IN THE FUTURE. + * * @brief . * * default UDL factory implementation @@ -65,6 +67,8 @@ using UDLFactoryFunc = std::function +#include "ZdlExportDefine.hpp" +#include "StringList.hpp" + +#ifndef DL_SYSTEM_USER_MEMORY_MAP_HPP +#define DL_SYSTEM_USER_MEMORY_MAP_HPP + +namespace DlSystem +{ + // Forward declaration of UserMemory map implementation. + class UserMemoryMapImpl; +} + +namespace zdl +{ +namespace DlSystem +{ +class IUserBuffer; + +/** @addtogroup c_plus_plus_apis C++ +@{ */ + +/** + * @brief . + * + * A class representing the map of UserMemory. + */ +class ZDL_EXPORT UserMemoryMap final +{ +public: + + /** + * @brief . + * + * Creates a new empty UserMemory map + */ + UserMemoryMap(); + + /** + * copy constructor. + * @param[in] other object to copy. + */ + UserMemoryMap(const UserMemoryMap& other); + + /** + * assignment operator. + */ + UserMemoryMap& operator=(const UserMemoryMap& other); + + /** + * @brief Adds a name and the corresponding buffer address + * to the map + * + * @param[in] name The name of the UserMemory + * @param[in] address The pointer to the Buffer Memory + * + * @note If a UserBuffer with the same name already exists, the new + * address would be updated. + */ + void add(const char *name, void *address); + + /** + * @brief Removes a mapping of one Buffer address and its name by its name + * + * @param[in] name The name of Memory address to be removed + * + * @note If no UserBuffer with the specified name is found, nothing + * is done. + */ + void remove(const char *name) noexcept; + + /** + * @brief Returns the number of User Memory addresses in the map + */ + size_t size() const noexcept; + + /** + * @brief . + * + * Removes all User Memory from the map + */ + void clear() noexcept; + + /** + * @brief . + * + * Returns the names of all User Memory + * + * @return A list of Buffer names. + */ + zdl::DlSystem::StringList getUserBufferNames() const; + + /** + * @brief Returns the no of UserMemory addresses mapped to the buffer + * + * @param[in] name The name of the UserMemory + * + */ + size_t getUserMemoryAddressCount(const char *name) const noexcept; + + /** + * @brief Returns address at a specified index corresponding to a UserMemory buffer name + * + * @param[in] name The name of the buffer + * @param[in] index The index in the list of addresses + * + */ + void* getUserMemoryAddressAtIndex(const char *name, uint32_t index) const noexcept; + + ~UserMemoryMap(); +private: + void swap(const UserMemoryMap &other); + std::unique_ptr<::DlSystem::UserMemoryMapImpl> m_UserMemoryMapImpl; +}; +/** @} */ /* end_addtogroup c_plus_plus_apis C++ */ + +} // DlSystem namespace +} // zdl namespace + + +#endif // DL_SYSTEM_TENSOR_MAP_HPP + diff --git a/third_party/snpe/include/PlatformValidator/PlatformValidator.hpp b/third_party/snpe/include/PlatformValidator/PlatformValidator.hpp index e74278ead7..66097ba569 100644 --- a/third_party/snpe/include/PlatformValidator/PlatformValidator.hpp +++ b/third_party/snpe/include/PlatformValidator/PlatformValidator.hpp @@ -1,6 +1,6 @@ // ============================================================================= // -// Copyright (c) 2018-2019 Qualcomm Technologies, Inc. +// Copyright (c) 2018-2020 Qualcomm Technologies, Inc. // All Rights Reserved. // Confidential and Proprietary - Qualcomm Technologies, Inc. // @@ -10,7 +10,32 @@ #define SNPE_PLATFORMVALIDATOR_HPP #include "DlSystem/DlEnums.hpp" -#include "DlSystem/DlMacros.hpp" +#include "DlSystem/ZdlExportDefine.hpp" + +#define DO_PRAGMA(s) _Pragma(#s) +#define NO_WARNING "-Wunused-variable" + +#ifdef __clang__ +#define SNPE_DISABLE_WARNINGS(clang_warning,gcc_warning) \ +_Pragma("clang diagnostic push") \ +DO_PRAGMA(clang diagnostic ignored clang_warning) + +#define SNPE_ENABLE_WARNINGS \ +_Pragma("clang diagnostic pop") + +#elif defined __GNUC__ +#define SNPE_DISABLE_WARNINGS(clang_warning,gcc_warning) \ +_Pragma("GCC diagnostic push") \ +DO_PRAGMA(GCC diagnostic ignored gcc_warning) + +#define SNPE_ENABLE_WARNINGS \ +_Pragma("GCC diagnostic pop") + +#else +#define SNPE_DISABLE_WARNINGS(...) +#define SNPE_ENABLE_WARNINGS +#endif + SNPE_DISABLE_WARNINGS("-Wdelete-non-virtual-dtor","-Wdelete-non-virtual-dtor") #include #include @@ -34,7 +59,7 @@ namespace zdl * */ -class zdl::SNPE::PlatformValidator +class ZDL_EXPORT zdl::SNPE::PlatformValidator { public: /** diff --git a/third_party/snpe/include/SNPE/PSNPE.hpp b/third_party/snpe/include/SNPE/PSNPE.hpp index c0a6fb55d6..a823c0c7fa 100644 --- a/third_party/snpe/include/SNPE/PSNPE.hpp +++ b/third_party/snpe/include/SNPE/PSNPE.hpp @@ -1,6 +1,6 @@ // ============================================================================= // -// Copyright (c) 2019-2020 Qualcomm Technologies, Inc. +// Copyright (c) 2019-2021 Qualcomm Technologies, Inc. // All Rights Reserved. // Confidential and Proprietary - Qualcomm Technologies, Inc. // @@ -54,8 +54,9 @@ struct ZDL_EXPORT OutputAsyncCallbackParam { size_t dataIndex; bool executeStatus; - OutputAsyncCallbackParam(size_t _index,bool _status) - : dataIndex(_index),executeStatus(_status){}; + std::string errorMsg; + OutputAsyncCallbackParam(size_t _index,bool _status, const std::string& _errorMsg = std::string()) + : dataIndex(_index),executeStatus(_status), errorMsg(_errorMsg){}; }; /** * @brief A structure representing parameters of callback function of Async Input/Output mode @@ -65,12 +66,13 @@ struct ZDL_EXPORT InputOutputAsyncCallbackParam size_t dataIndex; const ApplicationBufferMap& outputMap; bool executeStatus; - InputOutputAsyncCallbackParam(size_t _index, const ApplicationBufferMap& output_map,bool _status) + std::string errorMsg; + InputOutputAsyncCallbackParam(size_t _index, const ApplicationBufferMap& output_map,bool _status, + const std::string _ErrorMsg = std::string()) : dataIndex(_index) , outputMap(output_map) - ,executeStatus(_status){ - - }; + , executeStatus(_status) + , errorMsg(_ErrorMsg){}; }; /** * @brief This callback is called when the output data is ready, only use for Output Async mode @@ -96,6 +98,7 @@ struct ZDL_EXPORT BuildConfig final BuildMode buildMode = BuildMode::SERIAL; ///< Specify build in serial mode or parallel mode zdl::DlContainer::IDlContainer* container;///< The opened container ptr zdl::DlSystem::StringList outputBufferNames;///< Specify the output layer name + zdl::DlSystem::StringList outputTensors;///< Specify the output layer name RuntimeConfigList runtimeConfigList;///< The runtime config list for PSNPE, @see RuntimeConfig size_t inputThreadNumbers = 1;///< Specify the number of threads used in the execution phase to process input data, only used in inputOutputAsync mode size_t outputThreadNumbers = 1;///< Specify the number of threads used in the execution phase to process output data, only used in inputOutputAsync and outputAsync mode @@ -106,6 +109,8 @@ struct ZDL_EXPORT BuildConfig final zdl::DlSystem::ProfilingLevel_t profilingLevel = zdl::DlSystem::ProfilingLevel_t::OFF;///< Specify profiling level for Diaglog uint64_t encode[2] = {0, 0}; bool enableInitCache = false; + std::string platformOptions; + std::string diaglogOutputDir = "./diaglogs/"; ///< Specify a diaglog output directory to save the generated Diaglog files. }; /** * @brief . @@ -170,6 +175,8 @@ class ZDL_EXPORT PSNPE final */ const zdl::DlSystem::TensorShape getInputDimensions() const noexcept; + const zdl::DlSystem::TensorShape getInputDimensions(const char *name) const noexcept; + /** * @brief Returns attributes of buffers. * @@ -180,6 +187,10 @@ class ZDL_EXPORT PSNPE final const zdl::DlSystem::TensorShape getBufferAttributesDims(const char *name) const noexcept; zdl::DlSystem::Optional getInputOutputBufferAttributes(const char *name) const noexcept; + bool registerIonBuffers(const zdl::DlSystem::UserMemoryMap& ionBufferMap) const noexcept; + bool deregisterIonBuffers(const zdl::DlSystem::StringList& ionBufferNames) const noexcept; + + const char* getLastErrorString(); private: PSNPE(const PSNPE&) = delete; diff --git a/third_party/snpe/include/SNPE/SNPE.hpp b/third_party/snpe/include/SNPE/SNPE.hpp index 239690ab2c..5ab45b82ee 100644 --- a/third_party/snpe/include/SNPE/SNPE.hpp +++ b/third_party/snpe/include/SNPE/SNPE.hpp @@ -1,6 +1,6 @@ //============================================================================== // -// Copyright (c) 2015-2020 Qualcomm Technologies, Inc. +// Copyright (c) 2015-2021 Qualcomm Technologies, Inc. // All Rights Reserved. // Confidential and Proprietary - Qualcomm Technologies, Inc. // @@ -19,6 +19,7 @@ #include "DlSystem/StringList.hpp" #include "DlSystem/IUserBuffer.hpp" #include "DlSystem/UserBufferMap.hpp" +#include "DlSystem/UserMemoryMap.hpp" #include "DlSystem/ZdlExportDefine.hpp" namespace zdl { @@ -147,6 +148,21 @@ public: bool execute(const zdl::DlSystem::UserBufferMap &input, const zdl::DlSystem::UserBufferMap &output) noexcept; + + /** + * @brief Regiter Client ION Buffers + * @param[in] A UserMemoryMap of virtual addresses + * + */ + bool registerIonBuffers(const zdl::DlSystem::UserMemoryMap& ionBufferMap) noexcept; + + /** + * @brief Regiter Client ION Buffers + * @param[in] A StringList of ION Buffer names + * + */ + bool deregisterIonBuffers(const zdl::DlSystem::StringList& ionBufferNames) noexcept; + /** * @brief Returns the version string embedded at model conversion * time. @@ -215,8 +231,6 @@ public: */ zdl::DlSystem::Optional getInputOutputBufferAttributes(const char *name) const noexcept; - zdl::DlSystem::Optional getInputOutputBufferAttributesTf8(const char *name) const noexcept; - /** * @brief . * diff --git a/third_party/snpe/include/SNPE/SNPEBuilder.hpp b/third_party/snpe/include/SNPE/SNPEBuilder.hpp index f314d88bcf..5fc7846ced 100644 --- a/third_party/snpe/include/SNPE/SNPEBuilder.hpp +++ b/third_party/snpe/include/SNPE/SNPEBuilder.hpp @@ -1,6 +1,6 @@ //============================================================================== // -// Copyright (c) 2017-2019 Qualcomm Technologies, Inc. +// Copyright (c) 2017-2021 Qualcomm Technologies, Inc. // All Rights Reserved. // Confidential and Proprietary - Qualcomm Technologies, Inc. // @@ -15,6 +15,7 @@ #include "DlSystem/DlOptional.hpp" #include "DlSystem/TensorShapeMap.hpp" #include "DlSystem/PlatformConfig.hpp" +#include "DlSystem/IOBufferDataTypeMap.hpp" #include "DlSystem/RuntimeList.hpp" namespace zdl { @@ -275,6 +276,28 @@ public: SNPEBuilder& setUnconsumedTensorsAsOutputs( bool setOutput); + /** + * @brief Execution terminated when exceeding time limit. + * Only valid for dsp runtime currently. + * + * @param[in] timeout Time limit value + * + * @return The current instance of SNPEBuilder. + */ + SNPEBuilder& setTimeOut( + uint64_t timeout); + + + /** + * @brief Sets the datatype of the buffer. + * Only valid for dsp runtime currently. + * + * @param[in] Map of the buffer names and the datatype that needs to be set. + * + * @return The current instance of SNPEBuilder. + */ + SNPEBuilder& setBufferDataType(const zdl::DlSystem::IOBufferDataTypeMap& dataTypeMap); + }; /** @} */ /* end_addtogroup c_plus_plus_apis C++ */ diff --git a/third_party/snpe/include/SNPE/SNPEFactory.hpp b/third_party/snpe/include/SNPE/SNPEFactory.hpp index 7bef45d877..2d78e81b17 100644 --- a/third_party/snpe/include/SNPE/SNPEFactory.hpp +++ b/third_party/snpe/include/SNPE/SNPEFactory.hpp @@ -1,6 +1,6 @@ //============================================================================== // -// Copyright (c) 2015-2020 Qualcomm Technologies, Inc. +// Copyright (c) 2015-2021 Qualcomm Technologies, Inc. // All Rights Reserved. // Confidential and Proprietary - Qualcomm Technologies, Inc. // @@ -47,8 +47,6 @@ public: * * @param[in] runtime The target runtime to check. * - * @param[in] option Extent to perform runtime available check. - * * @return True if the supplied runtime is available; false, * otherwise. */ @@ -122,6 +120,97 @@ public: * otherwise. */ static bool isGLCLInteropSupported(); + + static const char* getLastError(); + + /** + * 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. + * + * @param[in] LogLevel_t Log level (LOG_INFO, LOG_WARN, etc.). + * + * @return True if successful, False otherwise. + */ + static bool initializeLogging(const zdl::DlSystem::LogLevel_t& level); + + /** + * 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 + * + * @param[in] LogLevel_t Log level (LOG_INFO, LOG_WARN, etc.). + * + * @param[in] Path of directory to store logs. + * If path is empty, the default path is "./Log". + * For android, the log path is ignored. + * + * @return True if successful, False otherwise. + */ + static bool initializeLogging(const zdl::DlSystem::LogLevel_t& level, const std::string& logPath); + + /** + * 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() + * + * @param[in] LogLevel_t Log level (LOG_INFO, LOG_WARN, etc.). + * + * @return True if successful, False otherwise. + */ + static bool setLogLevel(const zdl::DlSystem::LogLevel_t& level); + + /** + * 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. + * + * @return True if successful, False otherwise. + */ + static bool terminateLogging(void); }; /** @} */ /* end_addtogroup c_plus_plus_apis C++ */ diff --git a/third_party/snpe/include/SnpeUdo/UdoBase.h b/third_party/snpe/include/SnpeUdo/UdoBase.h index be370e1ac5..7b2567920e 100644 --- a/third_party/snpe/include/SnpeUdo/UdoBase.h +++ b/third_party/snpe/include/SnpeUdo/UdoBase.h @@ -1,6 +1,6 @@ //============================================================================== // -// Copyright (c) 2019-2020 Qualcomm Technologies, Inc. +// Copyright (c) 2019-2021 Qualcomm Technologies, Inc. // All Rights Reserved. // Confidential and Proprietary - Qualcomm Technologies, Inc. // @@ -13,7 +13,7 @@ // Provide values to use for API version. #define API_VERSION_MAJOR 1 -#define API_VERSION_MINOR 5 +#define API_VERSION_MINOR 6 #define API_VERSION_TEENY 0 /** @addtogroup c_plus_plus_apis C++ @@ -21,10 +21,12 @@ // Defines a bitmask of enum values. typedef uint32_t SnpeUdo_Bitmask_t; +typedef SnpeUdo_Bitmask_t Udo_Bitmask_t; // A string of characters, rather than an array of bytes. // Assumed to be UTF-8. typedef char* SnpeUdo_String_t; +typedef SnpeUdo_String_t Udo_String_t; // The maximum allowable length of a SnpeUdo_String_t in bytes, // including null terminator. SNPE will truncate strings longer @@ -41,32 +43,34 @@ typedef char* SnpeUdo_String_t; typedef enum { /// No Error - SNPE_UDO_NO_ERROR = 0, + SNPE_UDO_NO_ERROR = 0, UDO_NO_ERROR = 0, /// Unsupported value for core type - SNPE_UDO_WRONG_CORE = 1, + SNPE_UDO_WRONG_CORE = 1, UDO_WRONG_CORE = 1, /// Invalid attribute/argument passed into UDO API - SNPE_UDO_INVALID_ARGUMENT = 2, + SNPE_UDO_INVALID_ARGUMENT = 2, UDO_INVALID_ARGUMENT = 2, /// Unsupported feature error - SNPE_UDO_UNSUPPORTED_FEATURE = 3, + SNPE_UDO_UNSUPPORTED_FEATURE = 3, UDO_UNSUPPORTED_FEATURE = 3, /// Error relating to memory allocation - SNPE_UDO_MEM_ALLOC_ERROR = 4, + SNPE_UDO_MEM_ALLOC_ERROR = 4, UDO_MEM_ALLOC_ERROR = 4, /* Configuration Specific errors */ /// No op with given attributes available in library - SNPE_UDO_WRONG_OPERATION = 100, + SNPE_UDO_WRONG_OPERATION = 100, UDO_WRONG_OPERATION = 100, /// Unsupported value for core type in UDO configuration - SNPE_UDO_WRONG_CORE_TYPE = 101, + SNPE_UDO_WRONG_CORE_TYPE = 101, UDO_WRONG_CORE_TYPE = 101, /// Wrong number of params in UDO definition - SNPE_UDO_WRONG_NUM_OF_PARAMS = 102, + SNPE_UDO_WRONG_NUM_OF_PARAMS = 102, UDO_WRONG_NUM_OF_PARAMS = 102, /// Wrong number of dimensions for tensor(s) in UDO definition - SNPE_UDO_WRONG_NUM_OF_DIMENSIONS = 103, + SNPE_UDO_WRONG_NUM_OF_DIMENSIONS = 103, UDO_WRONG_NUM_OF_DIMENSIONS = 103, /// Wrong number of input tensors in UDO definition - SNPE_UDO_WRONG_NUM_OF_INPUTS = 104, + SNPE_UDO_WRONG_NUM_OF_INPUTS = 104, UDO_WRONG_NUM_OF_INPUTS = 104, /// Wrong number of output tensors in UDO definition - SNPE_UDO_WRONG_NUM_OF_OUTPUTS = 105, - SNPE_UDO_PROGRAM_CACHE_NOT_FOUND = 106, - SNPE_UDO_UNKNOWN_ERROR = 0xFFFFFFFF + SNPE_UDO_WRONG_NUM_OF_OUTPUTS = 105, UDO_WRONG_NUM_OF_OUTPUTS = 105, + SNPE_UDO_PROGRAM_CACHE_NOT_FOUND = 106, UDO_PROGRAM_CACHE_NOT_FOUND = 106, + SNPE_UDO_UNKNOWN_ERROR = 0xFFFFFFFF, UDO_UNKNOWN_ERROR = 0xFFFFFFFF } SnpeUdo_ErrorType_t; +typedef SnpeUdo_ErrorType_t Udo_ErrorType_t; + /** * An enum which holds the various data types. * Designed to be used as single values or combined into a bitfield parameter @@ -77,32 +81,34 @@ typedef enum typedef enum { /// data type: 16-bit floating point - SNPE_UDO_DATATYPE_FLOAT_16 = 0x01, + SNPE_UDO_DATATYPE_FLOAT_16 = 0x01, UDO_DATATYPE_FLOAT_16 = 0x01, /// data type: 32-bit floating point - SNPE_UDO_DATATYPE_FLOAT_32 = 0x02, + SNPE_UDO_DATATYPE_FLOAT_32 = 0x02, UDO_DATATYPE_FLOAT_32 = 0x02, /// data type: 4-bit fixed point - SNPE_UDO_DATATYPE_FIXED_4 = 0x04, + SNPE_UDO_DATATYPE_FIXED_4 = 0x04, UDO_DATATYPE_FIXED_4 = 0x04, /// data type: 8-bit fixed point - SNPE_UDO_DATATYPE_FIXED_8 = 0x08, + SNPE_UDO_DATATYPE_FIXED_8 = 0x08, UDO_DATATYPE_FIXED_8 = 0x08, /// data type: 16-bit fixed point - SNPE_UDO_DATATYPE_FIXED_16 = 0x10, + SNPE_UDO_DATATYPE_FIXED_16 = 0x10, UDO_DATATYPE_FIXED_16 = 0x10, /// data type: 32-bit fixed point - SNPE_UDO_DATATYPE_FIXED_32 = 0x20, + SNPE_UDO_DATATYPE_FIXED_32 = 0x20, UDO_DATATYPE_FIXED_32 = 0x20, /// data type: 8-bit unsigned integer - SNPE_UDO_DATATYPE_UINT_8 = 0x100, + SNPE_UDO_DATATYPE_UINT_8 = 0x100, UDO_DATATYPE_UINT_8 = 0x100, /// data type: 16-bit unsigned integer - SNPE_UDO_DATATYPE_UINT_16 = 0x200, + SNPE_UDO_DATATYPE_UINT_16 = 0x200, UDO_DATATYPE_UINT_16 = 0x200, /// data type: 32-bit unsigned integer - SNPE_UDO_DATATYPE_UINT_32 = 0x400, + SNPE_UDO_DATATYPE_UINT_32 = 0x400, UDO_DATATYPE_UINT_32 = 0x400, /// data type: 8-bit signed integer - SNPE_UDO_DATATYPE_INT_8 = 0x1000, + SNPE_UDO_DATATYPE_INT_8 = 0x1000, UDO_DATATYPE_INT_8 = 0x1000, /// data type: 16-bit signed integer - SNPE_UDO_DATATYPE_INT_16 = 0x2000, + SNPE_UDO_DATATYPE_INT_16 = 0x2000, UDO_DATATYPE_INT_16 = 0x2000, /// data type: 32-bit signed integer - SNPE_UDO_DATATYPE_INT_32 = 0x4000, - SNPE_UDO_DATATYPE_LAST = 0xFFFFFFFF + SNPE_UDO_DATATYPE_INT_32 = 0x4000, UDO_DATATYPE_INT_32 = 0x4000, + SNPE_UDO_DATATYPE_LAST = 0xFFFFFFFF, UDO_DATATYPE_LAST = 0xFFFFFFFF } SnpeUdo_DataType_t; +typedef SnpeUdo_DataType_t Udo_DataType_t; + /** * An enum which holds the various layouts. * Designed to be used as single values or combined into a bitfield parameter @@ -111,21 +117,23 @@ typedef enum typedef enum { /// data layout (4D): NHWC (batch-height-width-channel) - SNPE_UDO_LAYOUT_NHWC = 0x01, + SNPE_UDO_LAYOUT_NHWC = 0x01, UDO_LAYOUT_NHWC = 0x01, /// data layout (4D): NCHW (batch-channel-height-width) - SNPE_UDO_LAYOUT_NCHW = 0x02, + SNPE_UDO_LAYOUT_NCHW = 0x02, UDO_LAYOUT_NCHW = 0x02, /// data layout (5D): NDHWC (batch-dimension-height-width-channel) - SNPE_UDO_LAYOUT_NDHWC = 0x04, - SNPE_UDO_LAYOUT_GPU_OPTIMAL1 = 0x08, - SNPE_UDO_LAYOUT_GPU_OPTIMAL2 = 0x10, - SNPE_UDO_LAYOUT_DSP_OPTIMAL1 = 0x11, - SNPE_UDO_LAYOUT_DSP_OPTIMAL2 = 0x12, + SNPE_UDO_LAYOUT_NDHWC = 0x04, UDO_LAYOUT_NDHWC = 0x04, + SNPE_UDO_LAYOUT_GPU_OPTIMAL1 = 0x08, UDO_LAYOUT_GPU_OPTIMAL1 = 0x08, + SNPE_UDO_LAYOUT_GPU_OPTIMAL2 = 0x10, UDO_LAYOUT_GPU_OPTIMAL2 = 0x10, + SNPE_UDO_LAYOUT_DSP_OPTIMAL1 = 0x11, UDO_LAYOUT_DSP_OPTIMAL1 = 0x11, + SNPE_UDO_LAYOUT_DSP_OPTIMAL2 = 0x12, UDO_LAYOUT_DSP_OPTIMAL2 = 0x12, // Indicates no data will be allocated for this tensor. // Used to specify optional inputs/outputs positionally. - SNPE_UDO_LAYOUT_NULL = 0x13, - SNPE_UDO_LAYOUT_LAST = 0xFFFFFFFF + SNPE_UDO_LAYOUT_NULL = 0x13, UDO_LAYOUT_NULL = 0x13, + SNPE_UDO_LAYOUT_LAST = 0xFFFFFFFF, UDO_LAYOUT_LAST = 0xFFFFFFFF } SnpeUdo_TensorLayout_t; +typedef SnpeUdo_TensorLayout_t Udo_TensorLayout_t; + /** * An enum which holds the UDO library Core type . * Designed to be used as single values or combined into a bitfield parameter @@ -134,43 +142,49 @@ typedef enum typedef enum { /// Library target IP Core is undefined - SNPE_UDO_CORETYPE_UNDEFINED = 0x00, + SNPE_UDO_CORETYPE_UNDEFINED = 0x00, UDO_CORETYPE_UNDEFINED = 0x00, /// Library target IP Core is CPU - SNPE_UDO_CORETYPE_CPU = 0x01, + SNPE_UDO_CORETYPE_CPU = 0x01, UDO_CORETYPE_CPU = 0x01, /// Library target IP Core is GPU - SNPE_UDO_CORETYPE_GPU = 0x02, + SNPE_UDO_CORETYPE_GPU = 0x02, UDO_CORETYPE_GPU = 0x02, /// Library target IP Core is DSP - SNPE_UDO_CORETYPE_DSP = 0x04, - SNPE_UDO_CORETYPE_LAST = 0xFFFFFFFF + SNPE_UDO_CORETYPE_DSP = 0x04, UDO_CORETYPE_DSP = 0x04, + SNPE_UDO_CORETYPE_LAST = 0xFFFFFFFF, UDO_CORETYPE_LAST = 0xFFFFFFFF } SnpeUdo_CoreType_t; +typedef SnpeUdo_CoreType_t Udo_CoreType_t; + /** * An enum to specify the parameter type : Scalar or Tensor */ typedef enum { /// UDO static param type: scalar - SNPE_UDO_PARAMTYPE_SCALAR, + SNPE_UDO_PARAMTYPE_SCALAR = 0x00, UDO_PARAMTYPE_SCALAR = 0x00, /// UDO static param type: string - SNPE_UDO_PARAMTYPE_STRING, + SNPE_UDO_PARAMTYPE_STRING = 0x01, UDO_PARAMTYPE_STRING = 0x01, /// UDO static param type: tensor - SNPE_UDO_PARAMTYPE_TENSOR, - SNPE_UDO_PARAMTYPE_LAST = 0xFFFFFFFF + SNPE_UDO_PARAMTYPE_TENSOR = 0x02, UDO_PARAMTYPE_TENSOR = 0x02, + SNPE_UDO_PARAMTYPE_LAST = 0xFFFFFFFF, UDO_PARAMTYPE_LAST = 0xFFFFFFFF } SnpeUdo_ParamType_t; +typedef SnpeUdo_ParamType_t Udo_ParamType_t; + /** * An enum to specify quantization type */ typedef enum { /// Tensor Quantization type: NONE. Signifies unquantized tensor data - SNPE_UDO_QUANTIZATION_NONE, + SNPE_UDO_QUANTIZATION_NONE = 0x00, UDO_QUANTIZATION_NONE = 0x00, /// Tensor Quantization type: Tensorflow-style - SNPE_UDO_QUANTIZATION_TF, - SNPE_UDO_QUANTIZATION_QMN, - SNPE_UDO_QUANTIZATION_LAST = 0xFFFFFFFF + SNPE_UDO_QUANTIZATION_TF = 0x01, UDO_QUANTIZATION_TF = 0x01, + SNPE_UDO_QUANTIZATION_QMN = 0x02, UDO_QUANTIZATION_QMN = 0x02, + SNPE_UDO_QUANTIZATION_LAST = 0xFFFFFFFF, UDO_QUANTIZATION_LAST = 0xFFFFFFFF } SnpeUdo_QuantizationType_t; +typedef SnpeUdo_QuantizationType_t Udo_QuantizationType_t; + /** * @brief A struct which is used to provide a version number using 3 values : major, minor, teeny * @@ -185,6 +199,8 @@ typedef struct uint32_t teeny; } SnpeUdo_Version_t; +typedef SnpeUdo_Version_t Udo_Version_t; + /** * @brief A struct returned from version query, contains the Library version and API version * @@ -197,6 +213,16 @@ typedef struct SnpeUdo_Version_t apiVersion; } SnpeUdo_LibVersion_t; +/** + * @brief A struct returned from version query, contains the package version + * + */ +typedef struct +{ + /// Version of UDO API used in package. + Udo_Version_t apiVersion; +} Udo_PkgVersion_t; + /** * @brief A union to hold the value of a generic type. Allows defining a parameter struct * in a generic way, with a "value" location that holds the data regardless of the type. @@ -220,6 +246,8 @@ typedef union int8_t int8Value; } SnpeUdo_Value_t; +typedef SnpeUdo_Value_t Udo_Value_t; + /** * @brief A struct which defines a scalar parameter : name, data type, and union of values * @@ -232,6 +260,8 @@ typedef struct SnpeUdo_Value_t dataValue; } SnpeUdo_ScalarParam_t; +typedef SnpeUdo_ScalarParam_t Udo_ScalarParam_t; + /** * @brief A struct which defines the quantization parameters in case of Tensorflow style quantization * @@ -244,6 +274,8 @@ typedef struct float maxValue; } SnpeUdo_TFQuantize_t; +typedef SnpeUdo_TFQuantize_t Udo_TFQuantize_t; + /** * @brief A struct which defines the quantization type, and union of supported quantization structs * @@ -259,6 +291,8 @@ typedef struct }; } SnpeUdo_QuantizeParams_t; +typedef SnpeUdo_QuantizeParams_t Udo_QuantizeParams_t; + /** * @brief A struct which defines the datatype associated with a specified core-type * This should be used to denote the datatypes for a single tensor info, depending @@ -273,6 +307,8 @@ typedef struct SnpeUdo_DataType_t dataType; } SnpeUdo_PerCoreDatatype_t; +typedef SnpeUdo_PerCoreDatatype_t Udo_PerCoreDatatype_t; + /** * @brief A struct which defines a tensor parameter : name, data type, layout, quantization, more. * Also holds a pointer to the tensor data. @@ -303,6 +339,8 @@ typedef struct void* tensorData; } SnpeUdo_TensorParam_t; +typedef SnpeUdo_TensorParam_t Udo_TensorParam_t; + /** * @brief A struct which defines tensor information for activation tensors only * @@ -321,9 +359,11 @@ typedef struct SnpeUdo_PerCoreDatatype_t* perCoreDatatype; /// A boolean field indicating that this tensorinfo will be repeated e.x for ops such as Concat or Split bool repeated; - + /// A boolean field indicating whether input is static or not. + bool isStatic; } SnpeUdo_TensorInfo_t; +typedef SnpeUdo_TensorInfo_t Udo_TensorInfo_t; /** * @brief struct which defines a UDO parameter - a union of scalar, tensor and string parameters @@ -346,6 +386,8 @@ typedef struct }; } SnpeUdo_Param_t; +typedef SnpeUdo_Param_t Udo_Param_t; + /** * @brief A struct which defines Operation information which is specific for IP core (CPU, GPU, DSP ...) * @@ -359,6 +401,8 @@ typedef struct SnpeUdo_Bitmask_t operationCalculationTypes; } SnpeUdo_OpCoreInfo_t; +typedef SnpeUdo_OpCoreInfo_t Udo_OpCoreInfo_t; + /** * @brief A struct which defines the common and core-specific Operation information * @@ -392,6 +436,8 @@ typedef struct SnpeUdo_TensorInfo_t* outputInfos; } SnpeUdo_OperationInfo_t; +typedef SnpeUdo_OperationInfo_t Udo_OperationInfo_t; + /** * @brief A struct which provides the implementation library info : type, name * @@ -404,6 +450,8 @@ typedef struct SnpeUdo_String_t libraryName; } SnpeUdo_LibraryInfo_t; +typedef SnpeUdo_LibraryInfo_t Udo_LibraryInfo_t; + /** * @brief A struct returned by the registration library and contains information on the UDO package : * name, operations, libraries, etc. @@ -429,6 +477,8 @@ typedef struct SnpeUdo_OperationInfo_t* operationsInfo; } SnpeUdo_RegInfo_t; +typedef SnpeUdo_RegInfo_t Udo_RegInfo_t; + /** * @brief A struct returned by the implementation library and contains information on the * specific library: name, IP Core, operations, etc. @@ -446,6 +496,8 @@ typedef struct uint32_t numOfOperations; } SnpeUdo_ImpInfo_t; +typedef SnpeUdo_ImpInfo_t Udo_ImpInfo_t; + /** * @brief This struct defines an operation. It is used for validation * or creation of an operation. @@ -478,6 +530,8 @@ typedef struct SnpeUdo_TensorParam_t* outputs; } SnpeUdo_OpDefinition_t; +typedef SnpeUdo_OpDefinition_t Udo_OpDefinition_t; + /** @} */ /* end_addtogroup c_plus_plus_apis C++ */ #endif //SNPE_UDO_BASE_H diff --git a/third_party/snpe/include/SnpeUdo/UdoImpl.h b/third_party/snpe/include/SnpeUdo/UdoImpl.h index bd29bc251d..a0cb648cf7 100644 --- a/third_party/snpe/include/SnpeUdo/UdoImpl.h +++ b/third_party/snpe/include/SnpeUdo/UdoImpl.h @@ -1,6 +1,6 @@ //============================================================================== // -// Copyright (c) 2019-2020 Qualcomm Technologies, Inc. +// Copyright (c) 2019-2021 Qualcomm Technologies, Inc. // All Rights Reserved. // Confidential and Proprietary - Qualcomm Technologies, Inc. // @@ -24,6 +24,9 @@ extern "C" typedef struct _SnpeUdo_OpFactory_t* SnpeUdo_OpFactory_t; typedef struct _SnpeUdo_Operation_t* SnpeUdo_Operation_t; +typedef SnpeUdo_OpFactory_t Udo_OpFactory_t; +typedef SnpeUdo_Operation_t Udo_Operation_t; + /** * @brief Initialize the shared library's data structures. Calling any other * library function before this one will result in error. @@ -92,6 +95,8 @@ SnpeUdo_getImpInfo(SnpeUdo_ImpInfo_t** implementationInfo); typedef SnpeUdo_ErrorType_t (*SnpeUdo_GetImpInfoFunction_t)(SnpeUdo_ImpInfo_t** implementationInfo); +typedef SnpeUdo_GetImpInfoFunction_t Udo_GetImpInfoFunction_t; + /** * @brief A function to create an operation factory. * The function receives the operation type, and an array of static parameters, @@ -130,6 +135,7 @@ typedef SnpeUdo_ErrorType_t SnpeUdo_Param_t*, SnpeUdo_OpFactory_t*); +typedef SnpeUdo_CreateOpFactoryFunction_t Udo_CreateOpFactoryFunction_t; /** * @brief A function to release the resources allocated for an operation factory @@ -145,6 +151,8 @@ SnpeUdo_releaseOpFactory(SnpeUdo_OpFactory_t opFactory); typedef SnpeUdo_ErrorType_t (*SnpeUdo_ReleaseOpFactoryFunction_t)(SnpeUdo_OpFactory_t); +typedef SnpeUdo_ReleaseOpFactoryFunction_t Udo_ReleaseOpFactoryFunction_t; + /** * @brief A function to create an operation from the factory. * The function receives array of inputs and array of outputs, and creates an operation @@ -188,6 +196,8 @@ typedef SnpeUdo_ErrorType_t SnpeUdo_TensorParam_t*, SnpeUdo_Operation_t*); +typedef SnpeUdo_CreateOperationFunction_t Udo_CreateOperationFunction_t; + /** * @brief A pointer to notification function. * @@ -206,6 +216,8 @@ typedef SnpeUdo_ErrorType_t typedef SnpeUdo_ErrorType_t (*SnpeUdo_ExternalNotify_t)(const uint32_t ID); +typedef SnpeUdo_ExternalNotify_t Udo_ExternalNotify_t; + /** * @brief Operation execution function. * @@ -245,6 +257,8 @@ typedef SnpeUdo_ErrorType_t const uint32_t, SnpeUdo_ExternalNotify_t); +typedef SnpeUdo_ExecuteOpFunction_t Udo_ExecuteOpFunction_t; + /** * @brief A function to setting the inputs & outputs. part of SnpeUdo_Operation struct, * returned from creation of a new operation instance. @@ -277,6 +291,8 @@ typedef SnpeUdo_ErrorType_t SnpeUdo_TensorParam_t*, SnpeUdo_TensorParam_t*); +typedef SnpeUdo_SetOpIOFunction_t Udo_SetOpIOFunction_t; + /** * @brief A function to return execution times. * @@ -297,6 +313,8 @@ SnpeUdo_profileOp(SnpeUdo_Operation_t operation, uint32_t *executionTime); typedef SnpeUdo_ErrorType_t (*SnpeUdo_ProfileOpFunction_t)(SnpeUdo_Operation_t, uint32_t*); +typedef SnpeUdo_ProfileOpFunction_t Udo_ProfileOpFunction_t; + /** * @brief A function to release the operation instance * \n When it is called, the implementation library needs to release all resources @@ -314,6 +332,8 @@ SnpeUdo_releaseOp(SnpeUdo_Operation_t operation); typedef SnpeUdo_ErrorType_t (*SnpeUdo_ReleaseOpFunction_t)(SnpeUdo_Operation_t); +typedef SnpeUdo_ReleaseOpFunction_t Udo_ReleaseOpFunction_t; + /** @} */ /* end_addtogroup c_plus_plus_apis C++ */ #ifdef __cplusplus diff --git a/third_party/snpe/include/SnpeUdo/UdoImplDsp.h b/third_party/snpe/include/SnpeUdo/UdoImplDsp.h index 7e85bf15d8..b97a649320 100644 --- a/third_party/snpe/include/SnpeUdo/UdoImplDsp.h +++ b/third_party/snpe/include/SnpeUdo/UdoImplDsp.h @@ -1,6 +1,6 @@ //============================================================================== // -// Copyright (c) 2019-2020 Qualcomm Technologies, Inc. +// Copyright (c) 2019-2021 Qualcomm Technologies, Inc. // All Rights Reserved. // Confidential and Proprietary - Qualcomm Technologies, Inc. // @@ -45,13 +45,16 @@ typedef SnpeUdo_ErrorType_t (*SnpeUdo_ValidateOperationFunction_t) (SnpeUdo_Stri uint32_t, const SnpeUdo_Param_t*); +typedef SnpeUdo_ValidateOperationFunction_t Udo_ValidateOperationFunction_t; // enum used for indicating input/outout tensor data layouts on DSP, plain vs d32 typedef enum { - SNPE_UDO_DSP_TENSOR_LAYOUT_PLAIN, - SNPE_UDO_DSP_TENSOR_LAYOUT_D32 + SNPE_UDO_DSP_TENSOR_LAYOUT_PLAIN = 0x00, UDO_DSP_TENSOR_LAYOUT_PLAIN = 0x00, + SNPE_UDO_DSP_TENSOR_LAYOUT_D32 = 0x01, UDO_DSP_TENSOR_LAYOUT_D32 = 0x01 } SnpeUdo_HexNNTensorLayout_t; +typedef SnpeUdo_HexNNTensorLayout_t Udo_HexNNTensorLayout_t; + /** * @brief A function to query numbers of inputs and outputs, * quantization type of each input and each output as arrays, @@ -96,7 +99,7 @@ typedef SnpeUdo_ErrorType_t (*SnpeUdo_QueryOperationFunction_t) (SnpeUdo_String_ SnpeUdo_QuantizationType_t**, SnpeUdo_HexNNTensorLayout_t**); - +typedef SnpeUdo_QueryOperationFunction_t Udo_QueryOperationFunction_t; // Global infrastructure functions supported by Hexagon-NN v2 typedef void (*workerThread_t) (void* perOpInfrastructure, void* userData); @@ -134,12 +137,25 @@ typedef struct hexNNv2GlobalInfra { udoRunWorkerThreads_t udoRunWorkerThreads; } SnpeUdo_HexNNv2GlobalInfra_t; +typedef SnpeUdo_HexNNv2GlobalInfra_t Udo_HexNNv2GlobalInfra_t; + // hexnn types typedef enum hexnnInfraType { UDO_INFRA_HEXNN_V2, UDO_INFRA_HEXNN_V3 // reserved, do not use } SnpeUdo_HexNNInfraType_t; +typedef SnpeUdo_HexNNInfraType_t Udo_HexNNInfraType_t; + +typedef struct { + Udo_CreateOpFactoryFunction_t create_op_factory; + Udo_CreateOperationFunction_t create_operation; + Udo_ExecuteOpFunction_t execute_op; + Udo_ReleaseOpFunction_t release_op; + Udo_ReleaseOpFactoryFunction_t release_op_factory; + Udo_ValidateOperationFunction_t validate_op; + Udo_QueryOperationFunction_t query_op; +} udo_func_package_t; /** * @brief Infrastructures needed by a developer of DSP Hexnn UDO Implementation library. @@ -156,6 +172,7 @@ typedef struct dspGlobalInfrastructure { SnpeUdo_HexNNv2GlobalInfra_t hexNNv2Infra; } SnpeUdo_DspGlobalInfrastructure_t; +typedef SnpeUdo_DspGlobalInfrastructure_t Udo_DspGlobalInfrastructure_t; /** * hexnn v2 per op factory infrastructure @@ -169,6 +186,7 @@ typedef struct hexnnv2OpFactoryInfra { unsigned long graphId; } SnpeUdo_HexNNv2OpFactoryInfra_t; +typedef SnpeUdo_HexNNv2OpFactoryInfra_t Udo_HexNNv2OpFactoryInfra_t; /** * hexnn v2 per operation infrastructure @@ -182,6 +200,8 @@ typedef struct hexnnv2OpFactoryInfra { */ typedef void* SnpeUdo_HexNNv2OpInfra_t; +typedef SnpeUdo_HexNNv2OpInfra_t Udo_HexNNv2OpInfra_t; + /** @} */ /* end_addtogroup c_plus_plus_apis C++ */ #endif // SNPE_UDO_IMPL_DSP_H diff --git a/third_party/snpe/include/SnpeUdo/UdoShared.h b/third_party/snpe/include/SnpeUdo/UdoShared.h index 6fd50c318a..418d9db9e2 100644 --- a/third_party/snpe/include/SnpeUdo/UdoShared.h +++ b/third_party/snpe/include/SnpeUdo/UdoShared.h @@ -1,6 +1,6 @@ //============================================================================== // -// Copyright (c) 2019-2020 Qualcomm Technologies, Inc. +// Copyright (c) 2019-2021 Qualcomm Technologies, Inc. // All Rights Reserved. // Confidential and Proprietary - Qualcomm Technologies, Inc. // @@ -37,6 +37,8 @@ SnpeUdo_getVersion (SnpeUdo_LibVersion_t** version); typedef SnpeUdo_ErrorType_t (*SnpeUdo_GetVersionFunction_t) (SnpeUdo_LibVersion_t** version); +typedef SnpeUdo_GetVersionFunction_t Udo_GetVersionFunction_t; + #ifdef __cplusplus } // extern "C" #endif diff --git a/third_party/snpe/larch64 b/third_party/snpe/larch64 index e5c222b1c9..2e2a1c315b 120000 --- a/third_party/snpe/larch64 +++ b/third_party/snpe/larch64 @@ -1 +1 @@ -aarch64-linux-gcc4.9 \ No newline at end of file +aarch64-ubuntu-gcc7.5 \ No newline at end of file diff --git a/third_party/snpe/x86_64-linux-clang/libHtpPrepare.so b/third_party/snpe/x86_64-linux-clang/libHtpPrepare.so new file mode 100644 index 0000000000..20d1377a01 --- /dev/null +++ b/third_party/snpe/x86_64-linux-clang/libHtpPrepare.so @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c4c33680010a8c7b2eef33e809844c0ad1d5ab0f0ec37abd49d924204670b357 +size 13556072 diff --git a/third_party/snpe/x86_64-linux-clang/libSNPE.so b/third_party/snpe/x86_64-linux-clang/libSNPE.so index 8b19a867b9..0367b1106b 100644 --- a/third_party/snpe/x86_64-linux-clang/libSNPE.so +++ b/third_party/snpe/x86_64-linux-clang/libSNPE.so @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:0cf6f53b7581e264b7070bdbbd95449cf913b9651cb7c83c6c647f9536d0a388 -size 5467528 +oid sha256:024891d2e4e4e265a1e7e72b27bad41ee6ae077d2197f45959bb32f8071dc8cf +size 5350008 diff --git a/third_party/snpe/x86_64-linux-clang/libomp.so b/third_party/snpe/x86_64-linux-clang/libomp.so index ae0f761ecd..db98cba162 100755 --- a/third_party/snpe/x86_64-linux-clang/libomp.so +++ b/third_party/snpe/x86_64-linux-clang/libomp.so @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:558fcdaf12bc2fb267c918bbc3e531dbfdb38ec68a677d5e1de34e025c4caca4 +oid sha256:f4784aa68e7ebdbe97db732eab87618b0a5fb73abeab4daed5476e01829b0e6e size 759208 diff --git a/third_party/snpe/x86_64-linux-clang/libsymphony-cpu.so b/third_party/snpe/x86_64-linux-clang/libsymphony-cpu.so deleted file mode 100644 index f42ff4003f..0000000000 --- a/third_party/snpe/x86_64-linux-clang/libsymphony-cpu.so +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:e680b2a32b1f0f756624747ed0f9728f32442d0227384c41371426017e512ff9 -size 484048