50#ifndef NV_INFER_RUNTIME_H
51#define NV_INFER_RUNTIME_H
59#include "NvInferImpl.h"
65class IExecutionContext;
68class IEngineInspector;
144 static constexpr int32_t kVALUE = 3;
188 return mImpl->data();
192 std::size_t
size() const noexcept
194 return mImpl->size();
200 return mImpl->type();
264 static constexpr int32_t kVALUE = 2;
286 return mImpl->isConstant();
293 return mImpl->getConstantValue();
324 return mImpl->constant(value);
332 return mImpl->operation(op, first, second);
423 static constexpr int32_t kFORMAT_COMBINATION_LIMIT = 100;
457 virtual
bool supportsFormatCombination(
458 int32_t pos, const
PluginTensorDesc* inOut, int32_t nbInputs, int32_t nbOutputs) noexcept
513 int32_t nbOutputs) const noexcept
529 const
void* const* inputs,
void* const* outputs,
void* workspace, cudaStream_t stream) noexcept
540 int32_t getTensorRTVersion() const noexcept
override
551 bool const*,
PluginFormat, int32_t)
noexcept override final
560 Dims getOutputDimensions(int32_t,
Dims const*, int32_t)
noexcept override final
565 bool isOutputBroadcastAcrossBatch(int32_t,
bool const*, int32_t)
const noexcept override final
570 bool canBroadcastInputAcrossBatch(int32_t)
const noexcept override final
575 size_t getWorkspaceSize(int32_t)
const noexcept override final
580 int32_t enqueue(int32_t,
const void*
const*,
void*
const*,
void*, cudaStream_t)
noexcept override final
679 const
void* blob, std::
size_t size, IPluginFactory* pluginFactory) noexcept
681 return mImpl->deserializeCudaEngine(blob, size,
nullptr);
693 mImpl->setDLACore(dlaCore);
704 return mImpl->getDLACore();
712 return mImpl->getNbDLACores();
738 mImpl->setGpuAllocator(allocator);
757 mImpl->setErrorRecorder(recorder);
772 return mImpl->getErrorRecorder();
787 return mImpl->deserializeCudaEngine(blob, size,
nullptr);
797 return mImpl->getLogger();
811 return mImpl->setMaxThreads(maxThreads);
825 return mImpl->getMaxThreads();
856 return mImpl->setWeights(layerName, role, weights);
871 return mImpl->refitCudaEngine();
892 return mImpl->getMissing(size, layerNames, roles);
909 return mImpl->getAll(size, layerNames, roles);
936 return mImpl->setDynamicRange(tensorName, min, max);
948 return mImpl->getDynamicRangeMin(tensorName);
960 return mImpl->getDynamicRangeMax(tensorName);
976 return mImpl->getTensorsWithDynamicRange(size, tensorNames);
995 mImpl->setErrorRecorder(recorder);
1010 return mImpl->getErrorRecorder();
1028 return mImpl->setNamedWeights(name, weights);
1048 return mImpl->getMissingWeights(size, weightsNames);
1064 return mImpl->getAllWeights(size, weightsNames);
1074 return mImpl->getLogger();
1088 return mImpl->setMaxThreads(maxThreads);
1102 return mImpl->getMaxThreads();
1189 return mImpl->setDimensions(inputName, select, dims);
1199 return mImpl->getDimensions(inputName, select);
1241 const char* inputName,
OptProfileSelector select,
const int32_t* values, int32_t nbValues)
noexcept
1243 return mImpl->setShapeValues(inputName, select, values, nbValues);
1254 return mImpl->getNbShapeValues(inputName);
1264 return mImpl->getShapeValues(inputName, select);
1282 return mImpl->setExtraMemoryTarget(target);
1290 return mImpl->getExtraMemoryTarget();
1306 return mImpl->isValid();
1393 int32_t getNbBindings() const noexcept
1395 return mImpl->getNbBindings();
1417 return mImpl->getBindingIndex(name);
1437 return mImpl->getBindingName(bindingIndex);
1450 return mImpl->bindingIsInput(bindingIndex);
1475 return mImpl->getBindingDimensions(bindingIndex);
1488 return mImpl->getBindingDataType(bindingIndex);
1500 return mImpl->getMaxBatchSize();
1514 return mImpl->getNbLayers();
1528 return mImpl->serialize();
1544 return mImpl->createExecutionContext();
1571 return mImpl->getLocation(bindingIndex);
1580 return mImpl->createExecutionContextWithoutDeviceMemory();
1590 return mImpl->getDeviceMemorySize();
1600 return mImpl->isRefittable();
1614 return mImpl->getBindingBytesPerComponent(bindingIndex);
1628 return mImpl->getBindingComponentsPerElement(bindingIndex);
1638 return mImpl->getBindingFormat(bindingIndex);
1657 return mImpl->getBindingFormatDesc(bindingIndex);
1669 return mImpl->getBindingVectorizedDim(bindingIndex);
1684 return mImpl->getName();
1695 return mImpl->getNbOptimizationProfiles();
1722 return mImpl->getProfileDimensions(bindingIndex, profileIndex, select);
1749 return mImpl->getProfileShapeValues(profileIndex, inputIndex, select);
1785 return mImpl->isShapeBinding(bindingIndex);
1799 return mImpl->isExecutionBinding(bindingIndex);
1814 return mImpl->getEngineCapability();
1832 return mImpl->setErrorRecorder(recorder);
1847 return mImpl->getErrorRecorder();
1866 return mImpl->hasImplicitBatchDimension();
1875 return mImpl->getTacticSources();
1886 return mImpl->getProfilingVerbosity();
1896 return mImpl->createEngineInspector();
1935 bool execute(int32_t batchSize,
void* const* bindings) noexcept
1937 return mImpl->execute(batchSize, bindings);
1964 bool enqueue(int32_t batchSize,
void*
const* bindings, cudaStream_t stream, cudaEvent_t* inputConsumed)
noexcept
1966 return mImpl->enqueue(batchSize, bindings, stream, inputConsumed);
1979 mImpl->setDebugSync(sync);
1989 return mImpl->getDebugSync();
1999 mImpl->setProfiler(profiler);
2009 return mImpl->getProfiler();
2019 return mImpl->getEngine();
2043 mImpl->setName(name);
2053 return mImpl->getName();
2069 mImpl->setDeviceMemory(memory);
2090 return mImpl->getStrides(bindingIndex);
2133 return mImpl->setOptimizationProfile(profileIndex);
2145 return mImpl->getOptimizationProfile();
2182 return mImpl->setBindingDimensions(bindingIndex, dimensions);
2212 return mImpl->getBindingDimensions(bindingIndex);
2242 return mImpl->setInputShapeBinding(bindingIndex, data);
2264 return mImpl->getShapeBinding(bindingIndex, data);
2279 return mImpl->allInputDimensionsSpecified();
2294 return mImpl->allInputShapesSpecified();
2313 mImpl->setErrorRecorder(recorder);
2328 return mImpl->getErrorRecorder();
2345 return mImpl->executeV2(bindings);
2371 bool enqueueV2(
void*
const* bindings, cudaStream_t stream, cudaEvent_t* inputConsumed)
noexcept
2373 return mImpl->enqueueV2(bindings, stream, inputConsumed);
2421 return mImpl->setOptimizationProfileAsync(profileIndex, stream);
2436 mImpl->setEnqueueEmitsProfile(enqueueEmitsProfile);
2447 return mImpl->getEnqueueEmitsProfile();
2474 return mImpl->reportToProfiler();
2536 return mImpl->setExecutionContext(context);
2548 return mImpl->getExecutionContext();
2573 return mImpl->getLayerInformation(layerIndex, format);
2598 return mImpl->getEngineInformation(format);
2617 mImpl->setErrorRecorder(recorder);
2632 return mImpl->getErrorRecorder();
2645extern "C" TENSORRTAPI void* createInferRuntime_INTERNAL(
void* logger, int32_t version)
noexcept;
2651extern "C" TENSORRTAPI void* createInferRefitter_INTERNAL(
void* engine,
void* logger, int32_t version)
noexcept;
2685inline IRefitter* createInferRefitter(ICudaEngine& engine, ILogger& logger)
noexcept
2687 return static_cast<IRefitter*
>(createInferRefitter_INTERNAL(&engine, &logger,
NV_TENSORRT_VERSION));
2703template <
typename T>
2719#define REGISTER_TENSORRT_PLUGIN(name) \
2720 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:91
#define NV_TENSORRT_VERSION
Definition: NvInferRuntimeCommon.h:110
#define TRT_DEPRECATED
Definition: NvInferRuntimeCommon.h:77
#define TRT_DEPRECATED_ENUM
Definition: NvInferRuntimeCommon.h:78
Structure to define the dimensions of a tensor.
Definition: NvInferRuntimeCommon.h:190
static constexpr int32_t MAX_DIMS
The maximum rank (number of dimensions) supported for a tensor.
Definition: NvInferRuntimeCommon.h:193
Definition: NvInferRuntime.h:346
int32_t nbDims
The number of dimensions.
Definition: NvInferRuntime.h:348
An engine for executing inference on a built network, with functionally unsafe features.
Definition: NvInferRuntime.h:1379
int32_t getBindingBytesPerComponent(int32_t bindingIndex) const noexcept
Return the number of bytes per component of an element.
Definition: NvInferRuntime.h:1612
int32_t getBindingComponentsPerElement(int32_t bindingIndex) const noexcept
Return the number of components included in one element.
Definition: NvInferRuntime.h:1626
bool isShapeBinding(int32_t bindingIndex) const noexcept
True if tensor is required as input for shape calculations or output from them.
Definition: NvInferRuntime.h:1783
bool hasImplicitBatchDimension() const noexcept
Query whether the engine was built with an implicit batch dimension.
Definition: NvInferRuntime.h:1864
const char * getName() const noexcept
Returns the name of the network associated with the engine.
Definition: NvInferRuntime.h:1682
EngineCapability getEngineCapability() const noexcept
Determine what execution capability this engine has.
Definition: NvInferRuntime.h:1812
TRT_DEPRECATED void destroy() noexcept
Destroy this object;.
Definition: NvInferRuntime.h:1554
IErrorRecorder * getErrorRecorder() const noexcept
Get the ErrorRecorder assigned to this interface.
Definition: NvInferRuntime.h:1845
TensorFormat getBindingFormat(int32_t bindingIndex) const noexcept
Return the binding format.
Definition: NvInferRuntime.h:1636
apiv::VCudaEngine * mImpl
Definition: NvInferRuntime.h:1900
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:1746
TensorLocation getLocation(int32_t bindingIndex) const noexcept
Get location of binding.
Definition: NvInferRuntime.h:1569
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:1720
Dims getBindingDimensions(int32_t bindingIndex) const noexcept
Get the dimensions of a binding.
Definition: NvInferRuntime.h:1473
int32_t getBindingVectorizedDim(int32_t bindingIndex) const noexcept
Return the dimension index that the buffer is vectorized.
Definition: NvInferRuntime.h:1667
int32_t getMaxBatchSize() const noexcept
Get the maximum batch size which can be used for inference.
Definition: NvInferRuntime.h:1498
void setErrorRecorder(IErrorRecorder *recorder) noexcept
Set the ErrorRecorder for this interface.
Definition: NvInferRuntime.h:1830
size_t getDeviceMemorySize() const noexcept
Return the amount of device memory required by an execution context.
Definition: NvInferRuntime.h:1588
TacticSources getTacticSources() const noexcept
return the tactic sources required by this engine
Definition: NvInferRuntime.h:1873
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:1884
IHostMemory * serialize() const noexcept
Serialize the network to a stream.
Definition: NvInferRuntime.h:1526
IExecutionContext * createExecutionContextWithoutDeviceMemory() noexcept
create an execution context without any device memory allocated
Definition: NvInferRuntime.h:1578
int32_t getBindingIndex(const char *name) const noexcept
Retrieve the binding index for a named tensor.
Definition: NvInferRuntime.h:1415
DataType getBindingDataType(int32_t bindingIndex) const noexcept
Determine the required data type for a buffer from its binding index.
Definition: NvInferRuntime.h:1486
IExecutionContext * createExecutionContext() noexcept
Create an execution context.
Definition: NvInferRuntime.h:1542
IEngineInspector * createEngineInspector() const noexcept
Create a new engine inspector which prints the layer information in an engine or an execution context...
Definition: NvInferRuntime.h:1894
const char * getBindingName(int32_t bindingIndex) const noexcept
Retrieve the name corresponding to a binding index.
Definition: NvInferRuntime.h:1435
int32_t getNbOptimizationProfiles() const noexcept
Get the number of optimization profiles defined for this engine.
Definition: NvInferRuntime.h:1693
int32_t getNbLayers() const noexcept
Get the number of layers in the network.
Definition: NvInferRuntime.h:1512
const char * getBindingFormatDesc(int32_t bindingIndex) const noexcept
Return the human readable description of the tensor format.
Definition: NvInferRuntime.h:1655
bool bindingIsInput(int32_t bindingIndex) const noexcept
Determine whether a binding is an input binding.
Definition: NvInferRuntime.h:1448
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:1797
bool isRefittable() const noexcept
Return true if an engine can be refit.
Definition: NvInferRuntime.h:1598
Definition: NvInferRuntime.h:281
bool isConstant() const noexcept
Return true if expression is a build-time constant.
Definition: NvInferRuntime.h:284
virtual ~IDimensionExpr() noexcept=default
apiv::VDimensionExpr * mImpl
Definition: NvInferRuntime.h:297
int32_t getConstantValue() const noexcept
Definition: NvInferRuntime.h:291
An engine inspector which prints out the layer information of an engine or an execution context.
Definition: NvInferRuntime.h:2518
IErrorRecorder * getErrorRecorder() const noexcept
Get the ErrorRecorder assigned to this interface.
Definition: NvInferRuntime.h:2630
void setErrorRecorder(IErrorRecorder *recorder) noexcept
Set the ErrorRecorder for this interface.
Definition: NvInferRuntime.h:2615
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:2596
IExecutionContext const * getExecutionContext() const noexcept
Get the context currently being inspected.
Definition: NvInferRuntime.h:2546
apiv::VEngineInspector * mImpl
Definition: NvInferRuntime.h:2636
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:2571
Reference counted application-implemented error reporting interface for TensorRT objects.
Definition: NvInferRuntimeCommon.h:1699
Context for executing inference using an engine, with functionally unsafe features.
Definition: NvInferRuntime.h:1914
IErrorRecorder * getErrorRecorder() const noexcept
Get the ErrorRecorder assigned to this interface.
Definition: NvInferRuntime.h:2326
bool reportToProfiler() const noexcept
Calculate layer timing info for the current optimization profile in IExecutionContext and update the ...
Definition: NvInferRuntime.h:2472
virtual ~IExecutionContext() noexcept=default
void setDeviceMemory(void *memory) noexcept
Set the device memory for use by this execution context.
Definition: NvInferRuntime.h:2067
Dims getBindingDimensions(int32_t bindingIndex) const noexcept
Get the dynamic dimensions of a binding.
Definition: NvInferRuntime.h:2210
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:2262
void setDebugSync(bool sync) noexcept
Set the debug sync flag.
Definition: NvInferRuntime.h:1977
bool enqueueV2(void *const *bindings, cudaStream_t stream, cudaEvent_t *inputConsumed) noexcept
Asynchronously execute inference.
Definition: NvInferRuntime.h:2371
void setEnqueueEmitsProfile(bool enqueueEmitsProfile) noexcept
Set whether enqueue emits layer timing to the profiler.
Definition: NvInferRuntime.h:2434
bool setBindingDimensions(int32_t bindingIndex, Dims dimensions) noexcept
Set the dynamic dimensions of a binding.
Definition: NvInferRuntime.h:2180
bool setInputShapeBinding(int32_t bindingIndex, int32_t const *data) noexcept
Set values of input tensor required by shape calculations.
Definition: NvInferRuntime.h:2240
bool executeV2(void *const *bindings) noexcept
Synchronously execute inference a network.
Definition: NvInferRuntime.h:2343
bool getEnqueueEmitsProfile() const noexcept
Get the enqueueEmitsProfile state.
Definition: NvInferRuntime.h:2445
bool setOptimizationProfileAsync(int32_t profileIndex, cudaStream_t stream) noexcept
Select an optimization profile for the current context with async semantics.
Definition: NvInferRuntime.h:2419
apiv::VExecutionContext * mImpl
Definition: NvInferRuntime.h:2478
int32_t getOptimizationProfile() const noexcept
Get the index of the currently selected optimization profile.
Definition: NvInferRuntime.h:2143
bool enqueue(int32_t batchSize, void *const *bindings, cudaStream_t stream, cudaEvent_t *inputConsumed) noexcept
Asynchronously execute inference on a batch.
Definition: NvInferRuntime.h:1964
TRT_DEPRECATED void destroy() noexcept
Destroy this object.
Definition: NvInferRuntime.h:2029
bool getDebugSync() const noexcept
Get the debug sync flag.
Definition: NvInferRuntime.h:1987
const char * getName() const noexcept
Return the name of the execution context.
Definition: NvInferRuntime.h:2051
Dims getStrides(int32_t bindingIndex) const noexcept
Return the strides of the buffer for the given binding.
Definition: NvInferRuntime.h:2088
IProfiler * getProfiler() const noexcept
Get the profiler.
Definition: NvInferRuntime.h:2007
void setErrorRecorder(IErrorRecorder *recorder) noexcept
Set the ErrorRecorder for this interface.
Definition: NvInferRuntime.h:2311
TRT_DEPRECATED bool setOptimizationProfile(int32_t profileIndex) noexcept
Select an optimization profile for the current context.
Definition: NvInferRuntime.h:2131
bool allInputDimensionsSpecified() const noexcept
Whether all dynamic dimensions of input tensors have been specified.
Definition: NvInferRuntime.h:2277
const ICudaEngine & getEngine() const noexcept
Get the associated engine.
Definition: NvInferRuntime.h:2017
void setProfiler(IProfiler *profiler) noexcept
Set the profiler.
Definition: NvInferRuntime.h:1997
bool allInputShapesSpecified() const noexcept
Whether all input shape bindings have been specified.
Definition: NvInferRuntime.h:2291
void setName(const char *name) noexcept
Set the name of the execution context.
Definition: NvInferRuntime.h:2041
Definition: NvInferRuntime.h:319
const IDimensionExpr * constant(int32_t value) noexcept
Return pointer to IDimensionExp for given value.
Definition: NvInferRuntime.h:322
virtual ~IExprBuilder() noexcept=default
apiv::VExprBuilder * mImpl
Definition: NvInferRuntime.h:336
const IDimensionExpr * operation(DimensionOperation op, const IDimensionExpr &first, const IDimensionExpr &second) noexcept
Definition: NvInferRuntime.h:329
Application-implemented class for controlling allocation on the GPU.
Definition: NvInferRuntimeCommon.h:1372
Class to handle library allocated memory that is accessible to the user.
Definition: NvInferRuntime.h:181
void * data() const noexcept
A pointer to the raw data that is owned by the library.
Definition: NvInferRuntime.h:186
DataType type() const noexcept
The type of the memory that was allocated.
Definition: NvInferRuntime.h:198
TRT_DEPRECATED void destroy() noexcept
Definition: NvInferRuntime.h:209
std::size_t size() const noexcept
The size in bytes of the data that was allocated.
Definition: NvInferRuntime.h:192
apiv::VHostMemory * mImpl
Definition: NvInferRuntime.h:215
virtual ~IHostMemory() noexcept=default
Application-implemented logging interface for the builder, refitter and runtime.
Definition: NvInferRuntimeCommon.h:1510
Forward declaration of IEngineInspector for use by other interfaces.
Definition: NvInferRuntime.h:80
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:1160
apiv::VOptimizationProfile * mImpl
Definition: NvInferRuntime.h:1310
bool setDimensions(const char *inputName, OptProfileSelector select, Dims dims) noexcept
Set the minimum / optimum / maximum dimensions for a dynamic input tensor.
Definition: NvInferRuntime.h:1187
int32_t getNbShapeValues(const char *inputName) const noexcept
Get the number of values for an input shape tensor.
Definition: NvInferRuntime.h:1252
virtual ~IOptimizationProfile() noexcept=default
float getExtraMemoryTarget() const noexcept
Get the extra memory target that has been defined for this profile.
Definition: NvInferRuntime.h:1288
Dims getDimensions(const char *inputName, OptProfileSelector select) const noexcept
Get the minimum / optimum / maximum dimensions for a dynamic input tensor.
Definition: NvInferRuntime.h:1197
bool setExtraMemoryTarget(float target) noexcept
Set a target for extra GPU memory that may be used by this profile.
Definition: NvInferRuntime.h:1280
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:1262
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:1240
bool isValid() const noexcept
Check whether the optimization profile can be passed to an IBuilderConfig object.
Definition: NvInferRuntime.h:1304
Single registration point for all plugins in an application. It is used to find plugin implementation...
Definition: NvInferRuntimeCommon.h:1244
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:388
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:545
Plugin class for user-implemented layers.
Definition: NvInferRuntimeCommon.h:714
Application-implemented interface for profiling.
Definition: NvInferRuntime.h:597
virtual void reportLayerTime(const char *layerName, float ms) noexcept=0
Layer time reporting callback.
virtual ~IProfiler() noexcept
Definition: NvInferRuntime.h:607
Updates weights in an engine.
Definition: NvInferRuntime.h:840
int32_t getMaxThreads() const noexcept
get the maximum number of threads that can be used by the refitter.
Definition: NvInferRuntime.h:1100
float getDynamicRangeMin(const char *tensorName) const noexcept
Get minimum of dynamic range.
Definition: NvInferRuntime.h:946
bool setDynamicRange(const char *tensorName, float min, float max) noexcept
Definition: NvInferRuntime.h:934
ILogger * getLogger() const noexcept
get the logger with which the refitter was created
Definition: NvInferRuntime.h:1072
bool refitCudaEngine() noexcept
Updates associated engine. Return true if successful.
Definition: NvInferRuntime.h:869
int32_t getMissing(int32_t size, const char **layerNames, WeightsRole *roles) noexcept
Get description of missing weights.
Definition: NvInferRuntime.h:890
int32_t getTensorsWithDynamicRange(int32_t size, const char **tensorNames) const noexcept
Get names of all tensors that have refittable dynamic ranges.
Definition: NvInferRuntime.h:974
TRT_DEPRECATED void destroy() noexcept
Definition: NvInferRuntime.h:917
bool setMaxThreads(int32_t maxThreads) noexcept
Set the maximum number of threads.
Definition: NvInferRuntime.h:1086
int32_t getAll(int32_t size, const char **layerNames, WeightsRole *roles) noexcept
Get description of all weights that could be refit.
Definition: NvInferRuntime.h:907
int32_t getMissingWeights(int32_t size, const char **weightsNames) noexcept
Get names of missing weights.
Definition: NvInferRuntime.h:1046
bool setNamedWeights(const char *name, Weights weights) noexcept
Specify new weights of given name.
Definition: NvInferRuntime.h:1026
apiv::VRefitter * mImpl
Definition: NvInferRuntime.h:1106
virtual ~IRefitter() noexcept=default
float getDynamicRangeMax(const char *tensorName) const noexcept
Get maximum of dynamic range.
Definition: NvInferRuntime.h:958
void setErrorRecorder(IErrorRecorder *recorder) noexcept
Set the ErrorRecorder for this interface.
Definition: NvInferRuntime.h:993
int32_t getAllWeights(int32_t size, const char **weightsNames) noexcept
Get names of all weights that could be refit.
Definition: NvInferRuntime.h:1062
IErrorRecorder * getErrorRecorder() const noexcept
Get the ErrorRecorder assigned to this interface.
Definition: NvInferRuntime.h:1008
Allows a serialized functionally unsafe engine to be deserialized.
Definition: NvInferRuntime.h:659
bool setMaxThreads(int32_t maxThreads) noexcept
Set the maximum number of threads.
Definition: NvInferRuntime.h:809
virtual ~IRuntime() noexcept=default
ICudaEngine * deserializeCudaEngine(const void *blob, std::size_t size) noexcept
Deserialize an engine from a stream.
Definition: NvInferRuntime.h:785
TRT_DEPRECATED void destroy() noexcept
Destroy this object.
Definition: NvInferRuntime.h:722
apiv::VRuntime * mImpl
Definition: NvInferRuntime.h:829
void setDLACore(int32_t dlaCore) noexcept
Set the DLA core that the deserialized engine must execute on.
Definition: NvInferRuntime.h:691
int32_t getNbDLACores() const noexcept
Returns number of DLA hardware cores accessible.
Definition: NvInferRuntime.h:710
int32_t getDLACore() const noexcept
Get the DLA core that the engine executes on.
Definition: NvInferRuntime.h:702
void setGpuAllocator(IGpuAllocator *allocator) noexcept
Set the GPU allocator.
Definition: NvInferRuntime.h:736
IErrorRecorder * getErrorRecorder() const noexcept
get the ErrorRecorder assigned to this interface.
Definition: NvInferRuntime.h:770
ILogger * getLogger() const noexcept
get the logger with which the runtime was created
Definition: NvInferRuntime.h:795
int32_t getMaxThreads() const noexcept
Get the maximum number of threads that can be used by the runtime.
Definition: NvInferRuntime.h:823
void setErrorRecorder(IErrorRecorder *recorder) noexcept
Set the ErrorRecorder for this interface.
Definition: NvInferRuntime.h:755
Register the plugin creator to the registry The static registry object will be instantiated when the ...
Definition: NvInferRuntime.h:2705
PluginRegistrar()
Definition: NvInferRuntime.h:2707
An array of weights used as a layer parameter.
Definition: NvInferRuntime.h:163
DataType type
The type of the weights.
Definition: NvInferRuntime.h:165
int64_t count
The number of weights in the array.
Definition: NvInferRuntime.h:167
const void * values
The weight values, in a contiguous array.
Definition: NvInferRuntime.h:166
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:1341
EngineCapability
List of supported engine capability flows.
Definition: NvInferRuntime.h:106
DimensionOperation
An operation on two IDimensionExpr, which represent integer expressions used in dimension computation...
Definition: NvInferRuntime.h:229
@ 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:628
char_t AsciiChar
AsciiChar is the type used by TensorRT to represent valid ASCII characters.
Definition: NvInferRuntimeCommon.h:125
@ kV2_DYNAMICEXT
IPluginV2DynamicExt.
constexpr int32_t EnumMax< LayerInformationFormat >() noexcept
Definition: NvInferRuntime.h:2497
DataType
The type of weights and tensors.
Definition: NvInferRuntimeCommon.h:151
DeviceType
The device that this layer/network will execute on.
Definition: NvInferRuntime.h:639
@ kCONSTANT
Constant layer.
@ kDEFAULT
Similar to ONNX Gather.
constexpr int32_t EnumMax< OptProfileSelector >() noexcept
Number of different values of OptProfileSelector enum.
Definition: NvInferRuntime.h:1132
WeightsRole
How a layer uses particular Weights.
Definition: NvInferRuntime.h:617
@ 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:1366
ProfilingVerbosity
List of verbosity levels of layer information exposed in NVTX annotations and in IEngineInspector.
Definition: NvInferRuntime.h:1353
@ 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:1322
@ kCUBLAS_LT
cuBLAS LT tactics
TensorFormat PluginFormat
PluginFormat is reserved for backward compatibility.
Definition: NvInferRuntimeCommon.h:345
@ kMIN
Minimum of the two elements.
TensorFormat
Format of the input/output tensors.
Definition: NvInferRuntimeCommon.h:221
constexpr int32_t EnumMax< TacticSource >() noexcept
Maximum number of tactic sources in TacticSource enum.
Definition: NvInferRuntime.h:1330
LayerInformationFormat
The format in which the IEngineInspector prints the layer information.
Definition: NvInferRuntime.h:2489
@ 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:646
constexpr int32_t EnumMax< DimensionOperation >() noexcept
Maximum number of elements in DimensionOperation enum.
Definition: NvInferRuntime.h:243
TensorLocation
The location for tensor data storage, device or host.
Definition: NvInferRuntime.h:253
@ 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:1120
@ kOPT
This is used to set or get the value that is used in the optimization (kernel selection).
Definition: NvInferRuntime.h:358
Dims min
Lower bounds on tensor’s dimensions.
Definition: NvInferRuntime.h:363
Dims max
Upper bounds on tensor’s dimensions.
Definition: NvInferRuntime.h:366
PluginTensorDesc desc
Information required to interpret a pointer to tensor data, except that desc.dims has -1 in place of ...
Definition: NvInferRuntime.h:360
Fields that a plugin might see for an input or output.
Definition: NvInferRuntimeCommon.h:370
Declaration of EnumMaxImpl struct to store maximum number of elements in an enumeration type.
Definition: NvInferRuntimeCommon.h:136