50#ifndef NV_INFER_RUNTIME_H
51#define NV_INFER_RUNTIME_H
59#include "NvInferImpl.h"
65class IExecutionContext;
68class IEngineInspector;
121 kSAFE_GPU TRT_DEPRECATED_ENUM =
kSAFETY,
138 static constexpr int32_t kVALUE = 3;
182 return mImpl->data();
186 std::size_t
size() const noexcept
188 return mImpl->size();
194 return mImpl->type();
209 apiv::VHostMemory* mImpl;
258 static constexpr int32_t kVALUE = 2;
280 return mImpl->isConstant();
287 return mImpl->getConstantValue();
291 apiv::VDimensionExpr* mImpl;
318 return mImpl->constant(value);
326 return mImpl->operation(op, first, second);
330 apiv::VExprBuilder* mImpl;
417 static constexpr int32_t kFORMAT_COMBINATION_LIMIT = 100;
451 virtual
bool supportsFormatCombination(
452 int32_t pos, const
PluginTensorDesc* inOut, int32_t nbInputs, int32_t nbOutputs) noexcept
507 int32_t nbOutputs) const noexcept
523 const
void* const* inputs,
void* const* outputs,
void* workspace, cudaStream_t stream) noexcept
534 int32_t getTensorRTVersion() const noexcept
override
545 bool const*,
PluginFormat, int32_t)
noexcept override final
554 Dims getOutputDimensions(int32_t,
Dims const*, int32_t)
noexcept override final
559 bool isOutputBroadcastAcrossBatch(int32_t,
bool const*, int32_t)
const noexcept override final
564 bool canBroadcastInputAcrossBatch(int32_t)
const noexcept override final
569 size_t getWorkspaceSize(int32_t)
const noexcept override final
574 int32_t enqueue(int32_t,
const void*
const*,
void*
const*,
void*, cudaStream_t)
noexcept override final
673 const void* blob, std::size_t size, IPluginFactory* pluginFactory)
noexcept
675 return mImpl->deserializeCudaEngine(blob, size,
nullptr);
687 mImpl->setDLACore(dlaCore);
698 return mImpl->getDLACore();
706 return mImpl->getNbDLACores();
732 mImpl->setGpuAllocator(allocator);
751 mImpl->setErrorRecorder(recorder);
766 return mImpl->getErrorRecorder();
781 return mImpl->deserializeCudaEngine(blob, size,
nullptr);
791 return mImpl->getLogger();
795 apiv::VRuntime* mImpl;
822 return mImpl->setWeights(layerName, role, weights);
837 return mImpl->refitCudaEngine();
858 return mImpl->getMissing(size, layerNames, roles);
875 return mImpl->getAll(size, layerNames, roles);
902 return mImpl->setDynamicRange(tensorName, min, max);
914 return mImpl->getDynamicRangeMin(tensorName);
926 return mImpl->getDynamicRangeMax(tensorName);
942 return mImpl->getTensorsWithDynamicRange(size, tensorNames);
961 mImpl->setErrorRecorder(recorder);
976 return mImpl->getErrorRecorder();
994 return mImpl->setNamedWeights(name, weights);
1014 return mImpl->getMissingWeights(size, weightsNames);
1030 return mImpl->getAllWeights(size, weightsNames);
1040 return mImpl->getLogger();
1044 apiv::VRefitter* mImpl;
1066constexpr inline int32_t EnumMax<OptProfileSelector>() noexcept
1123 return mImpl->setDimensions(inputName, select, dims);
1133 return mImpl->getDimensions(inputName, select);
1175 const char* inputName,
OptProfileSelector select,
const int32_t* values, int32_t nbValues)
noexcept
1177 return mImpl->setShapeValues(inputName, select, values, nbValues);
1188 return mImpl->getNbShapeValues(inputName);
1198 return mImpl->getShapeValues(inputName, select);
1216 return mImpl->setExtraMemoryTarget(target);
1224 return mImpl->getExtraMemoryTarget();
1240 return mImpl->isValid();
1244 apiv::VOptimizationProfile* mImpl;
1292 kVERBOSE TRT_DEPRECATED_ENUM =
kDETAILED
1326 return mImpl->getNbBindings();
1348 return mImpl->getBindingIndex(name);
1368 return mImpl->getBindingName(bindingIndex);
1381 return mImpl->bindingIsInput(bindingIndex);
1406 return mImpl->getBindingDimensions(bindingIndex);
1419 return mImpl->getBindingDataType(bindingIndex);
1431 return mImpl->getMaxBatchSize();
1445 return mImpl->getNbLayers();
1459 return mImpl->serialize();
1475 return mImpl->createExecutionContext();
1502 return mImpl->getLocation(bindingIndex);
1511 return mImpl->createExecutionContextWithoutDeviceMemory();
1521 return mImpl->getDeviceMemorySize();
1531 return mImpl->isRefittable();
1545 return mImpl->getBindingBytesPerComponent(bindingIndex);
1559 return mImpl->getBindingComponentsPerElement(bindingIndex);
1569 return mImpl->getBindingFormat(bindingIndex);
1588 return mImpl->getBindingFormatDesc(bindingIndex);
1600 return mImpl->getBindingVectorizedDim(bindingIndex);
1615 return mImpl->getName();
1626 return mImpl->getNbOptimizationProfiles();
1653 return mImpl->getProfileDimensions(bindingIndex, profileIndex, select);
1680 return mImpl->getProfileShapeValues(profileIndex, inputIndex, select);
1716 return mImpl->isShapeBinding(bindingIndex);
1730 return mImpl->isExecutionBinding(bindingIndex);
1745 return mImpl->getEngineCapability();
1763 return mImpl->setErrorRecorder(recorder);
1778 return mImpl->getErrorRecorder();
1797 return mImpl->hasImplicitBatchDimension();
1806 return mImpl->getTacticSources();
1817 return mImpl->getProfilingVerbosity();
1827 return mImpl->createEngineInspector();
1831 apiv::VCudaEngine* mImpl;
1866 bool execute(int32_t batchSize,
void*
const* bindings)
noexcept
1868 return mImpl->execute(batchSize, bindings);
1895 bool enqueue(int32_t batchSize,
void*
const* bindings, cudaStream_t stream, cudaEvent_t* inputConsumed)
noexcept
1897 return mImpl->enqueue(batchSize, bindings, stream, inputConsumed);
1910 mImpl->setDebugSync(sync);
1920 return mImpl->getDebugSync();
1930 mImpl->setProfiler(profiler);
1940 return mImpl->getProfiler();
1950 return mImpl->getEngine();
1974 mImpl->setName(name);
1984 return mImpl->getName();
2000 mImpl->setDeviceMemory(memory);
2021 return mImpl->getStrides(bindingIndex);
2063 return mImpl->setOptimizationProfile(profileIndex);
2075 return mImpl->getOptimizationProfile();
2112 return mImpl->setBindingDimensions(bindingIndex, dimensions);
2142 return mImpl->getBindingDimensions(bindingIndex);
2172 return mImpl->setInputShapeBinding(bindingIndex, data);
2194 return mImpl->getShapeBinding(bindingIndex, data);
2209 return mImpl->allInputDimensionsSpecified();
2224 return mImpl->allInputShapesSpecified();
2243 mImpl->setErrorRecorder(recorder);
2258 return mImpl->getErrorRecorder();
2275 return mImpl->executeV2(bindings);
2301 bool enqueueV2(
void*
const* bindings, cudaStream_t stream, cudaEvent_t* inputConsumed)
noexcept
2303 return mImpl->enqueueV2(bindings, stream, inputConsumed);
2351 return mImpl->setOptimizationProfileAsync(profileIndex, stream);
2366 mImpl->setEnqueueEmitsProfile(enqueueEmitsProfile);
2377 return mImpl->getEnqueueEmitsProfile();
2404 return mImpl->reportToProfiler();
2408 apiv::VExecutionContext* mImpl;
2466 return mImpl->setExecutionContext(context);
2478 return mImpl->getExecutionContext();
2503 return mImpl->getLayerInformation(layerIndex, format);
2528 return mImpl->getEngineInformation(format);
2547 mImpl->setErrorRecorder(recorder);
2562 return mImpl->getErrorRecorder();
2566 apiv::VEngineInspector* mImpl;
2575extern "C" TENSORRTAPI
void* createInferRuntime_INTERNAL(
void* logger, int32_t version)
noexcept;
2581extern "C" TENSORRTAPI
void* createInferRefitter_INTERNAL(
void* engine,
void* logger, int32_t version)
noexcept;
2607 return static_cast<IRuntime*
>(createInferRuntime_INTERNAL(&logger, NV_TENSORRT_VERSION));
2617 return static_cast<IRefitter*
>(createInferRefitter_INTERNAL(&engine, &logger, NV_TENSORRT_VERSION));
2633template <
typename T>
2649#define REGISTER_TENSORRT_PLUGIN(name) \
2650 static nvinfer1::PluginRegistrar<name> pluginRegistrar##name {}
nvinfer1::ILogger * getLogger() noexcept
Return the logger object.
nvinfer1::IPluginRegistry * getPluginRegistry() noexcept
Return the plugin registry.
#define TRT_DEPRECATED
< Items that are marked as deprecated will be removed in a future release.
Definition: NvInferRuntimeCommon.h:77
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:340
int32_t nbDims
The number of dimensions.
Definition: NvInferRuntime.h:342
An engine for executing inference on a built network, with functionally unsafe features.
Definition: NvInferRuntime.h:1310
int32_t getBindingBytesPerComponent(int32_t bindingIndex) const noexcept
Return the number of bytes per component of an element.
Definition: NvInferRuntime.h:1543
int32_t getBindingComponentsPerElement(int32_t bindingIndex) const noexcept
Return the number of components included in one element.
Definition: NvInferRuntime.h:1557
bool isShapeBinding(int32_t bindingIndex) const noexcept
True if tensor is required as input for shape calculations or output from them.
Definition: NvInferRuntime.h:1714
bool hasImplicitBatchDimension() const noexcept
Query whether the engine was built with an implicit batch dimension.
Definition: NvInferRuntime.h:1795
const char * getName() const noexcept
Returns the name of the network associated with the engine.
Definition: NvInferRuntime.h:1613
EngineCapability getEngineCapability() const noexcept
Determine what execution capability this engine has.
Definition: NvInferRuntime.h:1743
TRT_DEPRECATED void destroy() noexcept
Destroy this object;.
Definition: NvInferRuntime.h:1485
IErrorRecorder * getErrorRecorder() const noexcept
Get the ErrorRecorder assigned to this interface.
Definition: NvInferRuntime.h:1776
TensorFormat getBindingFormat(int32_t bindingIndex) const noexcept
Return the binding format.
Definition: NvInferRuntime.h:1567
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:1677
int32_t getNbBindings() const noexcept
Get the number of binding indices.
Definition: NvInferRuntime.h:1324
TensorLocation getLocation(int32_t bindingIndex) const noexcept
Get location of binding.
Definition: NvInferRuntime.h:1500
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:1651
Dims getBindingDimensions(int32_t bindingIndex) const noexcept
Get the dimensions of a binding.
Definition: NvInferRuntime.h:1404
int32_t getBindingVectorizedDim(int32_t bindingIndex) const noexcept
Return the dimension index that the buffer is vectorized.
Definition: NvInferRuntime.h:1598
int32_t getMaxBatchSize() const noexcept
Get the maximum batch size which can be used for inference.
Definition: NvInferRuntime.h:1429
void setErrorRecorder(IErrorRecorder *recorder) noexcept
Set the ErrorRecorder for this interface.
Definition: NvInferRuntime.h:1761
size_t getDeviceMemorySize() const noexcept
Return the amount of device memory required by an execution context.
Definition: NvInferRuntime.h:1519
TacticSources getTacticSources() const noexcept
return the tactic sources required by this engine
Definition: NvInferRuntime.h:1804
ProfilingVerbosity getProfilingVerbosity() const noexcept
Return the ProfilingVerbosity the builder config was set to when the engine was built.
Definition: NvInferRuntime.h:1815
IHostMemory * serialize() const noexcept
Serialize the network to a stream.
Definition: NvInferRuntime.h:1457
IExecutionContext * createExecutionContextWithoutDeviceMemory() noexcept
create an execution context without any device memory allocated
Definition: NvInferRuntime.h:1509
int32_t getBindingIndex(const char *name) const noexcept
Retrieve the binding index for a named tensor.
Definition: NvInferRuntime.h:1346
DataType getBindingDataType(int32_t bindingIndex) const noexcept
Determine the required data type for a buffer from its binding index.
Definition: NvInferRuntime.h:1417
IExecutionContext * createExecutionContext() noexcept
Create an execution context.
Definition: NvInferRuntime.h:1473
IEngineInspector * createEngineInspector() const noexcept
Create a new engine inspector which prints the layer information in an engine or an execution context...
Definition: NvInferRuntime.h:1825
const char * getBindingName(int32_t bindingIndex) const noexcept
Retrieve the name corresponding to a binding index.
Definition: NvInferRuntime.h:1366
int32_t getNbOptimizationProfiles() const noexcept
Get the number of optimization profiles defined for this engine.
Definition: NvInferRuntime.h:1624
int32_t getNbLayers() const noexcept
Get the number of layers in the network.
Definition: NvInferRuntime.h:1443
const char * getBindingFormatDesc(int32_t bindingIndex) const noexcept
Return the human readable description of the tensor format.
Definition: NvInferRuntime.h:1586
bool bindingIsInput(int32_t bindingIndex) const noexcept
Determine whether a binding is an input binding.
Definition: NvInferRuntime.h:1379
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:1728
bool isRefittable() const noexcept
Return true if an engine can be refit.
Definition: NvInferRuntime.h:1529
Definition: NvInferRuntime.h:275
bool isConstant() const noexcept
Return true if expression is a build-time constant.
Definition: NvInferRuntime.h:278
int32_t getConstantValue() const noexcept
Definition: NvInferRuntime.h:285
An engine inspector which prints out the layer information of an engine or an execution context.
Definition: NvInferRuntime.h:2448
IErrorRecorder * getErrorRecorder() const noexcept
Get the ErrorRecorder assigned to this interface.
Definition: NvInferRuntime.h:2560
void setErrorRecorder(IErrorRecorder *recorder) noexcept
Set the ErrorRecorder for this interface.
Definition: NvInferRuntime.h:2545
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:2526
IExecutionContext const * getExecutionContext() const noexcept
Get the context currently being inspected.
Definition: NvInferRuntime.h:2476
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:2501
bool setExecutionContext(IExecutionContext const *context) noexcept
Set an execution context as the inspection source.
Definition: NvInferRuntime.h:2464
Reference counted application-implemented error reporting interface for TensorRT objects.
Definition: NvInferRuntimeCommon.h:1693
Context for executing inference using an engine, with functionally unsafe features.
Definition: NvInferRuntime.h:1845
IErrorRecorder * getErrorRecorder() const noexcept
Get the ErrorRecorder assigned to this interface.
Definition: NvInferRuntime.h:2256
bool reportToProfiler() const noexcept
Calculate layer timing info for the current optimization profile in IExecutionContext and update the ...
Definition: NvInferRuntime.h:2402
void setDeviceMemory(void *memory) noexcept
Set the device memory for use by this execution context.
Definition: NvInferRuntime.h:1998
Dims getBindingDimensions(int32_t bindingIndex) const noexcept
Get the dynamic dimensions of a binding.
Definition: NvInferRuntime.h:2140
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:2192
void setDebugSync(bool sync) noexcept
Set the debug sync flag.
Definition: NvInferRuntime.h:1908
bool enqueueV2(void *const *bindings, cudaStream_t stream, cudaEvent_t *inputConsumed) noexcept
Asynchronously execute inference.
Definition: NvInferRuntime.h:2301
void setEnqueueEmitsProfile(bool enqueueEmitsProfile) noexcept
Set whether enqueue emits layer timing to the profiler.
Definition: NvInferRuntime.h:2364
bool setBindingDimensions(int32_t bindingIndex, Dims dimensions) noexcept
Set the dynamic dimensions of a binding.
Definition: NvInferRuntime.h:2110
bool setInputShapeBinding(int32_t bindingIndex, int32_t const *data) noexcept
Set values of input tensor required by shape calculations.
Definition: NvInferRuntime.h:2170
bool executeV2(void *const *bindings) noexcept
Synchronously execute inference a network.
Definition: NvInferRuntime.h:2273
bool getEnqueueEmitsProfile() const noexcept
Get the enqueueEmitsProfile state.
Definition: NvInferRuntime.h:2375
bool setOptimizationProfileAsync(int32_t profileIndex, cudaStream_t stream) noexcept
Select an optimization profile for the current context with async semantics.
Definition: NvInferRuntime.h:2349
int32_t getOptimizationProfile() const noexcept
Get the index of the currently selected optimization profile.
Definition: NvInferRuntime.h:2073
bool enqueue(int32_t batchSize, void *const *bindings, cudaStream_t stream, cudaEvent_t *inputConsumed) noexcept
Asynchronously execute inference on a batch.
Definition: NvInferRuntime.h:1895
TRT_DEPRECATED void destroy() noexcept
Destroy this object.
Definition: NvInferRuntime.h:1960
bool getDebugSync() const noexcept
Get the debug sync flag.
Definition: NvInferRuntime.h:1918
bool execute(int32_t batchSize, void *const *bindings) noexcept
Synchronously execute inference on a batch.
Definition: NvInferRuntime.h:1866
const char * getName() const noexcept
Return the name of the execution context.
Definition: NvInferRuntime.h:1982
Dims getStrides(int32_t bindingIndex) const noexcept
Return the strides of the buffer for the given binding.
Definition: NvInferRuntime.h:2019
IProfiler * getProfiler() const noexcept
Get the profiler.
Definition: NvInferRuntime.h:1938
void setErrorRecorder(IErrorRecorder *recorder) noexcept
Set the ErrorRecorder for this interface.
Definition: NvInferRuntime.h:2241
TRT_DEPRECATED bool setOptimizationProfile(int32_t profileIndex) noexcept
Select an optimization profile for the current context.
Definition: NvInferRuntime.h:2061
bool allInputDimensionsSpecified() const noexcept
Whether all dynamic dimensions of input tensors have been specified.
Definition: NvInferRuntime.h:2207
const ICudaEngine & getEngine() const noexcept
Get the associated engine.
Definition: NvInferRuntime.h:1948
void setProfiler(IProfiler *profiler) noexcept
Set the profiler.
Definition: NvInferRuntime.h:1928
bool allInputShapesSpecified() const noexcept
Whether all input shape bindings have been specified.
Definition: NvInferRuntime.h:2221
void setName(const char *name) noexcept
Set the name of the execution context.
Definition: NvInferRuntime.h:1972
Definition: NvInferRuntime.h:313
const IDimensionExpr * constant(int32_t value) noexcept
Return pointer to IDimensionExp for given value.
Definition: NvInferRuntime.h:316
const IDimensionExpr * operation(DimensionOperation op, const IDimensionExpr &first, const IDimensionExpr &second) noexcept
Definition: NvInferRuntime.h:323
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:175
void * data() const noexcept
A pointer to the raw data that is owned by the library.
Definition: NvInferRuntime.h:180
DataType type() const noexcept
The type of the memory that was allocated.
Definition: NvInferRuntime.h:192
TRT_DEPRECATED void destroy() noexcept
Definition: NvInferRuntime.h:203
std::size_t size() const noexcept
The size in bytes of the data that was allocated.
Definition: NvInferRuntime.h:186
Application-implemented logging interface for the builder, refitter and runtime.
Definition: NvInferRuntimeCommon.h:1506
Forward declaration of IEngineInspector for use by other interfaces.
Definition: NvInferRuntime.h:80
Optimization profile for dynamic input dimensions and shape tensors.
Definition: NvInferRuntime.h:1094
bool setDimensions(const char *inputName, OptProfileSelector select, Dims dims) noexcept
Set the minimum / optimum / maximum dimensions for a dynamic input tensor.
Definition: NvInferRuntime.h:1121
int32_t getNbShapeValues(const char *inputName) const noexcept
Get the number of values for an input shape tensor.
Definition: NvInferRuntime.h:1186
float getExtraMemoryTarget() const noexcept
Get the extra memory target that has been defined for this profile.
Definition: NvInferRuntime.h:1222
Dims getDimensions(const char *inputName, OptProfileSelector select) const noexcept
Get the minimum / optimum / maximum dimensions for a dynamic input tensor.
Definition: NvInferRuntime.h:1131
bool setExtraMemoryTarget(float target) noexcept
Set a target for extra GPU memory that may be used by this profile.
Definition: NvInferRuntime.h:1214
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:1196
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:1174
bool isValid() const noexcept
Check whether the optimization profile can be passed to an IBuilderConfig object.
Definition: NvInferRuntime.h:1238
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:382
IPluginV2DynamicExt * clone() const noexcept override=0
Clone the plugin object. This copies over internal plugin parameters as well and returns a new plugin...
Plugin class for user-implemented layers.
Definition: NvInferRuntimeCommon.h:714
Application-implemented interface for profiling.
Definition: NvInferRuntime.h:591
virtual void reportLayerTime(const char *layerName, float ms) noexcept=0
Layer time reporting callback.
Updates weights in an engine.
Definition: NvInferRuntime.h:806
float getDynamicRangeMin(const char *tensorName) const noexcept
Get minimum of dynamic range.
Definition: NvInferRuntime.h:912
bool setDynamicRange(const char *tensorName, float min, float max) noexcept
Definition: NvInferRuntime.h:900
bool setWeights(const char *layerName, WeightsRole role, Weights weights) noexcept
Specify new weights for a layer of given name. Returns true on success, or false if new weights are r...
Definition: NvInferRuntime.h:820
ILogger * getLogger() const noexcept
get the logger with which the refitter was created
Definition: NvInferRuntime.h:1038
bool refitCudaEngine() noexcept
Updates associated engine. Return true if successful.
Definition: NvInferRuntime.h:835
int32_t getMissing(int32_t size, const char **layerNames, WeightsRole *roles) noexcept
Get description of missing weights.
Definition: NvInferRuntime.h:856
int32_t getTensorsWithDynamicRange(int32_t size, const char **tensorNames) const noexcept
Get names of all tensors that have refittable dynamic ranges.
Definition: NvInferRuntime.h:940
TRT_DEPRECATED void destroy() noexcept
Definition: NvInferRuntime.h:883
int32_t getAll(int32_t size, const char **layerNames, WeightsRole *roles) noexcept
Get description of all weights that could be refit.
Definition: NvInferRuntime.h:873
int32_t getMissingWeights(int32_t size, const char **weightsNames) noexcept
Get names of missing weights.
Definition: NvInferRuntime.h:1012
bool setNamedWeights(const char *name, Weights weights) noexcept
Specify new weights of given name.
Definition: NvInferRuntime.h:992
float getDynamicRangeMax(const char *tensorName) const noexcept
Get maximum of dynamic range.
Definition: NvInferRuntime.h:924
void setErrorRecorder(IErrorRecorder *recorder) noexcept
Set the ErrorRecorder for this interface.
Definition: NvInferRuntime.h:959
int32_t getAllWeights(int32_t size, const char **weightsNames) noexcept
Get names of all weights that could be refit.
Definition: NvInferRuntime.h:1028
IErrorRecorder * getErrorRecorder() const noexcept
Get the ErrorRecorder assigned to this interface.
Definition: NvInferRuntime.h:974
Allows a serialized functionally unsafe engine to be deserialized.
Definition: NvInferRuntime.h:653
ICudaEngine * deserializeCudaEngine(const void *blob, std::size_t size) noexcept
Deserialize an engine from a stream.
Definition: NvInferRuntime.h:779
TRT_DEPRECATED void destroy() noexcept
Destroy this object.
Definition: NvInferRuntime.h:716
void setDLACore(int32_t dlaCore) noexcept
Set the DLA core that the deserialized engine must execute on.
Definition: NvInferRuntime.h:685
int32_t getNbDLACores() const noexcept
Returns number of DLA hardware cores accessible.
Definition: NvInferRuntime.h:704
int32_t getDLACore() const noexcept
Get the DLA core that the engine executes on.
Definition: NvInferRuntime.h:696
void setGpuAllocator(IGpuAllocator *allocator) noexcept
Set the GPU allocator.
Definition: NvInferRuntime.h:730
IErrorRecorder * getErrorRecorder() const noexcept
get the ErrorRecorder assigned to this interface.
Definition: NvInferRuntime.h:764
TRT_DEPRECATED nvinfer1::ICudaEngine * deserializeCudaEngine(const void *blob, std::size_t size, IPluginFactory *pluginFactory) noexcept
Deserialize an engine from a stream.
Definition: NvInferRuntime.h:672
ILogger * getLogger() const noexcept
get the logger with which the runtime was created
Definition: NvInferRuntime.h:789
void setErrorRecorder(IErrorRecorder *recorder) noexcept
Set the ErrorRecorder for this interface.
Definition: NvInferRuntime.h:749
Register the plugin creator to the registry The static registry object will be instantiated when the ...
Definition: NvInferRuntime.h:2635
An array of weights used as a layer parameter.
Definition: NvInferRuntime.h:157
DataType type
The type of the weights.
Definition: NvInferRuntime.h:159
int64_t count
The number of weights in the array.
Definition: NvInferRuntime.h:161
const void * values
The weight values, in a contiguous array.
Definition: NvInferRuntime.h:160
IRefitter * createInferRefitter(ICudaEngine &engine, ILogger &logger) noexcept
Create an instance of an IRefitter class.
Definition: NvInferRuntime.h:2615
IRuntime * createInferRuntime(ILogger &logger) noexcept
Create an instance of an IRuntime class.
Definition: NvInferRuntime.h:2605
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:1275
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:223
@ 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:622
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:2427
DataType
The type of weights and tensors.
Definition: NvInferRuntimeCommon.h:151
DeviceType
The device that this layer/network will execute on.
Definition: NvInferRuntime.h:633
@ kCONSTANT
Constant layer.
@ kDEFAULT
Similar to ONNX Gather.
WeightsRole
How a layer uses particular Weights.
Definition: NvInferRuntime.h:611
@ 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:1297
ProfilingVerbosity
List of verbosity levels of layer information exposed in NVTX annotations and in IEngineInspector.
Definition: NvInferRuntime.h:1287
@ 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:1256
@ 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:1264
LayerInformationFormat
The format in which the IEngineInspector prints the layer information.
Definition: NvInferRuntime.h:2419
@ 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:640
constexpr int32_t EnumMax< DimensionOperation >() noexcept
Maximum number of elements in DimensionOperation enum.
Definition: NvInferRuntime.h:237
TensorLocation
The location for tensor data storage, device or host.
Definition: NvInferRuntime.h:247
@ 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:1058
@ kOPT
This is used to set or get the value that is used in the optimization (kernel selection).
Definition: NvInferRuntime.h:352
Dims min
Lower bounds on tensor’s dimensions.
Definition: NvInferRuntime.h:357
Dims max
Upper bounds on tensor’s dimensions.
Definition: NvInferRuntime.h:360
PluginTensorDesc desc
Information required to interpret a pointer to tensor data, except that desc.dims has -1 in place of ...
Definition: NvInferRuntime.h:354
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