Plugin Utils#

template<typename T, class Enable = void>
struct Serializer#

Generic serializer template for plugin data.

Provides serialization/deserialization for plugin state. Specialized for arithmetic and enum types.

Template Parameters:
  • T – Type to serialize

  • Enable – SFINAE enabler

template<typename T>
struct Serializer<T, typename std::enable_if_t<std::is_arithmetic_v<T> || std::is_enum_v<T>>>#

Serializer specialization for arithmetic and enum types.

Public Static Functions

static inline void serialize(void **buffer, T const &value)#

Serialize value to buffer.

Parameters:
  • buffer – Output buffer pointer (advanced after write)

  • value – Value to serialize

static inline void deserialize(
void const **buffer,
size_t *buffer_size,
T *value
)#

Deserialize value from buffer.

Parameters:
  • buffer – Input buffer pointer (advanced after read)

  • buffer_size – Buffer size (decremented after read)

  • value – Output value

void *trt_edgellm::plugins::alignDevicePtr(void *ptr)#

Align device pointer to device alignment.

Parameters:

ptr – Device pointer that might not be aligned to device alignment.

Returns:

Aligned device pointer

template<typename T>
nvinfer1::PluginFieldType trt_edgellm::plugins::toFieldType(
)#

Convert C++ type to TensorRT PluginFieldType.

Template Parameters:

T – C++ type

Returns:

Corresponding PluginFieldType

Warning

doxygenfunction: Unable to resolve function “trt_edgellm::plugins::accumulateWorkspaceSize” with arguments None in doxygen xml output for project “TensorRT Edge-LLM” from directory: ../cpp_docs/xml. Potential matches:

- size_t accumulateWorkspaceSize(size_t currentSize, rt::Coords const &shape, DataType dataType)
- size_t accumulateWorkspaceSize(size_t currentSize, rt::Coords const &shape, nvinfer1::DataType dataType)

Warning

doxygenfunction: Unable to resolve function “trt_edgellm::plugins::assignTensorFromWorkspace” with arguments None in doxygen xml output for project “TensorRT Edge-LLM” from directory: ../cpp_docs/xml. Potential matches:

- rt::Tensor assignTensorFromWorkspace(void *&workspace, rt::Coords const &shape, DataType dataType)
- rt::Tensor assignTensorFromWorkspace(void *&workspace, rt::Coords const &shape, nvinfer1::DataType dataType)