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.

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.