modeld: retain SNPE and thneed drive model support (#530)

* modeld: Retain pre-20hz drive model support

* Method not available anymore on OP

* some fixes

* Revert "Long planner get accel: new function args (#34288)"

* Revert "Fix low-speed allow_throttle behavior in long planner (#33894)"

* Revert "long planner: allow throttle reflects usage (#33792)"

* Revert "Gate acceleration on model gas press predictions (#33643)"

* Reapply "Gate acceleration on model gas press predictions (#33643)"

This reverts commit 76b08e37cb8eb94266ad9f6fed80db227e7c3428.

* Reapply "long planner: allow throttle reflects usage (#33792)"

This reverts commit c75244ca4e9c48084b0205b7c871e1a4e0f4e693.

* Reapply "Fix low-speed allow_throttle behavior in long planner (#33894)"

This reverts commit b2b7d21b7b685a2785d1beede3d223f0bb954807.

* Reapply "Long planner get accel: new function args (#34288)"

This reverts commit 74dca2fccf4da59cc8ac62ba9c0ad10ba3fc264b.

* don't need

* retain snpe

* wrong

* they're symlinks

* remove

* put back into VCS

* add back

* don't include built

* Refactor model runner retrieval with caching support

Added caching for active model runner type via `ModelRunnerTypeCache` to enhance performance and avoid redundant checks. Introduced a `force_check` flag to bypass the cache when necessary. Updated related code to handle cache clearing during onroad transitions.

* Update model runner determination logic with caching fix

Enhances `get_active_model_runner` to utilize caching more effectively by ensuring type consistency and updating cache only when necessary. Also updates `is_snpe_model` to pass the `started` state to the runner determination function, improving behavior for dynamic checks.

* default to none

* enable in next PR

* more

---------

Co-authored-by: DevTekVE <devtekve@gmail.com>
This commit is contained in:
Jason Wen
2025-01-10 08:56:10 -05:00
committed by GitHub
parent d5f5887830
commit 56aa07844a
109 changed files with 9475 additions and 3 deletions
@@ -0,0 +1,118 @@
// =============================================================================
//
// Copyright (c) 2018-2020 Qualcomm Technologies, Inc.
// All Rights Reserved.
// Confidential and Proprietary - Qualcomm Technologies, Inc.
//
// =============================================================================
#ifndef SNPE_PLATFORMVALIDATOR_HPP
#define SNPE_PLATFORMVALIDATOR_HPP
#include "DlSystem/DlEnums.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 <string>
#include <memory>
SNPE_ENABLE_WARNINGS
namespace zdl
{
namespace SNPE
{
class PlatformValidator;
class IPlatformValidatorRuntime;
}
}
/** @addtogroup c_plus_plus_apis C++
@{ */
/**
* The class for checking SNPE compatibility/capability of a device.
*
*/
class ZDL_EXPORT zdl::SNPE::PlatformValidator
{
public:
/**
* @brief Default Constructor of the PlatformValidator Class
*
* @return A new instance of a PlatformValidator object
* that can be used to check the SNPE compatibility
* of a device
*/
PlatformValidator();
~PlatformValidator();
/**
* @brief Sets the runtime processor for compatibility check
*
* @return Void
*/
void setRuntime(zdl::DlSystem::Runtime_t runtime);
/**
* @brief Checks if the Runtime prerequisites for SNPE are available.
*
* @return True if the Runtime prerequisites are available, else false.
*/
bool isRuntimeAvailable();
/**
* @brief Returns the core version for the Runtime selected.
*
* @return String which contains the actual core version value
*/
std::string getCoreVersion();
/**
* @brief Returns the library version for the Runtime selected.
*
* @return String which contains the actual lib version value
*/
std::string getLibVersion();
/**
* @brief Runs a small program on the runtime and Checks if SNPE is supported for Runtime.
*
* @return If True, the device is ready for SNPE execution, else not.
*/
bool runtimeCheck();
private:
zdl::DlSystem::Runtime_t m_runtimeType;
std::unique_ptr<IPlatformValidatorRuntime> m_platformValidatorRuntime;
};
/** @} */ /* end_addtogroup c_plus_plus_apis C++ */
#endif //SNPE_PLATFORMVALIDATOR_HPP