Files
sunnypilot/third_party/snpe/include/DlSystem/IBufferAttributes.hpp
Jason Wen acd46aa94b modeld: retain SNPE and thneed drive model support (#555)
* 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 76b08e37cb.

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

This reverts commit c75244ca4e.

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

This reverts commit b2b7d21b7b.

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

This reverts commit 74dca2fccf.

* 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>
2025-01-10 18:34:06 -05:00

87 lines
2.3 KiB
C++

//==============================================================================
//
// Copyright (c) 2017-2019 Qualcomm Technologies, Inc.
// All Rights Reserved.
// Confidential and Proprietary - Qualcomm Technologies, Inc.
//
//==============================================================================
#ifndef _IBUFFER_ATTRIBUTES_HPP
#define _IBUFFER_ATTRIBUTES_HPP
#include "IUserBuffer.hpp"
#include "TensorShape.hpp"
#include "ZdlExportDefine.hpp"
namespace zdl {
namespace DlSystem {
class UserBufferEncoding;
}
}
namespace zdl {
namespace DlSystem {
/**
* @brief IBufferAttributes returns a buffer's dimension and alignment
* requirements, along with info on its encoding type
*/
class ZDL_EXPORT IBufferAttributes {
public:
/**
* @brief Gets the buffer's element size, in bytes
*
* This can be used to compute the memory size required
* to back this buffer.
*
* @return Element size, in bytes
*/
virtual size_t getElementSize() const noexcept = 0;
/**
* @brief Gets the element's encoding type
*
* @return encoding type
*/
virtual zdl::DlSystem::UserBufferEncoding::ElementType_t getEncodingType() const noexcept = 0;
/**
* @brief Gets the number of elements in each dimension
*
* @return Dimension size, in terms of number of elements
*/
virtual const TensorShape getDims() const noexcept = 0;
/**
* @brief Gets the alignment requirement of each dimension
*
* Alignment per each dimension is expressed as an multiple, for
* example, if one particular dimension can accept multiples of 8,
* the alignment will be 8.
*
* @return Alignment in each dimension, in terms of multiple of
* number of elements
*/
virtual const TensorShape getAlignments() const noexcept = 0;
/**
* @brief Gets the buffer encoding returned from the network responsible
* for generating this buffer. Depending on the encoding type, this will
* be an instance of an encoding type specific derived class.
*
* @return Derived user buffer encoding object.
*/
virtual zdl::DlSystem::UserBufferEncoding* getEncoding() const noexcept = 0;
virtual ~IBufferAttributes() {}
};
/** @} */ /* end_addtogroup c_plus_plus_apis C++ */
}
}
#endif