13#ifndef NV_INFER_RUNTIME_H
14#define NV_INFER_RUNTIME_H
22#include "NvInferImpl.h"
28class IExecutionContext;
31class IEngineInspector;
107 static constexpr int32_t kVALUE = 3;
151 return mImpl->data();
155 std::size_t
size() const noexcept
157 return mImpl->size();
163 return mImpl->type();
227 static constexpr int32_t kVALUE = 2;
249 return mImpl->isConstant();
256 return mImpl->getConstantValue();
287 return mImpl->constant(value);
295 return mImpl->operation(op, first, second);
386 static constexpr int32_t kFORMAT_COMBINATION_LIMIT = 100;
420 virtual
bool supportsFormatCombination(
421 int32_t pos, const
PluginTensorDesc* inOut, int32_t nbInputs, int32_t nbOutputs) noexcept
476 int32_t nbOutputs) const noexcept
492 const
void* const* inputs,
void* const* outputs,
void* workspace, cudaStream_t stream) noexcept
503 int32_t getTensorRTVersion() const noexcept
override
514 bool const*,
PluginFormat, int32_t)
noexcept override final
523 Dims getOutputDimensions(int32_t,
Dims const*, int32_t)
noexcept override final
528 bool isOutputBroadcastAcrossBatch(int32_t,
bool const*, int32_t)
const noexcept override final
533 bool canBroadcastInputAcrossBatch(int32_t)
const noexcept override final
538 size_t getWorkspaceSize(int32_t)
const noexcept override final
543 int32_t enqueue(int32_t,
const void*
const*,
void*
const*,
void*, cudaStream_t)
noexcept override final
642 const
void* blob, std::
size_t size, IPluginFactory* pluginFactory) noexcept
644 return mImpl->deserializeCudaEngine(blob, size,
nullptr);
656 mImpl->setDLACore(dlaCore);
667 return mImpl->getDLACore();
675 return mImpl->getNbDLACores();
701 mImpl->setGpuAllocator(allocator);
720 mImpl->setErrorRecorder(recorder);
735 return mImpl->getErrorRecorder();
750 return mImpl->deserializeCudaEngine(blob, size,
nullptr);
760 return mImpl->getLogger();
774 return mImpl->setMaxThreads(maxThreads);
788 return mImpl->getMaxThreads();
819 return mImpl->setWeights(layerName, role, weights);
834 return mImpl->refitCudaEngine();
855 return mImpl->getMissing(size, layerNames, roles);
872 return mImpl->getAll(size, layerNames, roles);
899 return mImpl->setDynamicRange(tensorName, min, max);
911 return mImpl->getDynamicRangeMin(tensorName);
923 return mImpl->getDynamicRangeMax(tensorName);
939 return mImpl->getTensorsWithDynamicRange(size, tensorNames);
958 mImpl->setErrorRecorder(recorder);
973 return mImpl->getErrorRecorder();
991 return mImpl->setNamedWeights(name, weights);
1011 return mImpl->getMissingWeights(size, weightsNames);
1027 return mImpl->getAllWeights(size, weightsNames);
1037 return mImpl->getLogger();
1051 return mImpl->setMaxThreads(maxThreads);
1065 return mImpl->getMaxThreads();
1152 return mImpl->setDimensions(inputName, select, dims);
1162 return mImpl->getDimensions(inputName, select);
1204 const char* inputName,
OptProfileSelector select,
const int32_t* values, int32_t nbValues)
noexcept
1206 return mImpl->setShapeValues(inputName, select, values, nbValues);
1217 return mImpl->getNbShapeValues(inputName);
1227 return mImpl->getShapeValues(inputName, select);
1245 return mImpl->setExtraMemoryTarget(target);
1253 return mImpl->getExtraMemoryTarget();
1269 return mImpl->isValid();
1356 int32_t getNbBindings() const noexcept
1358 return mImpl->getNbBindings();
1380 return mImpl->getBindingIndex(name);
1400 return mImpl->getBindingName(bindingIndex);
1413 return mImpl->bindingIsInput(bindingIndex);
1438 return mImpl->getBindingDimensions(bindingIndex);
1451 return mImpl->getBindingDataType(bindingIndex);
1463 return mImpl->getMaxBatchSize();
1477 return mImpl->getNbLayers();
1491 return mImpl->serialize();
1507 return mImpl->createExecutionContext();
1534 return mImpl->getLocation(bindingIndex);
1543 return mImpl->createExecutionContextWithoutDeviceMemory();
1553 return mImpl->getDeviceMemorySize();
1563 return mImpl->isRefittable();
1577 return mImpl->getBindingBytesPerComponent(bindingIndex);
1591 return mImpl->getBindingComponentsPerElement(bindingIndex);
1601 return mImpl->getBindingFormat(bindingIndex);
1620 return mImpl->getBindingFormatDesc(bindingIndex);
1632 return mImpl->getBindingVectorizedDim(bindingIndex);
1647 return mImpl->getName();
1658 return mImpl->getNbOptimizationProfiles();
1685 return mImpl->getProfileDimensions(bindingIndex, profileIndex, select);
1712 return mImpl->getProfileShapeValues(profileIndex, inputIndex, select);
1748 return mImpl->isShapeBinding(bindingIndex);
1762 return mImpl->isExecutionBinding(bindingIndex);
1777 return mImpl->getEngineCapability();
1795 return mImpl->setErrorRecorder(recorder);
1810 return mImpl->getErrorRecorder();
1829 return mImpl->hasImplicitBatchDimension();
1838 return mImpl->getTacticSources();
1849 return mImpl->getProfilingVerbosity();
1859 return mImpl->createEngineInspector();
1898 bool execute(int32_t batchSize,
void* const* bindings) noexcept
1900 return mImpl->execute(batchSize, bindings);
1927 bool enqueue(int32_t batchSize,
void*
const* bindings, cudaStream_t stream, cudaEvent_t* inputConsumed)
noexcept
1929 return mImpl->enqueue(batchSize, bindings, stream, inputConsumed);
1942 mImpl->setDebugSync(sync);
1952 return mImpl->getDebugSync();
1962 mImpl->setProfiler(profiler);
1972 return mImpl->getProfiler();
1982 return mImpl->getEngine();
2006 mImpl->setName(name);
2016 return mImpl->getName();
2032 mImpl->setDeviceMemory(memory);
2053 return mImpl->getStrides(bindingIndex);
2096 return mImpl->setOptimizationProfile(profileIndex);
2108 return mImpl->getOptimizationProfile();
2145 return mImpl->setBindingDimensions(bindingIndex, dimensions);
2175 return mImpl->getBindingDimensions(bindingIndex);
2205 return mImpl->setInputShapeBinding(bindingIndex, data);
2227 return mImpl->getShapeBinding(bindingIndex, data);
2242 return mImpl->allInputDimensionsSpecified();
2257 return mImpl->allInputShapesSpecified();
2276 mImpl->setErrorRecorder(recorder);
2291 return mImpl->getErrorRecorder();
2308 return mImpl->executeV2(bindings);
2334 bool enqueueV2(
void*
const* bindings, cudaStream_t stream, cudaEvent_t* inputConsumed)
noexcept
2336 return mImpl->enqueueV2(bindings, stream, inputConsumed);
2384 return mImpl->setOptimizationProfileAsync(profileIndex, stream);
2399 mImpl->setEnqueueEmitsProfile(enqueueEmitsProfile);
2410 return mImpl->getEnqueueEmitsProfile();
2437 return mImpl->reportToProfiler();
2499 return mImpl->setExecutionContext(context);
2511 return mImpl->getExecutionContext();
2536 return mImpl->getLayerInformation(layerIndex, format);
2561 return mImpl->getEngineInformation(format);
2580 mImpl->setErrorRecorder(recorder);
2595 return mImpl->getErrorRecorder();
2608extern "C" TENSORRTAPI void* createInferRuntime_INTERNAL(
void* logger, int32_t version)
noexcept;
2614extern "C" TENSORRTAPI void* createInferRefitter_INTERNAL(
void* engine,
void* logger, int32_t version)
noexcept;
2648inline IRefitter* createInferRefitter(ICudaEngine& engine, ILogger& logger)
noexcept
2650 return static_cast<IRefitter*
>(createInferRefitter_INTERNAL(&engine, &logger,
NV_TENSORRT_VERSION));
2666template <
typename T>
2682#define REGISTER_TENSORRT_PLUGIN(name) \
2683 static nvinfer1::PluginRegistrar<name> pluginRegistrar##name {}
nvinfer1::ILogger * getLogger() noexcept
Return the logger object.
nvinfer1::IPluginRegistry * getPluginRegistry() noexcept
Return the plugin registry.
#define TENSORRTAPI
Definition: NvInferRuntimeCommon.h:54
#define NV_TENSORRT_VERSION
Definition: NvInferRuntimeCommon.h:73
#define TRT_DEPRECATED
Definition: NvInferRuntimeCommon.h:40
#define TRT_DEPRECATED_ENUM
Definition: NvInferRuntimeCommon.h:41
Structure to define the dimensions of a tensor.
Definition: NvInferRuntimeCommon.h:153
static constexpr int32_t MAX_DIMS
The maximum rank (number of dimensions) supported for a tensor.
Definition: NvInferRuntimeCommon.h:156
Definition: NvInferRuntime.h:309
int32_t nbDims
The number of dimensions.
Definition: NvInferRuntime.h:311
An engine for executing inference on a built network, with functionally unsafe features.
Definition: NvInferRuntime.h:1342
int32_t getBindingBytesPerComponent(int32_t bindingIndex) const noexcept
Return the number of bytes per component of an element.
Definition: NvInferRuntime.h:1575
int32_t getBindingComponentsPerElement(int32_t bindingIndex) const noexcept
Return the number of components included in one element.
Definition: NvInferRuntime.h:1589
bool isShapeBinding(int32_t bindingIndex) const noexcept
True if tensor is required as input for shape calculations or output from them.
Definition: NvInferRuntime.h:1746
bool hasImplicitBatchDimension() const noexcept
Query whether the engine was built with an implicit batch dimension.
Definition: NvInferRuntime.h:1827
const char * getName() const noexcept
Returns the name of the network associated with the engine.
Definition: NvInferRuntime.h:1645
EngineCapability getEngineCapability() const noexcept
Determine what execution capability this engine has.
Definition: NvInferRuntime.h:1775
TRT_DEPRECATED void destroy() noexcept
Destroy this object;.
Definition: NvInferRuntime.h:1517
IErrorRecorder * getErrorRecorder() const noexcept
Get the ErrorRecorder assigned to this interface.
Definition: NvInferRuntime.h:1808
TensorFormat getBindingFormat(int32_t bindingIndex) const noexcept
Return the binding format.
Definition: NvInferRuntime.h:1599
apiv::VCudaEngine * mImpl
Definition: NvInferRuntime.h:1863
const int32_t * getProfileShapeValues(int32_t profileIndex, int32_t inputIndex, OptProfileSelector select) const noexcept
Get minimum / optimum / maximum values for an input shape binding under an optimization profile.
Definition: NvInferRuntime.h:1709
TensorLocation getLocation(int32_t bindingIndex) const noexcept
Get location of binding.
Definition: NvInferRuntime.h:1532
Dims getProfileDimensions(int32_t bindingIndex, int32_t profileIndex, OptProfileSelector select) const noexcept
Get the minimum / optimum / maximum dimensions for a particular binding under an optimization profile...
Definition: NvInferRuntime.h:1683
Dims getBindingDimensions(int32_t bindingIndex) const noexcept
Get the dimensions of a binding.
Definition: NvInferRuntime.h:1436
int32_t getBindingVectorizedDim(int32_t bindingIndex) const noexcept
Return the dimension index that the buffer is vectorized.
Definition: NvInferRuntime.h:1630
int32_t getMaxBatchSize() const noexcept
Get the maximum batch size which can be used for inference.
Definition: NvInferRuntime.h:1461
void setErrorRecorder(IErrorRecorder *recorder) noexcept
Set the ErrorRecorder for this interface.
Definition: NvInferRuntime.h:1793
size_t getDeviceMemorySize() const noexcept
Return the amount of device memory required by an execution context.
Definition: NvInferRuntime.h:1551
TacticSources getTacticSources() const noexcept
return the tactic sources required by this engine
Definition: NvInferRuntime.h:1836
virtual ~ICudaEngine() noexcept=default
ProfilingVerbosity getProfilingVerbosity() const noexcept
Return the ProfilingVerbosity the builder config was set to when the engine was built.
Definition: NvInferRuntime.h:1847
IHostMemory * serialize() const noexcept
Serialize the network to a stream.
Definition: NvInferRuntime.h:1489
IExecutionContext * createExecutionContextWithoutDeviceMemory() noexcept
create an execution context without any device memory allocated
Definition: NvInferRuntime.h:1541
int32_t getBindingIndex(const char *name) const noexcept
Retrieve the binding index for a named tensor.
Definition: NvInferRuntime.h:1378
DataType getBindingDataType(int32_t bindingIndex) const noexcept
Determine the required data type for a buffer from its binding index.
Definition: NvInferRuntime.h:1449
IExecutionContext * createExecutionContext() noexcept
Create an execution context.
Definition: NvInferRuntime.h:1505
IEngineInspector * createEngineInspector() const noexcept
Create a new engine inspector which prints the layer information in an engine or an execution context...
Definition: NvInferRuntime.h:1857
const char * getBindingName(int32_t bindingIndex) const noexcept
Retrieve the name corresponding to a binding index.
Definition: NvInferRuntime.h:1398
int32_t getNbOptimizationProfiles() const noexcept
Get the number of optimization profiles defined for this engine.
Definition: NvInferRuntime.h:1656
int32_t getNbLayers() const noexcept
Get the number of layers in the network.
Definition: NvInferRuntime.h:1475
const char * getBindingFormatDesc(int32_t bindingIndex) const noexcept
Return the human readable description of the tensor format.
Definition: NvInferRuntime.h:1618
bool bindingIsInput(int32_t bindingIndex) const noexcept
Determine whether a binding is an input binding.
Definition: NvInferRuntime.h:1411
bool isExecutionBinding(int32_t bindingIndex) const noexcept
True if pointer to tensor data is required for execution phase, false if nullptr can be supplied.
Definition: NvInferRuntime.h:1760
bool isRefittable() const noexcept
Return true if an engine can be refit.
Definition: NvInferRuntime.h:1561
Definition: NvInferRuntime.h:244
bool isConstant() const noexcept
Return true if expression is a build-time constant.
Definition: NvInferRuntime.h:247
virtual ~IDimensionExpr() noexcept=default
apiv::VDimensionExpr * mImpl
Definition: NvInferRuntime.h:260
int32_t getConstantValue() const noexcept
Definition: NvInferRuntime.h:254
An engine inspector which prints out the layer information of an engine or an execution context.
Definition: NvInferRuntime.h:2481
IErrorRecorder * getErrorRecorder() const noexcept
Get the ErrorRecorder assigned to this interface.
Definition: NvInferRuntime.h:2593
void setErrorRecorder(IErrorRecorder *recorder) noexcept
Set the ErrorRecorder for this interface.
Definition: NvInferRuntime.h:2578
AsciiChar const * getEngineInformation(LayerInformationFormat format) const noexcept
Get a string describing the information about all the layers in the current engine or the execution c...
Definition: NvInferRuntime.h:2559
IExecutionContext const * getExecutionContext() const noexcept
Get the context currently being inspected.
Definition: NvInferRuntime.h:2509
apiv::VEngineInspector * mImpl
Definition: NvInferRuntime.h:2599
virtual ~IEngineInspector() noexcept=default
AsciiChar const * getLayerInformation(int32_t layerIndex, LayerInformationFormat format) const noexcept
Get a string describing the information about a specific layer in the current engine or the execution...
Definition: NvInferRuntime.h:2534
Reference counted application-implemented error reporting interface for TensorRT objects.
Definition: NvInferRuntimeCommon.h:1661
Context for executing inference using an engine, with functionally unsafe features.
Definition: NvInferRuntime.h:1877
IErrorRecorder * getErrorRecorder() const noexcept
Get the ErrorRecorder assigned to this interface.
Definition: NvInferRuntime.h:2289
bool reportToProfiler() const noexcept
Calculate layer timing info for the current optimization profile in IExecutionContext and update the ...
Definition: NvInferRuntime.h:2435
virtual ~IExecutionContext() noexcept=default
void setDeviceMemory(void *memory) noexcept
Set the device memory for use by this execution context.
Definition: NvInferRuntime.h:2030
Dims getBindingDimensions(int32_t bindingIndex) const noexcept
Get the dynamic dimensions of a binding.
Definition: NvInferRuntime.h:2173
bool getShapeBinding(int32_t bindingIndex, int32_t *data) const noexcept
Get values of an input tensor required for shape calculations or an output tensor produced by shape c...
Definition: NvInferRuntime.h:2225
void setDebugSync(bool sync) noexcept
Set the debug sync flag.
Definition: NvInferRuntime.h:1940
bool enqueueV2(void *const *bindings, cudaStream_t stream, cudaEvent_t *inputConsumed) noexcept
Asynchronously execute inference.
Definition: NvInferRuntime.h:2334
void setEnqueueEmitsProfile(bool enqueueEmitsProfile) noexcept
Set whether enqueue emits layer timing to the profiler.
Definition: NvInferRuntime.h:2397
bool setBindingDimensions(int32_t bindingIndex, Dims dimensions) noexcept
Set the dynamic dimensions of a binding.
Definition: NvInferRuntime.h:2143
bool setInputShapeBinding(int32_t bindingIndex, int32_t const *data) noexcept
Set values of input tensor required by shape calculations.
Definition: NvInferRuntime.h:2203
bool executeV2(void *const *bindings) noexcept
Synchronously execute inference a network.
Definition: NvInferRuntime.h:2306
bool getEnqueueEmitsProfile() const noexcept
Get the enqueueEmitsProfile state.
Definition: NvInferRuntime.h:2408
bool setOptimizationProfileAsync(int32_t profileIndex, cudaStream_t stream) noexcept
Select an optimization profile for the current context with async semantics.
Definition: NvInferRuntime.h:2382
apiv::VExecutionContext * mImpl
Definition: NvInferRuntime.h:2441
int32_t getOptimizationProfile() const noexcept
Get the index of the currently selected optimization profile.
Definition: NvInferRuntime.h:2106
bool enqueue(int32_t batchSize, void *const *bindings, cudaStream_t stream, cudaEvent_t *inputConsumed) noexcept
Asynchronously execute inference on a batch.
Definition: NvInferRuntime.h:1927
TRT_DEPRECATED void destroy() noexcept
Destroy this object.
Definition: NvInferRuntime.h:1992
bool getDebugSync() const noexcept
Get the debug sync flag.
Definition: NvInferRuntime.h:1950
const char * getName() const noexcept
Return the name of the execution context.
Definition: NvInferRuntime.h:2014
Dims getStrides(int32_t bindingIndex) const noexcept
Return the strides of the buffer for the given binding.
Definition: NvInferRuntime.h:2051
IProfiler * getProfiler() const noexcept
Get the profiler.
Definition: NvInferRuntime.h:1970
void setErrorRecorder(IErrorRecorder *recorder) noexcept
Set the ErrorRecorder for this interface.
Definition: NvInferRuntime.h:2274
TRT_DEPRECATED bool setOptimizationProfile(int32_t profileIndex) noexcept
Select an optimization profile for the current context.
Definition: NvInferRuntime.h:2094
bool allInputDimensionsSpecified() const noexcept
Whether all dynamic dimensions of input tensors have been specified.
Definition: NvInferRuntime.h:2240
const ICudaEngine & getEngine() const noexcept
Get the associated engine.
Definition: NvInferRuntime.h:1980
void setProfiler(IProfiler *profiler) noexcept
Set the profiler.
Definition: NvInferRuntime.h:1960
bool allInputShapesSpecified() const noexcept
Whether all input shape bindings have been specified.
Definition: NvInferRuntime.h:2254
void setName(const char *name) noexcept
Set the name of the execution context.
Definition: NvInferRuntime.h:2004
Definition: NvInferRuntime.h:282
const IDimensionExpr * constant(int32_t value) noexcept
Return pointer to IDimensionExp for given value.
Definition: NvInferRuntime.h:285
virtual ~IExprBuilder() noexcept=default
apiv::VExprBuilder * mImpl
Definition: NvInferRuntime.h:299
const IDimensionExpr * operation(DimensionOperation op, const IDimensionExpr &first, const IDimensionExpr &second) noexcept
Definition: NvInferRuntime.h:292
Application-implemented class for controlling allocation on the GPU.
Definition: NvInferRuntimeCommon.h:1334
Class to handle library allocated memory that is accessible to the user.
Definition: NvInferRuntime.h:144
void * data() const noexcept
A pointer to the raw data that is owned by the library.
Definition: NvInferRuntime.h:149
DataType type() const noexcept
The type of the memory that was allocated.
Definition: NvInferRuntime.h:161
TRT_DEPRECATED void destroy() noexcept
Definition: NvInferRuntime.h:172
std::size_t size() const noexcept
The size in bytes of the data that was allocated.
Definition: NvInferRuntime.h:155
apiv::VHostMemory * mImpl
Definition: NvInferRuntime.h:178
virtual ~IHostMemory() noexcept=default
Application-implemented logging interface for the builder, refitter and runtime.
Definition: NvInferRuntimeCommon.h:1472
Forward declaration of IEngineInspector for use by other interfaces.
Definition: NvInferRuntime.h:43
INoCopy & operator=(INoCopy &&other)=delete
INoCopy & operator=(const INoCopy &other)=delete
INoCopy(INoCopy &&other)=delete
virtual ~INoCopy()=default
INoCopy(const INoCopy &other)=delete
Optimization profile for dynamic input dimensions and shape tensors.
Definition: NvInferRuntime.h:1123
apiv::VOptimizationProfile * mImpl
Definition: NvInferRuntime.h:1273
bool setDimensions(const char *inputName, OptProfileSelector select, Dims dims) noexcept
Set the minimum / optimum / maximum dimensions for a dynamic input tensor.
Definition: NvInferRuntime.h:1150
int32_t getNbShapeValues(const char *inputName) const noexcept
Get the number of values for an input shape tensor.
Definition: NvInferRuntime.h:1215
virtual ~IOptimizationProfile() noexcept=default
float getExtraMemoryTarget() const noexcept
Get the extra memory target that has been defined for this profile.
Definition: NvInferRuntime.h:1251
Dims getDimensions(const char *inputName, OptProfileSelector select) const noexcept
Get the minimum / optimum / maximum dimensions for a dynamic input tensor.
Definition: NvInferRuntime.h:1160
bool setExtraMemoryTarget(float target) noexcept
Set a target for extra GPU memory that may be used by this profile.
Definition: NvInferRuntime.h:1243
int32_t const * getShapeValues(const char *inputName, OptProfileSelector select) const noexcept
Get the minimum / optimum / maximum values for an input shape tensor.
Definition: NvInferRuntime.h:1225
bool setShapeValues(const char *inputName, OptProfileSelector select, const int32_t *values, int32_t nbValues) noexcept
Set the minimum / optimum / maximum values for an input shape tensor.
Definition: NvInferRuntime.h:1203
bool isValid() const noexcept
Check whether the optimization profile can be passed to an IBuilderConfig object.
Definition: NvInferRuntime.h:1267
Single registration point for all plugins in an application. It is used to find plugin implementation...
Definition: NvInferRuntimeCommon.h:1206
virtual bool registerCreator(IPluginCreator &creator, AsciiChar const *const pluginNamespace) noexcept=0
Register a plugin creator. Returns false if one with same type is already registered.
Definition: NvInferRuntime.h:351
IPluginV2DynamicExt * clone() const noexcept override=0
Clone the plugin object. This copies over internal plugin parameters as well and returns a new plugin...
virtual ~IPluginV2DynamicExt() noexcept
Definition: NvInferRuntime.h:508
Plugin class for user-implemented layers.
Definition: NvInferRuntimeCommon.h:676
Application-implemented interface for profiling.
Definition: NvInferRuntime.h:560
virtual void reportLayerTime(const char *layerName, float ms) noexcept=0
Layer time reporting callback.
virtual ~IProfiler() noexcept
Definition: NvInferRuntime.h:570
Updates weights in an engine.
Definition: NvInferRuntime.h:803
int32_t getMaxThreads() const noexcept
get the maximum number of threads that can be used by the refitter.
Definition: NvInferRuntime.h:1063
float getDynamicRangeMin(const char *tensorName) const noexcept
Get minimum of dynamic range.
Definition: NvInferRuntime.h:909
bool setDynamicRange(const char *tensorName, float min, float max) noexcept
Definition: NvInferRuntime.h:897
ILogger * getLogger() const noexcept
get the logger with which the refitter was created
Definition: NvInferRuntime.h:1035
bool refitCudaEngine() noexcept
Updates associated engine. Return true if successful.
Definition: NvInferRuntime.h:832
int32_t getMissing(int32_t size, const char **layerNames, WeightsRole *roles) noexcept
Get description of missing weights.
Definition: NvInferRuntime.h:853
int32_t getTensorsWithDynamicRange(int32_t size, const char **tensorNames) const noexcept
Get names of all tensors that have refittable dynamic ranges.
Definition: NvInferRuntime.h:937
TRT_DEPRECATED void destroy() noexcept
Definition: NvInferRuntime.h:880
bool setMaxThreads(int32_t maxThreads) noexcept
Set the maximum number of threads.
Definition: NvInferRuntime.h:1049
int32_t getAll(int32_t size, const char **layerNames, WeightsRole *roles) noexcept
Get description of all weights that could be refit.
Definition: NvInferRuntime.h:870
int32_t getMissingWeights(int32_t size, const char **weightsNames) noexcept
Get names of missing weights.
Definition: NvInferRuntime.h:1009
bool setNamedWeights(const char *name, Weights weights) noexcept
Specify new weights of given name.
Definition: NvInferRuntime.h:989
apiv::VRefitter * mImpl
Definition: NvInferRuntime.h:1069
virtual ~IRefitter() noexcept=default
float getDynamicRangeMax(const char *tensorName) const noexcept
Get maximum of dynamic range.
Definition: NvInferRuntime.h:921
void setErrorRecorder(IErrorRecorder *recorder) noexcept
Set the ErrorRecorder for this interface.
Definition: NvInferRuntime.h:956
int32_t getAllWeights(int32_t size, const char **weightsNames) noexcept
Get names of all weights that could be refit.
Definition: NvInferRuntime.h:1025
IErrorRecorder * getErrorRecorder() const noexcept
Get the ErrorRecorder assigned to this interface.
Definition: NvInferRuntime.h:971
Allows a serialized functionally unsafe engine to be deserialized.
Definition: NvInferRuntime.h:622
bool setMaxThreads(int32_t maxThreads) noexcept
Set the maximum number of threads.
Definition: NvInferRuntime.h:772
virtual ~IRuntime() noexcept=default
ICudaEngine * deserializeCudaEngine(const void *blob, std::size_t size) noexcept
Deserialize an engine from a stream.
Definition: NvInferRuntime.h:748
TRT_DEPRECATED void destroy() noexcept
Destroy this object.
Definition: NvInferRuntime.h:685
apiv::VRuntime * mImpl
Definition: NvInferRuntime.h:792
void setDLACore(int32_t dlaCore) noexcept
Set the DLA core that the deserialized engine must execute on.
Definition: NvInferRuntime.h:654
int32_t getNbDLACores() const noexcept
Returns number of DLA hardware cores accessible.
Definition: NvInferRuntime.h:673
int32_t getDLACore() const noexcept
Get the DLA core that the engine executes on.
Definition: NvInferRuntime.h:665
void setGpuAllocator(IGpuAllocator *allocator) noexcept
Set the GPU allocator.
Definition: NvInferRuntime.h:699
IErrorRecorder * getErrorRecorder() const noexcept
get the ErrorRecorder assigned to this interface.
Definition: NvInferRuntime.h:733
ILogger * getLogger() const noexcept
get the logger with which the runtime was created
Definition: NvInferRuntime.h:758
int32_t getMaxThreads() const noexcept
Get the maximum number of threads that can be used by the runtime.
Definition: NvInferRuntime.h:786
void setErrorRecorder(IErrorRecorder *recorder) noexcept
Set the ErrorRecorder for this interface.
Definition: NvInferRuntime.h:718
Register the plugin creator to the registry The static registry object will be instantiated when the ...
Definition: NvInferRuntime.h:2668
PluginRegistrar()
Definition: NvInferRuntime.h:2670
An array of weights used as a layer parameter.
Definition: NvInferRuntime.h:126
DataType type
The type of the weights.
Definition: NvInferRuntime.h:128
int64_t count
The number of weights in the array.
Definition: NvInferRuntime.h:130
const void * values
The weight values, in a contiguous array.
Definition: NvInferRuntime.h:129
IRuntime * createInferRuntime(ILogger &logger) noexcept
Create an instance of an safe::IRuntime class.
The TensorRT API version 1 namespace.
uint32_t TacticSources
Represents a collection of one or more TacticSource values combine using bitwise-OR operations.
Definition: NvInferRuntime.h:1304
EngineCapability
List of supported engine capability flows.
Definition: NvInferRuntime.h:69
DimensionOperation
An operation on two IDimensionExpr, which represent integer expressions used in dimension computation...
Definition: NvInferRuntime.h:192
@ kSUB
Substract the second element from the first.
@ kSUM
Sum of the two operands.
@ kPROD
Product of the two operands.
@ kFLOOR_DIV
Floor division of the first element by the second.
@ kEQUAL
1 if operands are equal, 0 otherwise.
@ kMIN
Minimum of the two operands.
@ kLESS
1 if first operand is less than second operand, 0 otherwise.
@ kMAX
Maximum of the two operands.
@ kCEIL_DIV
Division rounding up.
constexpr int32_t EnumMax< WeightsRole >() noexcept
Maximum number of elements in WeightsRole enum.
Definition: NvInferRuntime.h:591
char_t AsciiChar
AsciiChar is the type used by TensorRT to represent valid ASCII characters.
Definition: NvInferRuntimeCommon.h:88
@ kV2_DYNAMICEXT
IPluginV2DynamicExt.
constexpr int32_t EnumMax< LayerInformationFormat >() noexcept
Definition: NvInferRuntime.h:2460
DataType
The type of weights and tensors.
Definition: NvInferRuntimeCommon.h:114
DeviceType
The device that this layer/network will execute on.
Definition: NvInferRuntime.h:602
@ kCONSTANT
Constant layer.
@ kDEFAULT
Similar to ONNX Gather.
constexpr int32_t EnumMax< OptProfileSelector >() noexcept
Number of different values of OptProfileSelector enum.
Definition: NvInferRuntime.h:1095
WeightsRole
How a layer uses particular Weights.
Definition: NvInferRuntime.h:580
@ kSHIFT
shift part of IScaleLayer
@ kANY
Any other weights role.
@ kBIAS
bias for IConvolutionLayer, IDeconvolutionLayer, or IFullyConnectedLayer
@ kKERNEL
kernel for IConvolutionLayer, IDeconvolutionLayer, or IFullyConnectedLayer
constexpr int32_t EnumMax< ProfilingVerbosity >() noexcept
Maximum number of profile verbosity levels in ProfilingVerbosity enum.
Definition: NvInferRuntime.h:1329
ProfilingVerbosity
List of verbosity levels of layer information exposed in NVTX annotations and in IEngineInspector.
Definition: NvInferRuntime.h:1316
@ kLAYER_NAMES_ONLY
Print only the layer names. This is the default setting.
@ kDETAILED
Print detailed layer information including layer names and layer parameters.
TacticSource
List of tactic sources for TensorRT.
Definition: NvInferRuntime.h:1285
@ kCUBLAS_LT
cuBLAS LT tactics
TensorFormat PluginFormat
PluginFormat is reserved for backward compatibility.
Definition: NvInferRuntimeCommon.h:308
@ kMIN
Minimum of the two elements.
TensorFormat
Format of the input/output tensors.
Definition: NvInferRuntimeCommon.h:184
constexpr int32_t EnumMax< TacticSource >() noexcept
Maximum number of tactic sources in TacticSource enum.
Definition: NvInferRuntime.h:1293
LayerInformationFormat
The format in which the IEngineInspector prints the layer information.
Definition: NvInferRuntime.h:2452
@ kJSON
Print layer information in JSON format.
@ kONELINE
Print layer information in one line per layer.
constexpr int32_t EnumMax< DeviceType >() noexcept
Maximum number of elements in DeviceType enum.
Definition: NvInferRuntime.h:609
constexpr int32_t EnumMax< DimensionOperation >() noexcept
Maximum number of elements in DimensionOperation enum.
Definition: NvInferRuntime.h:206
TensorLocation
The location for tensor data storage, device or host.
Definition: NvInferRuntime.h:216
@ kHOST
Data stored on host.
@ kDEVICE
Data stored on device.
OptProfileSelector
When setting or querying optimization profile parameters (such as shape tensor inputs or dynamic dime...
Definition: NvInferRuntime.h:1083
@ kOPT
This is used to set or get the value that is used in the optimization (kernel selection).
Definition: NvInferRuntime.h:321
Dims min
Lower bounds on tensor’s dimensions.
Definition: NvInferRuntime.h:326
Dims max
Upper bounds on tensor’s dimensions.
Definition: NvInferRuntime.h:329
PluginTensorDesc desc
Information required to interpret a pointer to tensor data, except that desc.dims has -1 in place of ...
Definition: NvInferRuntime.h:323
Fields that a plugin might see for an input or output.
Definition: NvInferRuntimeCommon.h:332
Declaration of EnumMaxImpl struct to store maximum number of elements in an enumeration type.
Definition: NvInferRuntimeCommon.h:99