mirror of
https://github.com/firestar5683/StarPilot.git
synced 2026-10-01 03:43:46 +08:00
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:
+87
@@ -0,0 +1,87 @@
|
||||
//==============================================================================
|
||||
//
|
||||
// Copyright (c) 2015-2021 Qualcomm Technologies, Inc.
|
||||
// All Rights Reserved.
|
||||
// Confidential and Proprietary - Qualcomm Technologies, Inc.
|
||||
//
|
||||
//==============================================================================
|
||||
|
||||
#ifndef _UDL_FUNC_HPP_
|
||||
#define _UDL_FUNC_HPP_
|
||||
|
||||
#include <functional>
|
||||
|
||||
#include "ZdlExportDefine.hpp"
|
||||
#include <DlSystem/IUDL.hpp>
|
||||
|
||||
namespace zdl {
|
||||
namespace DlSystem {
|
||||
class UDLContext;
|
||||
}
|
||||
}
|
||||
|
||||
namespace zdl { namespace DlSystem {
|
||||
/**
|
||||
* NOTE: DEPRECATED, MAY BE REMOVED IN THE FUTURE.
|
||||
*
|
||||
* @brief .
|
||||
*
|
||||
* Definition of UDLFactoyFunc, using/typedef and default FactoryFunction
|
||||
* UDLBundle - a simple way to bundle func and cookie into one type
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* @brief .
|
||||
*
|
||||
* Convenient typedef for user defined layer creation factory
|
||||
*
|
||||
* @param[out] void* Cookie - a user opaque data that was passed during SNPE's runtime's
|
||||
* CreateInstance. SNPE's runtime is passing this back to the user.
|
||||
*
|
||||
* @param[out] DlSystem::UDLContext* - The specific Layer Description context what is passe
|
||||
* SNPE runtime.
|
||||
*
|
||||
* @return IUDL* - a Concrete instance of IUDL derivative
|
||||
*/
|
||||
using UDLFactoryFunc = std::function<zdl::DlSystem::IUDL* (void*, const zdl::DlSystem::UDLContext*)>;
|
||||
|
||||
/**
|
||||
* NOTE: DEPRECATED, MAY BE REMOVED IN THE FUTURE.
|
||||
*
|
||||
* @brief .
|
||||
*
|
||||
* default UDL factory implementation
|
||||
*
|
||||
* @param[out] DlSystem::UDLContext* - The specific Layer Description context what is passe
|
||||
* SNPE runtime.
|
||||
*
|
||||
* @param[out] void* Cookie - a user opaque data that was passed during SNPE's runtime's
|
||||
* CreateInstance. SNPE's runtime is passing this back to the user.
|
||||
*
|
||||
* @return IUDL* - nullptr to indicate SNPE's runtime that there is no specific
|
||||
* implementation for UDL. When SNPE's runtime sees nullptr as a return
|
||||
* value from the factory, it will halt execution if model has an unknown layer
|
||||
*
|
||||
*/
|
||||
inline ZDL_EXPORT zdl::DlSystem::IUDL* DefaultUDLFunc(void*, const zdl::DlSystem::UDLContext*) { return nullptr; }
|
||||
|
||||
/**
|
||||
* NOTE: DEPRECATED, MAY BE REMOVED IN THE FUTURE.
|
||||
*
|
||||
* @brief .
|
||||
*
|
||||
* Simple struct to bundle 2 elements.
|
||||
* A user defined cookie that would be returned for each
|
||||
* IUDL call. The user can place anything there and the
|
||||
* SNPE runtime will provide it back
|
||||
*/
|
||||
struct ZDL_EXPORT UDLBundle {
|
||||
void *cookie = nullptr;
|
||||
UDLFactoryFunc func = DefaultUDLFunc;
|
||||
};
|
||||
|
||||
}}
|
||||
|
||||
|
||||
#endif // _UDL_FUNC_HPP_
|
||||
Reference in New Issue
Block a user