Skip to content

Commit

Permalink
Update SNPE to 1.61.0.3358 (commaai#24253)
Browse files Browse the repository at this point in the history
* update snpe to snpe-1.61.0.3358

* fix new snpe build

* fix snpe dir in files_tici

Co-authored-by: Comma Device <device@comma.ai>
  • Loading branch information
geohot and Comma Device authored Apr 19, 2022
1 parent 0ac35a6 commit 40cf4a7
Show file tree
Hide file tree
Showing 45 changed files with 720 additions and 190 deletions.
2 changes: 1 addition & 1 deletion release/files_tici
Original file line number Diff line number Diff line change
@@ -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
Expand Down
3 changes: 1 addition & 2 deletions selfdrive/modeld/SConscript
Original file line number Diff line number Diff line change
Expand Up @@ -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"""
Expand Down Expand Up @@ -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)
Expand Down
Binary file not shown.
Binary file removed third_party/snpe/aarch64-linux-gcc4.9/libSNPE.so
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added third_party/snpe/aarch64-ubuntu-gcc7.5/libSNPE.so
Binary file not shown.
Binary file not shown.
Binary file added third_party/snpe/aarch64-ubuntu-gcc7.5/libhta.so
Binary file not shown.
Binary file not shown.
Binary file removed third_party/snpe/dsp/libcalculator_domains_skel.so
Binary file not shown.
Binary file modified third_party/snpe/dsp/libcalculator_skel.so
Binary file not shown.
Binary file removed third_party/snpe/dsp/libsnpe_dsp_domains_skel.so
Binary file not shown.
Binary file removed third_party/snpe/dsp/libsnpe_dsp_skel.so
Binary file not shown.
Binary file modified third_party/snpe/dsp/libsnpe_dsp_v65_domains_v2_skel.so
Binary file not shown.
Binary file modified third_party/snpe/dsp/libsnpe_dsp_v66_domains_v2_skel.so
Binary file not shown.
Binary file not shown.
34 changes: 33 additions & 1 deletion third_party/snpe/include/DlSystem/DlEnums.hpp
Original file line number Diff line number Diff line change
@@ -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.
//
Expand Down Expand Up @@ -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,
};

/**
Expand Down Expand Up @@ -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


Expand Down
16 changes: 14 additions & 2 deletions third_party/snpe/include/DlSystem/DlError.hpp
Original file line number Diff line number Diff line change
@@ -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.
//
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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

};

Expand Down
127 changes: 127 additions & 0 deletions third_party/snpe/include/DlSystem/IOBufferDataTypeMap.hpp
Original file line number Diff line number Diff line change
@@ -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 <cstddef>
#include <memory>
#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
15 changes: 11 additions & 4 deletions third_party/snpe/include/DlSystem/IUDL.hpp
Original file line number Diff line number Diff line change
@@ -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.
//
Expand All @@ -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.
Expand All @@ -32,13 +32,17 @@ namespace DlSystem {
class ZDL_EXPORT IUDL {
public:
/**
* NOTE: DEPRECATED, MAY BE REMOVED IN THE FUTURE.
*
* @brief .
*
* Destructor
*/
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
Expand Down Expand Up @@ -66,6 +70,8 @@ class ZDL_EXPORT IUDL {
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.
Expand All @@ -75,6 +81,8 @@ class ZDL_EXPORT IUDL {
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
Expand All @@ -89,7 +97,6 @@ class ZDL_EXPORT IUDL {
*/
virtual bool execute(void *cookie, const float **input, float **output) = 0;
};
/** @} */ /* end_addtogroup c_plus_plus_apis C++ */

} // ns DlSystem

Expand Down
Loading

0 comments on commit 40cf4a7

Please sign in to comment.