TRT Utils#

struct DlDeleter#

Custom deleter for dynamic library handles.

Handles proper cleanup of dynamically loaded libraries using dlclose.

Public Functions

inline void operator()(void *handle) const noexcept#

Delete operator for library handles.

Parameters:

handle – Library handle to close

std::optional<std::pair<cudaGraph_t, cudaGraphExec_t>> trt_edgellm::captureTRTCudaGraph(
nvinfer1::IExecutionContext *context,
cudaStream_t stream
)#

Capture a TensorRT CUDA graph from an execution context and stream.

Returns:

Pair of graph and graph exec on success, std::nullopt on failure

std::string trt_edgellm::dimsToString(
nvinfer1::Dims const &dims
) noexcept#

Convert TensorRT dimensions to a string representation.

bool trt_edgellm::hasDynamicDims(
nvinfer1::Dims const &dims
) noexcept#

Return true when a TensorRT dimensions object contains runtime dimensions.

bool trt_edgellm::dimsEqual(
nvinfer1::Dims const &lhs,
nvinfer1::Dims const &rhs
) noexcept#

Return true when two TensorRT dimensions objects have the same rank and extent.

bool trt_edgellm::isEngineInput(
nvinfer1::ICudaEngine const &engine,
std::string const &tensorName
) noexcept#

Return true when tensorName exists in the engine I/O list and is an input.

std::string trt_edgellm::printEngineInfo(
nvinfer1::ICudaEngine const *engine,
int32_t profileIndex
) noexcept#

Print the engine information for a specific profile index.

bool trt_edgellm::engineHasOutputTensor(
nvinfer1::ICudaEngine const *engine,
char const *tensorName
) noexcept#

Whether the engine exposes an output binding with the given name. Use this instead of getTensorIOMode(name) when probing for an optional binding — getTensorIOMode logs a spurious TensorRT ERROR for unknown names.

Pre:

engine and tensorName are non-null.