Go to the documentation of this file.
50 #ifndef NV_INFER_RUNTIME_H
51 #define NV_INFER_RUNTIME_H
59 #include "NvInferImpl.h"
65 class IExecutionContext;
68 class IEngineInspector;
120 kSAFE_GPU TRT_DEPRECATED_ENUM =
kSAFETY,
137 static constexpr int32_t kVALUE = 3;
181 return mImpl->data();
185 std::size_t
size() const noexcept
187 return mImpl->size();
193 return mImpl->type();
208 apiv::VHostMemory* mImpl;
257 static constexpr int32_t kVALUE = 2;
279 return mImpl->isConstant();
286 return mImpl->getConstantValue();
290 apiv::VDimensionExpr* mImpl;
317 return mImpl->constant(value);
325 return mImpl->operation(op, first, second);
329 apiv::VExprBuilder* mImpl;
416 static constexpr int32_t kFORMAT_COMBINATION_LIMIT = 100;
450 virtual bool supportsFormatCombination(
451 int32_t pos,
const PluginTensorDesc* inOut, int32_t nbInputs, int32_t nbOutputs) noexcept
506 int32_t nbOutputs)
const noexcept
522 const void*
const* inputs,
void*
const* outputs,
void* workspace, cudaStream_t stream) noexcept
544 bool const*,
PluginFormat, int32_t) noexcept
override final
553 Dims getOutputDimensions(int32_t,
Dims const*, int32_t) noexcept
override final
558 bool isOutputBroadcastAcrossBatch(int32_t,
bool const*, int32_t)
const noexcept
override final
563 bool canBroadcastInputAcrossBatch(int32_t)
const noexcept
override final
568 size_t getWorkspaceSize(int32_t)
const noexcept
override final
573 int32_t enqueue(int32_t,
const void*
const*,
void*
const*,
void*, cudaStream_t) noexcept
override final
598 virtual void reportLayerTime(
const char* layerName,
float ms) noexcept = 0;
654 virtual ~
IRuntime() noexcept =
default;
672 const void* blob, std::size_t size, IPluginFactory* pluginFactory) noexcept
674 return mImpl->deserializeCudaEngine(blob, size,
nullptr);
686 mImpl->setDLACore(dlaCore);
697 return mImpl->getDLACore();
705 return mImpl->getNbDLACores();
731 mImpl->setGpuAllocator(allocator);
750 mImpl->setErrorRecorder(recorder);
765 return mImpl->getErrorRecorder();
780 return mImpl->deserializeCudaEngine(blob, size,
nullptr);
790 return mImpl->getLogger();
794 apiv::VRuntime* mImpl;
821 return mImpl->setWeights(layerName, role, weights);
836 return mImpl->refitCudaEngine();
857 return mImpl->getMissing(size, layerNames, roles);
874 return mImpl->getAll(size, layerNames, roles);
901 return mImpl->setDynamicRange(tensorName, min, max);
913 return mImpl->getDynamicRangeMin(tensorName);
925 return mImpl->getDynamicRangeMax(tensorName);
941 return mImpl->getTensorsWithDynamicRange(size, tensorNames);
960 mImpl->setErrorRecorder(recorder);
975 return mImpl->getErrorRecorder();
993 return mImpl->setNamedWeights(name, weights);
1013 return mImpl->getMissingWeights(size, weightsNames);
1029 return mImpl->getAllWeights(size, weightsNames);
1039 return mImpl->getLogger();
1043 apiv::VRefitter* mImpl;
1065 constexpr
inline int32_t EnumMax<OptProfileSelector>() noexcept
1122 return mImpl->setDimensions(inputName, select, dims);
1132 return mImpl->getDimensions(inputName, select);
1174 const char* inputName,
OptProfileSelector select,
const int32_t* values, int32_t nbValues) noexcept
1176 return mImpl->setShapeValues(inputName, select, values, nbValues);
1187 return mImpl->getNbShapeValues(inputName);
1197 return mImpl->getShapeValues(inputName, select);
1215 return mImpl->setExtraMemoryTarget(target);
1223 return mImpl->getExtraMemoryTarget();
1239 return mImpl->isValid();
1243 apiv::VOptimizationProfile* mImpl;
1291 kVERBOSE TRT_DEPRECATED_ENUM =
kDETAILED
1325 return mImpl->getNbBindings();
1347 return mImpl->getBindingIndex(name);
1367 return mImpl->getBindingName(bindingIndex);
1380 return mImpl->bindingIsInput(bindingIndex);
1405 return mImpl->getBindingDimensions(bindingIndex);
1418 return mImpl->getBindingDataType(bindingIndex);
1430 return mImpl->getMaxBatchSize();
1444 return mImpl->getNbLayers();
1458 return mImpl->serialize();
1474 return mImpl->createExecutionContext();
1501 return mImpl->getLocation(bindingIndex);
1510 return mImpl->createExecutionContextWithoutDeviceMemory();
1520 return mImpl->getDeviceMemorySize();
1530 return mImpl->isRefittable();
1544 return mImpl->getBindingBytesPerComponent(bindingIndex);
1558 return mImpl->getBindingComponentsPerElement(bindingIndex);
1568 return mImpl->getBindingFormat(bindingIndex);
1587 return mImpl->getBindingFormatDesc(bindingIndex);
1599 return mImpl->getBindingVectorizedDim(bindingIndex);
1614 return mImpl->getName();
1625 return mImpl->getNbOptimizationProfiles();
1652 return mImpl->getProfileDimensions(bindingIndex, profileIndex, select);
1679 return mImpl->getProfileShapeValues(profileIndex, inputIndex, select);
1715 return mImpl->isShapeBinding(bindingIndex);
1729 return mImpl->isExecutionBinding(bindingIndex);
1744 return mImpl->getEngineCapability();
1762 return mImpl->setErrorRecorder(recorder);
1777 return mImpl->getErrorRecorder();
1796 return mImpl->hasImplicitBatchDimension();
1805 return mImpl->getTacticSources();
1816 return mImpl->getProfilingVerbosity();
1826 return mImpl->createEngineInspector();
1830 apiv::VCudaEngine* mImpl;
1865 bool execute(int32_t batchSize,
void*
const* bindings) noexcept
1867 return mImpl->execute(batchSize, bindings);
1894 bool enqueue(int32_t batchSize,
void*
const* bindings, cudaStream_t stream, cudaEvent_t* inputConsumed) noexcept
1896 return mImpl->enqueue(batchSize, bindings, stream, inputConsumed);
1909 mImpl->setDebugSync(sync);
1919 return mImpl->getDebugSync();
1929 mImpl->setProfiler(profiler);
1939 return mImpl->getProfiler();
1949 return mImpl->getEngine();
1973 mImpl->setName(name);
1983 return mImpl->getName();
1999 mImpl->setDeviceMemory(memory);
2020 return mImpl->getStrides(bindingIndex);
2062 return mImpl->setOptimizationProfile(profileIndex);
2074 return mImpl->getOptimizationProfile();
2111 return mImpl->setBindingDimensions(bindingIndex, dimensions);
2141 return mImpl->getBindingDimensions(bindingIndex);
2171 return mImpl->setInputShapeBinding(bindingIndex, data);
2193 return mImpl->getShapeBinding(bindingIndex, data);
2208 return mImpl->allInputDimensionsSpecified();
2223 return mImpl->allInputShapesSpecified();
2242 mImpl->setErrorRecorder(recorder);
2257 return mImpl->getErrorRecorder();
2274 return mImpl->executeV2(bindings);
2300 bool enqueueV2(
void*
const* bindings, cudaStream_t stream, cudaEvent_t* inputConsumed) noexcept
2302 return mImpl->enqueueV2(bindings, stream, inputConsumed);
2350 return mImpl->setOptimizationProfileAsync(profileIndex, stream);
2365 mImpl->setEnqueueEmitsProfile(enqueueEmitsProfile);
2376 return mImpl->getEnqueueEmitsProfile();
2403 return mImpl->reportToProfiler();
2407 apiv::VExecutionContext* mImpl;
2465 return mImpl->setExecutionContext(context);
2477 return mImpl->getExecutionContext();
2502 return mImpl->getLayerInformation(layerIndex, format);
2527 return mImpl->getEngineInformation(format);
2546 mImpl->setErrorRecorder(recorder);
2561 return mImpl->getErrorRecorder();
2565 apiv::VEngineInspector* mImpl;
2574 extern "C" TENSORRTAPI
void* createInferRuntime_INTERNAL(
void* logger, int32_t version) noexcept;
2580 extern "C" TENSORRTAPI
void* createInferRefitter_INTERNAL(
void* engine,
void* logger, int32_t version) noexcept;
2606 return static_cast<IRuntime*>(createInferRuntime_INTERNAL(&logger, NV_TENSORRT_VERSION));
2616 return static_cast<IRefitter*>(createInferRefitter_INTERNAL(&engine, &logger, NV_TENSORRT_VERSION));
2632 template <
typename T>
2648 #define REGISTER_TENSORRT_PLUGIN(name) \
2649 static nvinfer1::PluginRegistrar<name> pluginRegistrar##name {}
2650 #endif // NV_INFER_RUNTIME_H
int32_t getNbShapeValues(const char *inputName) const noexcept
Get the number of values for an input shape tensor.
Definition: NvInferRuntime.h:1185
bool allInputDimensionsSpecified() const noexcept
Whether all dynamic dimensions of input tensors have been specified.
Definition: NvInferRuntime.h:2206
int32_t getConstantValue() const noexcept
Definition: NvInferRuntime.h:284
Structure to define the dimensions of a tensor.
Definition: NvInferRuntime.h:350
Print only the layer names. This is the default setting.
char_t AsciiChar
AsciiChar is the type used by TensorRT to represent valid ASCII characters.
Definition: NvInferRuntimeCommon.h:125
ILogger * getLogger() const noexcept
get the logger with which the refitter was created
Definition: NvInferRuntime.h:1037
void setErrorRecorder(IErrorRecorder *recorder) noexcept
Set the ErrorRecorder for this interface.
Definition: NvInferRuntime.h:2544
IErrorRecorder * getErrorRecorder() const noexcept
get the ErrorRecorder assigned to this interface.
Definition: NvInferRuntime.h:763
DimensionOperation
An operation on two IDimensionExpr, which represent integer expressions used in dimension computation...
Definition: NvInferRuntime.h:221
Minimum of the two elements.
bool getEnqueueEmitsProfile() const noexcept
Get the enqueueEmitsProfile state.
Definition: NvInferRuntime.h:2374
nvinfer1::ILogger * getLogger() noexcept
Return the logger object.
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:2191
void setName(const char *name) noexcept
Set the name of the execution context.
Definition: NvInferRuntime.h:1971
int32_t getTensorRTVersion() const noexcept override
Return the API version with which this plugin was built. The upper byte reserved by TensorRT and is u...
Definition: NvInferRuntime.h:533
An array of weights used as a layer parameter.
Definition: NvInferRuntime.h:155
LayerInformationFormat
The format in which the IEngineInspector prints the layer information.
Definition: NvInferRuntime.h:2417
size_t getDeviceMemorySize() const noexcept
Return the amount of device memory required by an execution context.
Definition: NvInferRuntime.h:1518
Register the plugin creator to the registry The static registry object will be instantiated when the ...
Definition: NvInferRuntime.h:2633
nvinfer1::IPluginRegistry * getPluginRegistry() noexcept
Return the plugin registry.
bool isConstant() const noexcept
Return true if expression is a build-time constant.
Definition: NvInferRuntime.h:277
Class to handle library allocated memory that is accessible to the user.
Definition: NvInferRuntime.h:173
void * data() const noexcept
A pointer to the raw data that is owned by the library.
Definition: NvInferRuntime.h:179
TRT_DEPRECATED void destroy() noexcept
Definition: NvInferRuntime.h:202
DeviceType
The device that this layer/network will execute on.
Definition: NvInferRuntime.h:631
ProfilingVerbosity
List of verbosity levels of layer information exposed in NVTX annotations and in IEngineInspector.
Definition: NvInferRuntime.h:1285
float getDynamicRangeMin(const char *tensorName) const noexcept
Get minimum of dynamic range.
Definition: NvInferRuntime.h:911
IErrorRecorder * getErrorRecorder() const noexcept
Get the ErrorRecorder assigned to this interface.
Definition: NvInferRuntime.h:2255
float getDynamicRangeMax(const char *tensorName) const noexcept
Get maximum of dynamic range.
Definition: NvInferRuntime.h:923
IHostMemory * serialize() const noexcept
Serialize the network to a stream.
Definition: NvInferRuntime.h:1456
Declaration of EnumMaxImpl struct to store maximum number of elements in an enumeration type.
Definition: NvInferRuntimeCommon.h:136
constexpr int32_t EnumMax< WeightsRole >() noexcept
Maximum number of elements in WeightsRole enum.
Definition: NvInferRuntime.h:621
Dims getBindingDimensions(int32_t bindingIndex) const noexcept
Get the dimensions of a binding.
Definition: NvInferRuntime.h:1403
Updates weights in an engine.
Definition: NvInferRuntime.h:804
Definition: NvInferRuntimeCommon.h:189
TacticSource
List of tactic sources for TensorRT.
Definition: NvInferRuntime.h:1254
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:1195
kernel for IConvolutionLayer, IDeconvolutionLayer, or IFullyConnectedLayer
IExecutionContext const * getExecutionContext() const noexcept
Get the context currently being inspected.
Definition: NvInferRuntime.h:2475
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:1650
TensorLocation getLocation(int32_t bindingIndex) const noexcept
Get location of binding.
Definition: NvInferRuntime.h:1499
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:1676
bool reportToProfiler() const noexcept
Calculate layer timing info for the current optimization profile in IExecutionContext and update the ...
Definition: NvInferRuntime.h:2401
TRT_DEPRECATED void destroy() noexcept
Destroy this object;.
Definition: NvInferRuntime.h:1484
bool setDimensions(const char *inputName, OptProfileSelector select, Dims dims) noexcept
Set the minimum / optimum / maximum dimensions for a dynamic input tensor.
Definition: NvInferRuntime.h:1120
ICudaEngine * deserializeCudaEngine(const void *blob, std::size_t size) noexcept
Deserialize an engine from a stream.
Definition: NvInferRuntime.h:778
bool setDynamicRange(const char *tensorName, float min, float max) noexcept
Definition: NvInferRuntime.h:899
TensorFormat
Format of the input/output tensors.
Definition: NvInferRuntimeCommon.h:220
constexpr int32_t EnumMax< LayerInformationFormat >() noexcept
Definition: NvInferRuntime.h:2426
TRT_DEPRECATED void destroy() noexcept
Destroy this object.
Definition: NvInferRuntime.h:715
int64_t count
The number of weights in the array.
Definition: NvInferRuntime.h:160
Single registration point for all plugins in an application. It is used to find plugin implementation...
Definition: NvInferRuntimeCommon.h:1034
bool enqueueV2(void *const *bindings, cudaStream_t stream, cudaEvent_t *inputConsumed) noexcept
Asynchronously execute inference.
Definition: NvInferRuntime.h:2300
Application-implemented logging interface for the builder, refitter and runtime.
Definition: NvInferRuntimeCommon.h:1256
Print layer information in one line per layer.
An engine for executing inference on a built network, with functionally unsafe features.
Definition: NvInferRuntime.h:1308
int32_t getBindingComponentsPerElement(int32_t bindingIndex) const noexcept
Return the number of components included in one element.
Definition: NvInferRuntime.h:1556
DataType type() const noexcept
The type of the memory that was allocated.
Definition: NvInferRuntime.h:191
bool refitCudaEngine() noexcept
Updates associated engine. Return true if successful.
Definition: NvInferRuntime.h:834
IRuntime * createInferRuntime(ILogger &logger) noexcept
Create an instance of an IRuntime class.
Definition: NvInferRuntime.h:2604
bool isValid() const noexcept
Check whether the optimization profile can be passed to an IBuilderConfig object.
Definition: NvInferRuntime.h:1237
bool enqueue(int32_t batchSize, void *const *bindings, cudaStream_t stream, cudaEvent_t *inputConsumed) noexcept
Asynchronously execute inference on a batch.
Definition: NvInferRuntime.h:1894
bool getDebugSync() const noexcept
Get the debug sync flag.
Definition: NvInferRuntime.h:1917
int32_t getAll(int32_t size, const char **layerNames, WeightsRole *roles) noexcept
Get description of all weights that could be refit.
Definition: NvInferRuntime.h:872
bool execute(int32_t batchSize, void *const *bindings) noexcept
Synchronously execute inference on a batch.
Definition: NvInferRuntime.h:1865
TRT_DEPRECATED nvinfer1::ICudaEngine * deserializeCudaEngine(const void *blob, std::size_t size, IPluginFactory *pluginFactory) noexcept
Deserialize an engine from a stream.
Definition: NvInferRuntime.h:671
void setErrorRecorder(IErrorRecorder *recorder) noexcept
Set the ErrorRecorder for this interface.
Definition: NvInferRuntime.h:1760
std::size_t size() const noexcept
The size in bytes of the data that was allocated.
Definition: NvInferRuntime.h:185
constexpr int32_t EnumMax< TacticSource >() noexcept
Maximum number of tactic sources in TacticSource enum.
Definition: NvInferRuntime.h:1263
int32_t nbDims
The number of dimensions.
Definition: NvInferRuntime.h:341
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:1727
The TensorRT API version 1 namespace.
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:1173
constexpr int32_t EnumMax< DeviceType >() noexcept
Maximum number of elements in DeviceType enum.
Definition: NvInferRuntime.h:639
constexpr int32_t EnumMax< DimensionOperation >() noexcept
Maximum number of elements in DimensionOperation enum.
Definition: NvInferRuntime.h:236
bool executeV2(void *const *bindings) noexcept
Synchronously execute inference a network.
Definition: NvInferRuntime.h:2272
int32_t getTensorsWithDynamicRange(int32_t size, const char **tensorNames) const noexcept
Get names of all tensors that have refittable dynamic ranges.
Definition: NvInferRuntime.h:939
Definition: NvInferRuntime.h:380
void setGpuAllocator(IGpuAllocator *allocator) noexcept
Set the GPU allocator.
Definition: NvInferRuntime.h:729
int32_t getNbDLACores() const noexcept
Returns number of DLA hardware cores accessible.
Definition: NvInferRuntime.h:703
float getExtraMemoryTarget() const noexcept
Get the extra memory target that has been defined for this profile.
Definition: NvInferRuntime.h:1221
int32_t getNbOptimizationProfiles() const noexcept
Get the number of optimization profiles defined for this engine.
Definition: NvInferRuntime.h:1623
constexpr int32_t EnumMax< ProfilingVerbosity >() noexcept
Maximum number of profile verbosity levels in ProfilingVerbosity enum.
Definition: NvInferRuntime.h:1296
ILogger * getLogger() const noexcept
get the logger with which the runtime was created
Definition: NvInferRuntime.h:788
This is used to set or get the value that is used in the optimization (kernel selection).
const IDimensionExpr * constant(int32_t value) noexcept
Return pointer to IDimensionExp for given value.
Definition: NvInferRuntime.h:315
IErrorRecorder * getErrorRecorder() const noexcept
Get the ErrorRecorder assigned to this interface.
Definition: NvInferRuntime.h:1775
DataType getBindingDataType(int32_t bindingIndex) const noexcept
Determine the required data type for a buffer from its binding index.
Definition: NvInferRuntime.h:1416
Dims max
Upper bounds on tensor’s dimensions.
Definition: NvInferRuntime.h:359
Check if two elements are equal.
void setErrorRecorder(IErrorRecorder *recorder) noexcept
Set the ErrorRecorder for this interface.
Definition: NvInferRuntime.h:2240
TRT_DEPRECATED bool setOptimizationProfile(int32_t profileIndex) noexcept
Select an optimization profile for the current context.
Definition: NvInferRuntime.h:2060
void setProfiler(IProfiler *profiler) noexcept
Set the profiler.
Definition: NvInferRuntime.h:1927
int32_t getNbLayers() const noexcept
Get the number of layers in the network.
Definition: NvInferRuntime.h:1442
DataType type
The type of the weights.
Definition: NvInferRuntime.h:158
bias for IConvolutionLayer, IDeconvolutionLayer, or IFullyConnectedLayer
int32_t getBindingBytesPerComponent(int32_t bindingIndex) const noexcept
Return the number of bytes per component of an element.
Definition: NvInferRuntime.h:1542
An engine inspector which prints out the layer information of an engine or an execution context.
Definition: NvInferRuntime.h:2446
Dims min
Lower bounds on tensor’s dimensions.
Definition: NvInferRuntime.h:356
bool setExecutionContext(IExecutionContext const *context) noexcept
Set an execution context as the inspection source.
Definition: NvInferRuntime.h:2463
int32_t getBindingIndex(const char *name) const noexcept
Retrieve the binding index for a named tensor.
Definition: NvInferRuntime.h:1345
int32_t getNbBindings() const noexcept
Get the number of binding indices.
Definition: NvInferRuntime.h:1323
void setDLACore(int32_t dlaCore) noexcept
Set the DLA core that the deserialized engine must execute on.
Definition: NvInferRuntime.h:684
Print detailed layer information including layer names and layer parameters.
const ICudaEngine & getEngine() const noexcept
Get the associated engine.
Definition: NvInferRuntime.h:1947
IErrorRecorder * getErrorRecorder() const noexcept
Get the ErrorRecorder assigned to this interface.
Definition: NvInferRuntime.h:973
shift part of IScaleLayer
Optimization profile for dynamic input dimensions and shape tensors.
Definition: NvInferRuntime.h:1092
IExecutionContext * createExecutionContextWithoutDeviceMemory() noexcept
create an execution context without any device memory allocated
Definition: NvInferRuntime.h:1508
uint32_t TacticSources
Represents a collection of one or more TacticSource values combine using bitwise-OR operations.
Definition: NvInferRuntime.h:1274
IEngineInspector * createEngineInspector() const noexcept
Create a new engine inspector which prints the layer information in an engine or an execution context...
Definition: NvInferRuntime.h:1824
DataType
The type of weights and tensors.
Definition: NvInferRuntimeCommon.h:150
TacticSources getTacticSources() const noexcept
return the tactic sources required by this engine
Definition: NvInferRuntime.h:1803
int32_t getBindingVectorizedDim(int32_t bindingIndex) const noexcept
Return the dimension index that the buffer is vectorized.
Definition: NvInferRuntime.h:1597
Definition: NvInferRuntime.h:338
bool setOptimizationProfileAsync(int32_t profileIndex, cudaStream_t stream) noexcept
Select an optimization profile for the current context with async semantics.
Definition: NvInferRuntime.h:2348
Floor division of the first element by the second.
PluginTensorDesc desc
Information required to interpret a pointer to tensor data, except that desc.dims has -1 in place of ...
Definition: NvInferRuntime.h:353
Substract the second element from the first.
Forward declaration of IEngineInspector for use by other interfaces.
Definition: NvInferRuntime.h:79
const char * getName() const noexcept
Returns the name of the network associated with the engine.
Definition: NvInferRuntime.h:1612
TensorFormat getBindingFormat(int32_t bindingIndex) const noexcept
Return the binding format.
Definition: NvInferRuntime.h:1566
Reference counted application-implemented error reporting interface for TensorRT objects.
Definition: NvInferRuntimeCommon.h:1439
IProfiler * getProfiler() const noexcept
Get the profiler.
Definition: NvInferRuntime.h:1937
int32_t getAllWeights(int32_t size, const char **weightsNames) noexcept
Get names of all weights that could be refit.
Definition: NvInferRuntime.h:1027
OptProfileSelector
When setting or querying optimization profile parameters (such as shape tensor inputs or dynamic dime...
Definition: NvInferRuntime.h:1056
WeightsRole
How a layer uses particular Weights.
Definition: NvInferRuntime.h:609
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.
bool isShapeBinding(int32_t bindingIndex) const noexcept
True if tensor is required as input for shape calculations or output from them.
Definition: NvInferRuntime.h:1713
int32_t getMaxBatchSize() const noexcept
Get the maximum batch size which can be used for inference.
Definition: NvInferRuntime.h:1428
const char * getBindingFormatDesc(int32_t bindingIndex) const noexcept
Return the human readable description of the tensor format.
Definition: NvInferRuntime.h:1585
void setErrorRecorder(IErrorRecorder *recorder) noexcept
Set the ErrorRecorder for this interface.
Definition: NvInferRuntime.h:748
Plugin class for user-implemented layers.
Definition: NvInferRuntimeCommon.h:618
bool setInputShapeBinding(int32_t bindingIndex, int32_t const *data) noexcept
Set values of input tensor required by shape calculations.
Definition: NvInferRuntime.h:2169
static constexpr int32_t MAX_DIMS
The maximum rank (number of dimensions) supported for a tensor.
Definition: NvInferRuntimeCommon.h:193
Definition: NvInferRuntime.h:273
Dims getBindingDimensions(int32_t bindingIndex) const noexcept
Get the dynamic dimensions of a binding.
Definition: NvInferRuntime.h:2139
Product of the two elements.
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:2525
EngineCapability
List of supported engine capability flows.
Definition: NvInferRuntime.h:105
bool hasImplicitBatchDimension() const noexcept
Query whether the engine was built with an implicit batch dimension.
Definition: NvInferRuntime.h:1794
Application-implemented interface for profiling.
Definition: NvInferRuntime.h:589
void setEnqueueEmitsProfile(bool enqueueEmitsProfile) noexcept
Set whether enqueue emits layer timing to the profiler.
Definition: NvInferRuntime.h:2363
Print layer information in JSON format.
Check if element in first tensor is less than corresponding element in second tensor.
bool bindingIsInput(int32_t bindingIndex) const noexcept
Determine whether a binding is an input binding.
Definition: NvInferRuntime.h:1378
bool setExtraMemoryTarget(float target) noexcept
Set a target for extra GPU memory that may be used by this profile.
Definition: NvInferRuntime.h:1213
bool allInputShapesSpecified() const noexcept
Whether all input shape bindings have been specified.
Definition: NvInferRuntime.h:2220
Fields that a plugin might see for an input or output.
Definition: NvInferRuntimeCommon.h:368
TRT_DEPRECATED void destroy() noexcept
Definition: NvInferRuntime.h:882
const void * values
The weight values, in a contiguous array.
Definition: NvInferRuntime.h:159
TensorFormat PluginFormat
PluginFormat is reserved for backward compatibility.
Definition: NvInferRuntimeCommon.h:345
ProfilingVerbosity getProfilingVerbosity() const noexcept
Return the ProfilingVerbosity the builder config was set to when the engine was built.
Definition: NvInferRuntime.h:1814
int32_t getDLACore() const noexcept
Get the DLA core that the engine executes on.
Definition: NvInferRuntime.h:695
const char * getBindingName(int32_t bindingIndex) const noexcept
Retrieve the name corresponding to a binding index.
Definition: NvInferRuntime.h:1365
bool setNamedWeights(const char *name, Weights weights) noexcept
Specify new weights of given name.
Definition: NvInferRuntime.h:991
void setDeviceMemory(void *memory) noexcept
Set the device memory for use by this execution context.
Definition: NvInferRuntime.h:1997
const char * getName() const noexcept
Return the name of the execution context.
Definition: NvInferRuntime.h:1981
Application-implemented class for controlling allocation on the GPU.
Definition: NvInferRuntimeCommon.h:1138
Dims getDimensions(const char *inputName, OptProfileSelector select) const noexcept
Get the minimum / optimum / maximum dimensions for a dynamic input tensor.
Definition: NvInferRuntime.h:1130
IRefitter * createInferRefitter(ICudaEngine &engine, ILogger &logger) noexcept
Create an instance of an IRefitter class.
Definition: NvInferRuntime.h:2614
bool isRefittable() const noexcept
Return true if an engine can be refit.
Definition: NvInferRuntime.h:1528
int32_t getMissing(int32_t size, const char **layerNames, WeightsRole *roles) noexcept
Get description of missing weights.
Definition: NvInferRuntime.h:855
Allows a serialized functionally unsafe engine to be deserialized.
Definition: NvInferRuntime.h:651
void setDebugSync(bool sync) noexcept
Set the debug sync flag.
Definition: NvInferRuntime.h:1907
EngineCapability getEngineCapability() const noexcept
Determine what execution capability this engine has.
Definition: NvInferRuntime.h:1742
TensorLocation
The location for tensor data storage, device or host.
Definition: NvInferRuntime.h:245
Context for executing inference using an engine, with functionally unsafe features.
Definition: NvInferRuntime.h:1843
int32_t getMissingWeights(int32_t size, const char **weightsNames) noexcept
Get names of missing weights.
Definition: NvInferRuntime.h:1011
TRT_DEPRECATED void destroy() noexcept
Destroy this object.
Definition: NvInferRuntime.h:1959
const IDimensionExpr * operation(DimensionOperation op, const IDimensionExpr &first, const IDimensionExpr &second) noexcept
Definition: NvInferRuntime.h:322
Dims getStrides(int32_t bindingIndex) const noexcept
Return the strides of the buffer for the given binding.
Definition: NvInferRuntime.h:2018
#define TRT_DEPRECATED
< Items that are marked as deprecated will be removed in a future release.
Definition: NvInferRuntimeCommon.h:77
IErrorRecorder * getErrorRecorder() const noexcept
Get the ErrorRecorder assigned to this interface.
Definition: NvInferRuntime.h:2559
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:2500
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:819
int32_t getOptimizationProfile() const noexcept
Get the index of the currently selected optimization profile.
Definition: NvInferRuntime.h:2072
void setErrorRecorder(IErrorRecorder *recorder) noexcept
Set the ErrorRecorder for this interface.
Definition: NvInferRuntime.h:958
Definition: NvInferRuntime.h:311
IExecutionContext * createExecutionContext() noexcept
Create an execution context.
Definition: NvInferRuntime.h:1472
bool setBindingDimensions(int32_t bindingIndex, Dims dimensions) noexcept
Set the dynamic dimensions of a binding.
Definition: NvInferRuntime.h:2109