18#ifndef NV_INFER_IMPL_H
19#define NV_INFER_IMPL_H
56class IActivationLayer;
61class IConcatenationLayer;
64class IConvolutionLayer;
66class ICumulativeLayer;
67class IDeconvolutionLayer;
68class IDequantizeLayer;
70class IDynamicQuantizeLayer;
72class IElementWiseLayer;
73class IEngineInspector;
74class IExecutionContext;
77class IGridSampleLayer;
82class IIfConditionalInputLayer;
83class IIfConditionalOutputLayer;
87class ILoopOutputLayer;
89class IMatrixMultiplyLayer;
90class INetworkDefinition;
91class INormalizationLayer;
95class IOptimizationProfile;
97class IParametricReLULayer;
102class IPluginRegistry;
129class IRaggedSoftMaxLayer;
130class IRecurrenceLayer;
134class IReverseSequenceLayer;
139class ISerializationConfig;
149struct TimingCacheKey;
150struct TimingCacheValue;
152using TimingCacheKey = v_1_0::TimingCacheKey;
153using TimingCacheValue = v_1_0::TimingCacheValue;
157class ITripLimitLayer;
159class IUnsqueezeLayer;
184enum class QuantizationFlag : int32_t;
216using QuantizationFlags = uint32_t;
234 virtual ~VRoot() noexcept = default;
237class VHostMemory : public VRoot
240 virtual void* data() const noexcept = 0;
241 virtual std::
size_t size() const noexcept = 0;
242 virtual
DataType type() const noexcept = 0;
245class VDimensionExpr : public VRoot
248 virtual bool isConstant()
const = 0;
249 virtual int64_t getConstantValue()
const = 0;
250 virtual bool isSizeTensor()
const = 0;
253class VExprBuilder :
public VRoot
256 virtual IDimensionExpr
const* constant(int64_t value) = 0;
257 virtual IDimensionExpr
const* operation(
260 virtual IDimensionExpr
const* declareSizeTensor(
261 int32_t outputIndex, IDimensionExpr
const& opt, IDimensionExpr
const& upper)
265class VRuntime :
public VRoot
268 virtual IRuntime* getPImpl() noexcept = 0;
269 virtual
nvinfer1::ICudaEngine* deserializeCudaEngine(
void const* blob, std::
size_t size) noexcept = 0;
271 virtual
void setDLACore(int32_t dlaCore) noexcept = 0;
272 virtual int32_t getDLACore() const noexcept = 0;
273 virtual int32_t getNbDLACores() const noexcept = 0;
274 virtual
void setGpuAllocator(
IGpuAllocator* allocator) noexcept = 0;
275 virtual
void setErrorRecorder(
IErrorRecorder* recorder) noexcept = 0;
277 virtual ILogger*
getLogger() const noexcept = 0;
278 virtual
bool setMaxThreads(int32_t maxThreads) noexcept = 0;
279 virtual int32_t getMaxThreads() const noexcept = 0;
280 virtual
void setTemporaryDirectory(
char const*) noexcept = 0;
281 virtual
char const* getTemporaryDirectory() const noexcept = 0;
285 virtual
void setPluginRegistryParent(IPluginRegistry* parent) noexcept = 0;
286 virtual IRuntime* loadRuntime(
char const* path) noexcept = 0;
287 virtual
void setEngineHostCodeAllowed(
bool allowed) noexcept = 0;
288 virtual
bool getEngineHostCodeAllowed() const noexcept = 0;
291 virtual int64_t getEngineHeaderSize() const noexcept = 0;
292 virtual
EngineValidity getEngineValidity(
void const* blob, int64_t blobSize, uint64_t* diagnostics) const noexcept = 0;
295class VRefitter : public VRoot
298 virtual IRefitter* getPImpl() noexcept = 0;
299 virtual
bool setWeights(
char const* layerName,
WeightsRole role, const Weights weights) noexcept = 0;
300 virtual
bool refitCudaEngine() noexcept = 0;
301 virtual int32_t getMissing(int32_t size,
char const** layerNames,
WeightsRole* roles) noexcept = 0;
302 virtual int32_t getAll(int32_t size,
char const** layerNames,
WeightsRole* roles) noexcept = 0;
303 virtual
bool setDynamicRange(
char const* tensorName,
float min,
float max) noexcept = 0;
304 virtual
float getDynamicRangeMin(
char const* tensorName) const noexcept = 0;
305 virtual
float getDynamicRangeMax(
char const* tensorName) const noexcept = 0;
306 virtual int32_t getTensorsWithDynamicRange(int32_t size,
char const** tensorNames) const noexcept = 0;
307 virtual
void setErrorRecorder(
IErrorRecorder* recorder) noexcept = 0;
309 virtual
bool setNamedWeights(
char const* name, Weights weights) noexcept = 0;
310 virtual int32_t getMissingWeights(int32_t size,
char const** weightsNames) noexcept = 0;
311 virtual int32_t getAllWeights(int32_t size,
char const** weightsNames) noexcept = 0;
312 virtual ILogger*
getLogger() const noexcept = 0;
313 virtual
bool setMaxThreads(int32_t maxThreads) noexcept = 0;
314 virtual int32_t getMaxThreads() const noexcept = 0;
315 virtual
bool setNamedWeightsWithLocation(
char const* name, Weights weights,
TensorLocation location) noexcept = 0;
316 virtual Weights getNamedWeights(
char const* weightsName) const noexcept = 0;
317 virtual
TensorLocation getWeightsLocation(
char const* weightsName) const noexcept = 0;
318 virtual
bool unsetNamedWeights(
char const* weightsName) noexcept = 0;
319 virtual
void setWeightsValidation(
bool weightsValidation) noexcept = 0;
320 virtual
bool getWeightsValidation() const noexcept = 0;
321 virtual
bool refitCudaEngineAsync(cudaStream_t stream) noexcept = 0;
322 virtual Weights getWeightsPrototype(
char const* weightsName) const noexcept = 0;
325class VOptimizationProfile : public VRoot
328 virtual bool setDimensions(
char const* inputName,
OptProfileSelector select,
Dims const& dims)
noexcept = 0;
330 virtual bool setShapeValues(
331 char const* inputName,
OptProfileSelector select, int32_t
const* values, int32_t nbValues)
noexcept = 0;
332 virtual int32_t getNbShapeValues(
char const* inputName)
const noexcept = 0;
333 virtual int32_t
const* getShapeValues(
char const* inputName,
OptProfileSelector select)
const noexcept = 0;
334 virtual bool setExtraMemoryTarget(
float target)
noexcept = 0;
335 virtual float getExtraMemoryTarget() const noexcept = 0;
336 virtual
bool isValid() const noexcept = 0;
339 char const* inputName,
OptProfileSelector select, int64_t const* values, int32_t nbValues) noexcept = 0;
344class VCudaEngine : public VRoot
347 virtual ICudaEngine* getPImpl() noexcept = 0;
348 virtual int32_t getNbLayers() const noexcept = 0;
349 virtual IHostMemory* serialize() const noexcept = 0;
351 virtual
bool isRefittable() const noexcept = 0;
352 virtual
char const* getName() const noexcept = 0;
353 virtual int32_t getNbOptimizationProfiles() const noexcept = 0;
354 virtual int32_t const* getProfileTensorValues(
355 char const* tensorName, int32_t profileIndex,
OptProfileSelector select) const noexcept = 0;
357 virtual
void setErrorRecorder(
IErrorRecorder* recorder) noexcept = 0;
359 virtual
bool hasImplicitBatchDimension() const noexcept = 0;
362 virtual IEngineInspector* createEngineInspector() const noexcept = 0;
363 virtual
Dims getTensorShape(
char const* tensorName) const noexcept = 0;
364 virtual
DataType getTensorDataType(
char const* tensorName) const noexcept = 0;
365 virtual
TensorLocation getTensorLocation(
char const* tensorName) const noexcept = 0;
366 virtual
bool isShapeInferenceIO(
char const* tensorName) const noexcept = 0;
367 virtual
TensorIOMode getTensorIOMode(
char const* tensorName) const noexcept = 0;
368 virtual int32_t getTensorBytesPerComponent(
char const* tensorName) const noexcept = 0;
369 virtual int32_t getTensorComponentsPerElement(
char const* tensorName) const noexcept = 0;
370 virtual
TensorFormat getTensorFormat(
char const* tensorName) const noexcept = 0;
371 virtual
char const* getTensorFormatDesc(
char const* tensorName) const noexcept = 0;
372 virtual int32_t getTensorVectorizedDim(
char const* tensorName) const noexcept = 0;
373 virtual
Dims getProfileShape(
374 char const* tensorName, int32_t profileIndex,
OptProfileSelector select) const noexcept = 0;
375 virtual int32_t getNbIOTensors() const noexcept = 0;
376 virtual
char const* getIOTensorName(int32_t index) const noexcept = 0;
378 virtual int32_t getNbAuxStreams() const noexcept = 0;
380 virtual int32_t getTensorBytesPerComponentV2(
char const* tensorName, int32_t profileIndex) const noexcept = 0;
381 virtual int32_t getTensorComponentsPerElementV2(
char const* tensorName, int32_t profileIndex) const noexcept = 0;
382 virtual
TensorFormat getTensorFormatV2(
char const* tensorName, int32_t profileIndex) const noexcept = 0;
383 virtual
char const* getTensorFormatDescV2(
char const* tensorName, int32_t profileIndex) const noexcept = 0;
384 virtual int32_t getTensorVectorizedDimV2(
char const* tensorName, int32_t profileIndex) const noexcept = 0;
386 virtual ISerializationConfig* createSerializationConfig() noexcept = 0;
387 virtual IHostMemory* serializeWithConfig(ISerializationConfig& config) const noexcept = 0;
389 virtual
size_t getDeviceMemorySizeForProfile(int32_t profileIndex) const noexcept = 0;
390 virtual IRefitter* createRefitter(ILogger& logger) noexcept = 0;
392 virtual
bool setWeightStreamingBudget(int64_t gpuMemoryBudget) noexcept = 0;
393 virtual int64_t getWeightStreamingBudget() const noexcept = 0;
394 virtual int64_t getMinimumWeightStreamingBudget() const noexcept = 0;
395 virtual int64_t getStreamableWeightsSize() const noexcept = 0;
397 virtual
bool isDebugTensor(
char const* name) const noexcept = 0;
400 virtual
bool setWeightStreamingBudgetV2(int64_t gpuMemoryBudget) noexcept = 0;
401 virtual int64_t getWeightStreamingBudgetV2() const noexcept = 0;
402 virtual int64_t getWeightStreamingAutomaticBudget() const noexcept = 0;
403 virtual int64_t getWeightStreamingScratchMemorySize() const noexcept = 0;
404 virtual int64_t getDeviceMemorySizeV2() const noexcept = 0;
405 virtual int64_t getDeviceMemorySizeForProfileV2(int32_t profileIndex) const noexcept = 0;
407 TRT_NODISCARD virtual int64_t const* getProfileTensorValuesV2(
408 char const* tensorName, int32_t profileIndex,
OptProfileSelector select) const noexcept = 0;
409 TRT_NODISCARD virtual IExecutionContext* createExecutionContextWithRuntimeConfig(
410 IRuntimeConfig* runtimeConfig) noexcept = 0;
411 TRT_NODISCARD virtual IRuntimeConfig* createRuntimeConfig() noexcept = 0;
415class VExecutionContext : public VRoot
418 virtual IExecutionContext* getPImpl() noexcept = 0;
419 virtual
void setDebugSync(
bool sync) noexcept = 0;
420 virtual
bool getDebugSync() const noexcept = 0;
421 virtual
void setProfiler(
IProfiler*) noexcept = 0;
422 virtual
IProfiler* getProfiler() const noexcept = 0;
423 virtual ICudaEngine const& getEngine() const noexcept = 0;
424 virtual
void setName(
char const* name) noexcept = 0;
425 virtual
char const* getName() const noexcept = 0;
426 virtual
void setDeviceMemory(
void* memory) noexcept = 0;
427 virtual int32_t getOptimizationProfile() const noexcept = 0;
428 virtual
bool allInputDimensionsSpecified() const noexcept = 0;
429 virtual
bool allInputShapesSpecified() const noexcept = 0;
430 virtual
void setErrorRecorder(
IErrorRecorder* recorder) noexcept = 0;
432 virtual
bool executeV2(
void* const* bindings) noexcept = 0;
433 virtual
bool setOptimizationProfileAsync(int32_t profileIndex, cudaStream_t stream) noexcept = 0;
434 virtual
void setEnqueueEmitsProfile(
bool enqueueEmitsProfile) noexcept = 0;
435 virtual
bool getEnqueueEmitsProfile() const noexcept = 0;
436 virtual
bool reportToProfiler() const noexcept = 0;
437 virtual
bool setInputShape(
char const* tensorName,
Dims const& dims) noexcept = 0;
438 virtual
Dims getTensorShape(
char const* tensorName) const noexcept = 0;
439 virtual
Dims getTensorStrides(
char const* tensorName) const noexcept = 0;
440 virtual
bool setTensorAddress(
char const* tensorName,
void* data) noexcept = 0;
441 virtual
void const* getTensorAddress(
char const* tensorName) const noexcept = 0;
442 virtual
bool setInputTensorAddress(
char const* tensorName,
void const* data) noexcept = 0;
443 virtual
bool setOutputTensorAddress(
char const* tensorName,
void* data) noexcept = 0;
444 virtual int32_t inferShapes(int32_t nbMaxNames,
char const** tensorNames) noexcept = 0;
445 virtual
bool setInputConsumedEvent(cudaEvent_t event) noexcept = 0;
446 virtual cudaEvent_t getInputConsumedEvent() const noexcept = 0;
447 virtual
void* getOutputTensorAddress(
char const* tensorName) const noexcept = 0;
448 virtual
bool setOutputAllocator(
char const* tensorName,
IOutputAllocator* outputAllocator) noexcept = 0;
449 virtual
IOutputAllocator* getOutputAllocator(
char const* name) noexcept = 0;
450 virtual int64_t getMaxOutputSize(
char const* tensorName) const noexcept = 0;
451 virtual
bool setTemporaryStorageAllocator(
IGpuAllocator* allocator) noexcept = 0;
452 virtual
IGpuAllocator* getTemporaryStorageAllocator() const noexcept = 0;
453 virtual
bool enqueueV3(cudaStream_t stream) noexcept = 0;
454 virtual
void setPersistentCacheLimit(
size_t size) noexcept = 0;
455 virtual
size_t getPersistentCacheLimit() const noexcept = 0;
458 virtual
void setAuxStreams(cudaStream_t* auxStreams, int32_t nbStreams) noexcept = 0;
459 virtual
bool setDebugListener(
IDebugListener* listener) noexcept = 0;
461 virtual
bool setTensorDebugState(
char const* name,
bool flag) noexcept = 0;
462 virtual
bool getDebugState(
char const* name) const noexcept = 0;
463 virtual
bool setAllTensorsDebugState(
bool flag) noexcept = 0;
464 virtual
size_t updateDeviceMemorySizeForShapes() noexcept = 0;
465 virtual
void setDeviceMemoryV2(
void* memory, int64_t size) noexcept = 0;
466 TRT_NODISCARD virtual IRuntimeConfig* getRuntimeConfig() const noexcept = 0;
467 virtual
bool setUnfusedTensorsDebugState(
bool flag) noexcept = 0;
468 virtual
bool getUnfusedTensorsDebugState() const noexcept = 0;
469#if ENABLE_FEATURE_DISABLE_RUNTIME_ALLOCATION
470 virtual bool isStreamCapturable(cudaStream_t stream)
const noexcept = 0;
474class VEngineInspector :
public VRoot
477 virtual IEngineInspector* getPImpl() noexcept = 0;
478 virtual
bool setExecutionContext(IExecutionContext const* context) noexcept = 0;
479 virtual IExecutionContext const* getExecutionContext() const noexcept = 0;
480 virtual
char const* getLayerInformation(int32_t layerIndex,
LayerInformationFormat format) const noexcept = 0;
482 virtual
void setErrorRecorder(
IErrorRecorder* recorder) noexcept = 0;
486class VTensor : public VRoot
489 virtual void setName(
char const* name)
noexcept = 0;
490 virtual char const* getName() const noexcept = 0;
491 virtual
void setDimensions(
Dims const& dimensions) noexcept = 0;
492 virtual
Dims getDimensions() const noexcept = 0;
493 virtual
void setType(
DataType type) noexcept = 0;
494 virtual
DataType getType() const noexcept = 0;
495 virtual
bool isNetworkInput() const noexcept = 0;
496 virtual
bool isNetworkOutput() const noexcept = 0;
497 virtual
void setAllowedFormats(
TensorFormats formats) noexcept = 0;
498 virtual
TensorFormats getAllowedFormats() const noexcept = 0;
499 virtual
bool isShapeTensor() const noexcept = 0;
500 virtual
bool isExecutionTensor() const noexcept = 0;
501 virtual
void setDimensionName(int32_t index,
char const* name) noexcept = 0;
502 virtual
char const* getDimensionName(int32_t index) const noexcept = 0;
505class VLayer : public VRoot
508 virtual LayerType getType() const noexcept = 0;
509 virtual
void setName(
char const* name) noexcept = 0;
510 virtual
char const* getName() const noexcept = 0;
511 virtual int32_t getNbInputs() const noexcept = 0;
512 virtual ITensor* getInput(int32_t index) const noexcept = 0;
513 virtual int32_t getNbOutputs() const noexcept = 0;
514 virtual ITensor* getOutput(int32_t index) const noexcept = 0;
515 virtual
void setInput(int32_t index, ITensor& tensor) noexcept = 0;
516 virtual
void setPrecision(
DataType dataType) noexcept = 0;
517 virtual
DataType getPrecision() const noexcept = 0;
518 virtual
bool precisionIsSet() const noexcept = 0;
519 virtual
void resetPrecision() noexcept = 0;
520 virtual
void setOutputType(int32_t index,
DataType dataType) noexcept = 0;
521 virtual
DataType getOutputType(int32_t index) const noexcept = 0;
522 virtual
bool outputTypeIsSet(int32_t index) const noexcept = 0;
523 virtual
void resetOutputType(int32_t index) noexcept = 0;
524 virtual
void setMetadata(
char const* docString) noexcept = 0;
525 virtual
char const* getMetadata() const noexcept = 0;
528class VConvolutionLayer : public VRoot
531 virtual void setNbOutputMaps(int64_t nbOutputMaps)
noexcept = 0;
532 virtual int64_t getNbOutputMaps() const noexcept = 0;
533 virtual
void setNbGroups(int64_t nbGroups) noexcept = 0;
534 virtual int64_t getNbGroups() const noexcept = 0;
535 virtual
void setKernelWeights(Weights weights) noexcept = 0;
536 virtual Weights getKernelWeights() const noexcept = 0;
537 virtual
void setBiasWeights(Weights weights) noexcept = 0;
538 virtual Weights getBiasWeights() const noexcept = 0;
539 virtual
void setPrePadding(
Dims const& padding) noexcept = 0;
540 virtual
Dims getPrePadding() const noexcept = 0;
541 virtual
void setPostPadding(
Dims const& padding) noexcept = 0;
542 virtual
Dims getPostPadding() const noexcept = 0;
543 virtual
void setPaddingMode(
PaddingMode paddingMode) noexcept = 0;
544 virtual
PaddingMode getPaddingMode() const noexcept = 0;
545 virtual
void setKernelSizeNd(
Dims const& kernelSize) noexcept = 0;
546 virtual
Dims getKernelSizeNd() const noexcept = 0;
547 virtual
void setStrideNd(
Dims const& stride) noexcept = 0;
548 virtual
Dims getStrideNd() const noexcept = 0;
549 virtual
void setPaddingNd(
Dims const& padding) noexcept = 0;
550 virtual
Dims getPaddingNd() const noexcept = 0;
551 virtual
void setDilationNd(
Dims const& dilation) noexcept = 0;
552 virtual
Dims getDilationNd() const noexcept = 0;
555class VActivationLayer : public VRoot
560 virtual
void setAlpha(
float alpha) noexcept = 0;
561 virtual
void setBeta(
float beta) noexcept = 0;
562 virtual
float getAlpha() const noexcept = 0;
563 virtual
float getBeta() const noexcept = 0;
566class VPoolingLayer : public VRoot
569 virtual void setPoolingType(
PoolingType type)
noexcept = 0;
570 virtual PoolingType getPoolingType() const noexcept = 0;
571 virtual
void setBlendFactor(
float blendFactor) noexcept = 0;
572 virtual
float getBlendFactor() const noexcept = 0;
573 virtual
void setAverageCountExcludesPadding(
bool exclusive) noexcept = 0;
574 virtual
bool getAverageCountExcludesPadding() const noexcept = 0;
575 virtual
void setPrePadding(
Dims const& padding) noexcept = 0;
576 virtual
Dims getPrePadding() const noexcept = 0;
577 virtual
void setPostPadding(
Dims const& padding) noexcept = 0;
578 virtual
Dims getPostPadding() const noexcept = 0;
579 virtual
void setPaddingMode(
PaddingMode paddingMode) noexcept = 0;
580 virtual
PaddingMode getPaddingMode() const noexcept = 0;
581 virtual
void setWindowSizeNd(
Dims const& windowSize) noexcept = 0;
582 virtual
Dims getWindowSizeNd() const noexcept = 0;
583 virtual
void setStrideNd(
Dims const& stride) noexcept = 0;
584 virtual
Dims getStrideNd() const noexcept = 0;
585 virtual
void setPaddingNd(
Dims const& padding) noexcept = 0;
586 virtual
Dims getPaddingNd() const noexcept = 0;
589class VLRNLayer : public VRoot
592 virtual void setWindowSize(int64_t windowSize)
noexcept = 0;
593 virtual int64_t getWindowSize() const noexcept = 0;
594 virtual
void setAlpha(
float alpha) noexcept = 0;
595 virtual
float getAlpha() const noexcept = 0;
596 virtual
void setBeta(
float beta) noexcept = 0;
597 virtual
float getBeta() const noexcept = 0;
598 virtual
void setK(
float k) noexcept = 0;
599 virtual
float getK() const noexcept = 0;
602class VScaleLayer : public VRoot
605 virtual void setMode(
ScaleMode mode)
noexcept = 0;
606 virtual ScaleMode getMode() const noexcept = 0;
607 virtual
void setShift(Weights shift) noexcept = 0;
608 virtual Weights getShift() const noexcept = 0;
609 virtual
void setScale(Weights scale) noexcept = 0;
610 virtual Weights getScale() const noexcept = 0;
611 virtual
void setPower(Weights power) noexcept = 0;
612 virtual Weights getPower() const noexcept = 0;
613 virtual int32_t getChannelAxis() const noexcept = 0;
614 virtual
void setChannelAxis(int32_t channelAxis) noexcept = 0;
617class VSoftMaxLayer : public VRoot
620 virtual void setAxes(uint32_t axes)
noexcept = 0;
621 virtual uint32_t getAxes() const noexcept = 0;
624class VConcatenationLayer : public VRoot
627 virtual void setAxis(int32_t axis)
noexcept = 0;
628 virtual int32_t getAxis() const noexcept = 0;
631class VDeconvolutionLayer : public VRoot
634 virtual void setNbOutputMaps(int64_t nbOutputMaps)
noexcept = 0;
635 virtual int64_t getNbOutputMaps() const noexcept = 0;
636 virtual
void setNbGroups(int64_t nbGroups) noexcept = 0;
637 virtual int64_t getNbGroups() const noexcept = 0;
638 virtual
void setKernelWeights(Weights weights) noexcept = 0;
639 virtual Weights getKernelWeights() const noexcept = 0;
640 virtual
void setBiasWeights(Weights weights) noexcept = 0;
641 virtual Weights getBiasWeights() const noexcept = 0;
642 virtual
void setPrePadding(
Dims const& padding) noexcept = 0;
643 virtual
Dims getPrePadding() const noexcept = 0;
644 virtual
void setPostPadding(
Dims const& padding) noexcept = 0;
645 virtual
Dims getPostPadding() const noexcept = 0;
646 virtual
void setPaddingMode(
PaddingMode paddingMode) noexcept = 0;
647 virtual
PaddingMode getPaddingMode() const noexcept = 0;
648 virtual
void setKernelSizeNd(
Dims const& kernelSize) noexcept = 0;
649 virtual
Dims getKernelSizeNd() const noexcept = 0;
650 virtual
void setStrideNd(
Dims const& stride) noexcept = 0;
651 virtual
Dims getStrideNd() const noexcept = 0;
652 virtual
void setPaddingNd(
Dims const& padding) noexcept = 0;
653 virtual
Dims getPaddingNd() const noexcept = 0;
654 virtual
void setDilationNd(
Dims const& dilation) noexcept = 0;
655 virtual
Dims getDilationNd() const noexcept = 0;
658class VElementWiseLayer : public VRoot
665class VGatherLayer : public VRoot
668 virtual void setGatherAxis(int32_t axis)
noexcept = 0;
669 virtual int32_t getGatherAxis() const noexcept = 0;
670 virtual
void setNbElementWiseDims(int32_t k) noexcept = 0;
671 virtual int32_t getNbElementWiseDims() const noexcept = 0;
672 virtual
void setMode(
GatherMode mode) noexcept = 0;
673 virtual
GatherMode getMode() const noexcept = 0;
676class VPluginLayer : public VRoot
679 virtual IPlugin& getPlugin() noexcept = 0;
682class VPluginV2Layer : public VRoot
685 virtual IPluginV2& getPlugin() noexcept = 0;
688class VPluginV3Layer : public VRoot
691 virtual IPluginV3& getPlugin() noexcept = 0;
694class VUnaryLayer : public VRoot
701class VReduceLayer : public VRoot
706 virtual
void setReduceAxes(uint32_t reduceAxes) noexcept = 0;
707 virtual uint32_t getReduceAxes() const noexcept = 0;
708 virtual
void setKeepDimensions(
bool keepDimensions) noexcept = 0;
709 virtual
bool getKeepDimensions() const noexcept = 0;
712class VPaddingLayer : public VRoot
715 virtual void setPrePaddingNd(
Dims const& padding)
noexcept = 0;
716 virtual Dims getPrePaddingNd() const noexcept = 0;
717 virtual
void setPostPaddingNd(
Dims const& padding) noexcept = 0;
718 virtual
Dims getPostPaddingNd() const noexcept = 0;
721class VShuffleLayer : public VRoot
724 virtual void setFirstTranspose(Permutation
const& permutation)
noexcept = 0;
725 virtual Permutation
const& getFirstTranspose() const noexcept = 0;
726 virtual
void setReshapeDimensions(
Dims const& dimensions) noexcept = 0;
727 virtual
Dims getReshapeDimensions() const noexcept = 0;
728 virtual
void setSecondTranspose(Permutation const& permutation) noexcept = 0;
729 virtual Permutation const& getSecondTranspose() const noexcept = 0;
730 virtual
void setZeroIsPlaceholder(
bool zeroIsPlaceholder) noexcept = 0;
731 virtual
bool getZeroIsPlaceholder() const noexcept = 0;
734class VSliceLayer : public VRoot
737 virtual void setStart(
Dims const& start)
noexcept = 0;
738 virtual Dims getStart() const noexcept = 0;
739 virtual
void setSize(
Dims const& size) noexcept = 0;
740 virtual
Dims getSize() const noexcept = 0;
741 virtual
void setStride(
Dims const& stride) noexcept = 0;
742 virtual
Dims getStride() const noexcept = 0;
743 virtual
void setMode(
SampleMode mode) noexcept = 0;
744 virtual
SampleMode getMode() const noexcept = 0;
745 virtual
void setAxes(
Dims const& axes) noexcept = 0;
746 virtual
Dims getAxes() const noexcept = 0;
749class VShapeLayer : public VRoot
754class VTopKLayer :
public VRoot
759 virtual
void setK(int32_t k) noexcept = 0;
760 virtual int32_t getK() const noexcept = 0;
761 virtual
void setReduceAxes(uint32_t reduceAxes) noexcept = 0;
762 virtual uint32_t getReduceAxes() const noexcept = 0;
763 virtual
bool setIndicesType(
DataType type) noexcept = 0;
764 virtual
DataType getIndicesType() const noexcept = 0;
767class VMatrixMultiplyLayer : public VRoot
770 virtual void setOperation(int32_t index,
MatrixOperation op)
noexcept = 0;
771 virtual MatrixOperation getOperation(int32_t index)
const noexcept = 0;
774class VNonZeroLayer :
public VRoot
777 virtual bool setIndicesType(
DataType type)
noexcept = 0;
778 virtual DataType getIndicesType() const noexcept = 0;
781class VRaggedSoftMaxLayer : public VRoot
786class VIdentityLayer :
public VRoot
791class VCastLayer :
public VRoot
794 virtual void setToType(
DataType toType)
noexcept = 0;
795 virtual DataType getToType() const noexcept = 0;
798class VConstantLayer : public VRoot
801 virtual void setWeights(Weights weights)
noexcept = 0;
802 virtual Weights getWeights() const noexcept = 0;
803 virtual
void setDimensions(
Dims const& dimensions) noexcept = 0;
804 virtual
Dims getDimensions() const noexcept = 0;
807class VParametricReLULayer : public VRoot
812class VResizeLayer :
public VRoot
815 virtual void setOutputDimensions(
Dims const& dimensions)
noexcept = 0;
816 virtual Dims getOutputDimensions() const noexcept = 0;
817 virtual
void setScales(
float const* scales, int32_t nbScales) noexcept = 0;
818 virtual int32_t getScales(int32_t size,
float* scales) const noexcept = 0;
823 virtual
void setSelectorForSinglePixel(
ResizeSelector selector) noexcept = 0;
824 virtual
ResizeSelector getSelectorForSinglePixel() const noexcept = 0;
827 virtual
void setCubicCoeff(
float value) noexcept = 0;
828 virtual
float getCubicCoeff() const noexcept = 0;
829 virtual
void setExcludeOutside(
bool value) noexcept = 0;
830 virtual
bool getExcludeOutside() const noexcept = 0;
833class VLoopBoundaryLayer : public VRoot
836 virtual ILoop* getLoop() const noexcept = 0;
839class VRecurrenceLayer : public VRoot
844class VLoopOutputLayer :
public VRoot
847 virtual LoopOutput getLoopOutput() const noexcept = 0;
848 virtual
void setAxis(int32_t axis) noexcept = 0;
849 virtual int32_t getAxis() const noexcept = 0;
852class VTripLimitLayer : public VRoot
855 virtual TripLimit getTripLimit() const noexcept = 0;
858class VIteratorLayer : public VRoot
861 virtual void setAxis(int32_t axis)
noexcept = 0;
862 virtual int32_t getAxis() const noexcept = 0;
863 virtual
void setReverse(
bool reverse) noexcept = 0;
864 virtual
bool getReverse() const noexcept = 0;
866class VLoop : public VRoot
869 virtual IRecurrenceLayer* addRecurrence(ITensor& initialValue)
noexcept = 0;
870 virtual ITripLimitLayer* addTripLimit(ITensor& tensor,
TripLimit limit)
noexcept = 0;
871 virtual IIteratorLayer* addIterator(ITensor& tensor, int32_t axis = 0,
bool reverse =
false) noexcept = 0;
872 virtual ILoopOutputLayer* addLoopOutput(ITensor& tensor,
LoopOutput outputKind, int32_t axis = 0) noexcept = 0;
873 virtual
void setName(
char const* name) noexcept = 0;
874 virtual
char const* getName() const noexcept = 0;
877class VConditionalBoundaryLayer : public VRoot
880 virtual IIfConditional* getConditional() const noexcept = 0;
883class VConditionLayer : public VRoot
888class VConditionalInputLayer :
public VRoot
893class VConditionalOutputLayer :
public VRoot
898class VIfConditional :
public VRoot
901 virtual IConditionLayer* setCondition(ITensor& tensor)
noexcept = 0;
902 virtual IIfConditionalInputLayer* addInput(ITensor& tensor)
noexcept = 0;
903 virtual IIfConditionalOutputLayer* addOutput(ITensor& trueTensor, ITensor& falseTensor)
noexcept = 0;
904 virtual void setName(
char const* name)
noexcept = 0;
905 virtual char const* getName() const noexcept = 0;
908class VAttentionBoundaryLayer : public VRoot
911 virtual IAttention* getAttention() const noexcept = 0;
914class VAttentionInputLayer : public VRoot
919class VAttentionOutputLayer :
public VRoot
924class VAttention :
public VRoot
927 TRT_NODISCARD virtual bool setInput(int32_t index, ITensor& input)
noexcept = 0;
928 TRT_NODISCARD virtual int32_t getNbInputs() const noexcept = 0;
929 TRT_NODISCARD virtual ITensor* getInput(int32_t index) const noexcept = 0;
930 TRT_NODISCARD virtual int32_t getNbOutputs() const noexcept = 0;
931 TRT_NODISCARD virtual ITensor* getOutput(int32_t index) const noexcept = 0;
932 TRT_NODISCARD virtual
bool setName(
char const* name) noexcept = 0;
933 TRT_NODISCARD virtual
char const* getName() const noexcept = 0;
936 TRT_NODISCARD virtual
bool setCausal(
bool isCausal) noexcept = 0;
938 TRT_NODISCARD virtual
bool setMask(ITensor& mask) noexcept = 0;
940 TRT_NODISCARD virtual
bool setDecomposable(
bool decomposable) noexcept = 0;
941 TRT_NODISCARD virtual
bool getDecomposable() const noexcept = 0;
942 TRT_NODISCARD virtual
bool setNormalizationQuantizeScale(ITensor& tensor) noexcept = 0;
943 TRT_NODISCARD virtual ITensor* getNormalizationQuantizeScale() const noexcept = 0;
948class VSelectLayer : public VRoot
952class VAssertionLayer :
public VRoot
955 virtual void setMessage(
char const* message)
noexcept = 0;
956 virtual char const* getMessage() const noexcept = 0;
959class VFillLayer : public VRoot
962 virtual void setDimensions(
Dims const& dimensions)
noexcept = 0;
963 virtual Dims getDimensions() const noexcept = 0;
966 virtual
void setAlpha(
double alpha) noexcept = 0;
967 virtual
double getAlpha() const noexcept = 0;
968 virtual
void setBeta(
double beta) noexcept = 0;
969 virtual
double getBeta() const noexcept = 0;
970 virtual
void setAlphaInt64(int64_t alpha) noexcept = 0;
971 virtual int64_t getAlphaInt64() const noexcept = 0;
972 virtual
void setBetaInt64(int64_t beta) noexcept = 0;
973 virtual int64_t getBetaInt64() const noexcept = 0;
974 virtual
bool isAlphaBetaInt64() const noexcept = 0;
975 virtual
DataType getToType() const noexcept = 0;
976 virtual
void setToType(
DataType toType) noexcept = 0;
979class VQuantizeLayer : public VRoot
982 virtual int32_t getAxis() const noexcept = 0;
983 virtual
void setAxis(int32_t axis) noexcept = 0;
984 virtual
DataType getToType() const noexcept = 0;
985 virtual
void setToType(
DataType toType) noexcept = 0;
988class VDequantizeLayer : public VRoot
991 virtual int32_t getAxis() const noexcept = 0;
992 virtual
void setAxis(int32_t axis) noexcept = 0;
993 virtual
DataType getToType() const noexcept = 0;
994 virtual
void setToType(
DataType toType) noexcept = 0;
997class VDynamicQuantizeLayer : public VRoot
1000 virtual int32_t getAxis() const noexcept = 0;
1001 virtual
void setAxis(int32_t axis) noexcept = 0;
1002 virtual int32_t getBlockSize() const noexcept = 0;
1003 virtual
void setBlockSize(int32_t axis) noexcept = 0;
1004 virtual
DataType getScaleType() const noexcept = 0;
1005 virtual
void setScaleType(
DataType axis) noexcept = 0;
1006 virtual
DataType getToType() const noexcept = 0;
1007 virtual
void setToType(
DataType toType) noexcept = 0;
1010class VScatterLayer : public VRoot
1013 virtual void setMode(
ScatterMode mode)
noexcept = 0;
1015 virtual
void setAxis(int32_t axis) noexcept = 0;
1016 virtual int32_t getAxis() const noexcept = 0;
1019class VEinsumLayer : public VRoot
1022 virtual bool setEquation(
char const* equation)
noexcept = 0;
1023 virtual char const* getEquation() const noexcept = 0;
1026class VOneHotLayer : public VRoot
1029 virtual int32_t getAxis() const noexcept = 0;
1030 virtual
void setAxis(int32_t axis) noexcept = 0;
1033class VGridSampleLayer : public VRoot
1038 virtual
void setAlignCorners(
bool alignCorners) noexcept = 0;
1039 virtual
bool getAlignCorners() const noexcept = 0;
1040 virtual
bool setSampleMode(
SampleMode mode) noexcept = 0;
1041 virtual
SampleMode getSampleMode() const noexcept = 0;
1044class VNMSLayer : public VRoot
1049 virtual
void setTopKBoxLimit(int32_t limit) noexcept = 0;
1050 virtual int32_t getTopKBoxLimit() const noexcept = 0;
1051 virtual
bool setIndicesType(
DataType type) noexcept = 0;
1052 virtual
DataType getIndicesType() const noexcept = 0;
1055class VReverseSequenceLayer : public VRoot
1058 virtual void setBatchAxis(int32_t batchAxis)
noexcept = 0;
1059 virtual int32_t getBatchAxis() const noexcept = 0;
1061 virtual
void setSequenceAxis(int32_t sequenceAxis) noexcept = 0;
1062 virtual int32_t getSequenceAxis() const noexcept = 0;
1065class VNormalizationLayer : public VRoot
1068 virtual void setEpsilon(
float eps)
noexcept = 0;
1069 virtual float getEpsilon() const noexcept = 0;
1070 virtual
void setAxes(uint32_t axesMask) noexcept = 0;
1071 virtual uint32_t getAxes() const noexcept = 0;
1072 virtual
void setNbGroups(int64_t nbGroups) noexcept = 0;
1073 virtual int64_t getNbGroups() const noexcept = 0;
1074 virtual
void setComputePrecision(
DataType type) noexcept = 0;
1075 virtual
DataType getComputePrecision() const noexcept = 0;
1078class VSqueezeLayer : public VRoot
1082class VUnsqueezeLayer :
public VRoot
1086class VCumulativeLayer :
public VRoot
1091 virtual
void setExclusive(
bool exclusive) noexcept = 0;
1092 virtual
bool getExclusive() const noexcept = 0;
1093 virtual
void setReverse(
bool reverse) noexcept = 0;
1094 virtual
bool getReverse() const noexcept = 0;
1098class VNetworkDefinition : public VRoot
1101 virtual ITensor* addInput(
char const* name,
DataType type,
Dims const& dimensions)
noexcept = 0;
1102 virtual void markOutput(ITensor& tensor)
noexcept = 0;
1103 virtual IActivationLayer* addActivation(ITensor& input,
ActivationType type)
noexcept = 0;
1104 virtual ILRNLayer* addLRN(ITensor& input, int64_t window,
float alpha,
float beta,
float k)
noexcept = 0;
1105 virtual IScaleLayer* addScale(
1106 ITensor& input,
ScaleMode mode, Weights shift, Weights scale, Weights power)
noexcept = 0;
1107 virtual ISoftMaxLayer* addSoftMax(ITensor& input)
noexcept = 0;
1108 virtual IConcatenationLayer* addConcatenation(ITensor*
const* inputs, int32_t nbInputs)
noexcept = 0;
1109 virtual IElementWiseLayer* addElementWise(ITensor& input1, ITensor& input2,
ElementWiseOperation op)
noexcept = 0;
1110 virtual IUnaryLayer* addUnary(ITensor& input,
UnaryOperation operation)
noexcept = 0;
1111 virtual IShuffleLayer* addShuffle(ITensor& input)
noexcept = 0;
1112 virtual int32_t getNbLayers() const noexcept = 0;
1113 virtual ILayer* getLayer(int32_t index) const noexcept = 0;
1114 virtual int32_t getNbInputs() const noexcept = 0;
1115 virtual ITensor* getInput(int32_t index) const noexcept = 0;
1116 virtual int32_t getNbOutputs() const noexcept = 0;
1117 virtual ITensor* getOutput(int32_t index) const noexcept = 0;
1118 virtual IReduceLayer* addReduce(
1119 ITensor& input,
ReduceOperation operation, uint32_t reduceAxes,
bool keepDimensions) noexcept
1121 virtual ITopKLayer* addTopK(ITensor& input,
TopKOperation op, int32_t k, uint32_t reduceAxes) noexcept = 0;
1122 virtual IGatherLayer* addGather(ITensor& data, ITensor& indices, int32_t axis) noexcept = 0;
1123 virtual IRaggedSoftMaxLayer* addRaggedSoftMax(ITensor& input, ITensor& bounds) noexcept = 0;
1124 virtual IMatrixMultiplyLayer* addMatrixMultiply(
1126 virtual IConstantLayer* addConstant(
Dims const& dimensions, Weights weights) noexcept = 0;
1127 virtual IIdentityLayer* addIdentity(ITensor& input) noexcept = 0;
1128 virtual
void removeTensor(ITensor& tensor) noexcept = 0;
1129 virtual
void unmarkOutput(ITensor& tensor) noexcept = 0;
1130 virtual ISliceLayer* addSlice(ITensor& input,
Dims const& start,
Dims const& size,
Dims const& stride) noexcept = 0;
1131 virtual
void setName(
char const* name) noexcept = 0;
1132 virtual
char const* getName() const noexcept = 0;
1133 virtual IShapeLayer* addShape(ITensor& input) noexcept = 0;
1134 virtual
bool hasImplicitBatchDimension() const noexcept = 0;
1135 virtual
bool markOutputForShapes(ITensor& tensor) noexcept = 0;
1136 virtual
bool unmarkOutputForShapes(ITensor& tensor) noexcept = 0;
1137 virtual IParametricReLULayer* addParametricReLU(ITensor& input, ITensor& slope) noexcept = 0;
1138 virtual IConvolutionLayer* addConvolutionNd(
1139 ITensor& input, int64_t nbOutputMaps,
Dims const& kernelSize, Weights kernelWeights, Weights biasWeights) noexcept
1141 virtual IPoolingLayer* addPoolingNd(ITensor& input,
PoolingType type,
Dims const& windowSize) noexcept = 0;
1142 virtual IDeconvolutionLayer* addDeconvolutionNd(
1143 ITensor& input, int64_t nbOutputMaps,
Dims const& kernelSize, Weights kernelWeights, Weights biasWeights) noexcept
1145 virtual IScaleLayer* addScaleNd(
1146 ITensor& input,
ScaleMode mode, Weights shift, Weights scale, Weights power, int32_t channelAxis) noexcept = 0;
1147 virtual IResizeLayer* addResize(ITensor& input) noexcept = 0;
1148 virtual ILoop* addLoop() noexcept = 0;
1149 virtual ISelectLayer* addSelect(ITensor& condition, ITensor& thenInput, ITensor& elseInput) noexcept = 0;
1150 virtual IFillLayer* addFill(
Dims const& dimensions,
FillOperation op) noexcept = 0;
1151 virtual IPaddingLayer* addPaddingNd(ITensor& input,
Dims const& prePadding,
Dims const& postPadding) noexcept = 0;
1152 virtual
bool setWeightsName(Weights weights,
char const* name) noexcept = 0;
1153 virtual
void setErrorRecorder(
IErrorRecorder* recorder) noexcept = 0;
1155 virtual IGatherLayer* addGatherV2(ITensor& data, ITensor& indices,
GatherMode mode) noexcept = 0;
1156 virtual IIfConditional* addIfConditional() noexcept = 0;
1157 virtual IScatterLayer* addScatter(ITensor& data, ITensor& indices, ITensor& updates,
ScatterMode mode) noexcept = 0;
1158 virtual IEinsumLayer* addEinsum(ITensor* const* inputs, int32_t nbInputs,
char const* equation) noexcept = 0;
1159 virtual IAssertionLayer* addAssertion(ITensor& condition,
char const* message) noexcept = 0;
1160 virtual IOneHotLayer* addOneHot(ITensor& indices, ITensor& values, ITensor& depth, int32_t axis) noexcept = 0;
1161 virtual INonZeroLayer* addNonZero(ITensor& input) noexcept = 0;
1162 virtual IGridSampleLayer* addGridSample(ITensor& input, ITensor& grid) noexcept = 0;
1163 virtual INMSLayer* addNMS(ITensor& boxes, ITensor& scores, ITensor& maxOutputBoxesPerClass) noexcept = 0;
1164 virtual IReverseSequenceLayer* addReverseSequence(ITensor& input, ITensor& sequenceLens) noexcept = 0;
1165 virtual INormalizationLayer* addNormalization(
1166 ITensor& input, ITensor& scale, ITensor& bias, uint32_t axesMask) noexcept = 0;
1167 virtual ICastLayer* addCast(ITensor& input,
DataType toType) noexcept = 0;
1168 virtual IBuilder& getBuilder() const noexcept = 0;
1171 virtual IQuantizeLayer* addQuantizeV2(ITensor& input, ITensor& scale,
DataType outputType) noexcept = 0;
1172 virtual IDequantizeLayer* addDequantizeV2(ITensor& input, ITensor& scale,
DataType outputType) noexcept = 0;
1174 virtual
bool markDebug(ITensor& tensor) noexcept = 0;
1175 virtual
bool unmarkDebug(ITensor& tensor) noexcept = 0;
1176 virtual
bool isDebugTensor(ITensor const& tensor) const noexcept = 0;
1177 virtual
bool markWeightsRefittable(
char const* name) noexcept = 0;
1178 virtual
bool unmarkWeightsRefittable(
char const* name) noexcept = 0;
1179 virtual
bool areWeightsMarkedRefittable(
char const* name) const noexcept = 0;
1180 virtual ISqueezeLayer* addSqueeze(ITensor& input, ITensor& axes) noexcept = 0;
1181 virtual IUnsqueezeLayer* addUnsqueeze(ITensor& input, ITensor& axes) noexcept = 0;
1182 virtual IDynamicQuantizeLayer* addDynamicQuantize(
1183 ITensor& input, int32_t axis, int32_t blockSize,
DataType toType,
DataType scaleType) noexcept
1185 virtual ICumulativeLayer* addCumulative(
1186 ITensor& input, ITensor& axis,
CumulativeOperation operation,
bool exclusive,
bool reverse) noexcept
1188 virtual
bool markUnfusedTensorsAsDebugTensors() noexcept = 0;
1189 virtual
bool unmarkUnfusedTensorsAsDebugTensors() noexcept = 0;
1190 virtual ITopKLayer* addTopKV2(
1193 virtual INonZeroLayer* addNonZeroV2(ITensor& input,
DataType indicesType) noexcept = 0;
1194 virtual INMSLayer* addNMSV2(
1195 ITensor& boxes, ITensor& scores, ITensor& maxOutputBoxesPerClass,
DataType indicesType) noexcept
1197 virtual IAttention* addAttention(
1203class VTimingCache : public VRoot
1207 virtual
bool combine(ITimingCache const& inputCache,
bool ignoreMismatch) noexcept = 0;
1208 virtual
bool reset() noexcept = 0;
1209 virtual int64_t queryKeys(TimingCacheKey* keyBuffer, int64_t capacity) const noexcept = 0;
1210 virtual TimingCacheValue query(TimingCacheKey const& key) const noexcept = 0;
1211 virtual
bool update(TimingCacheKey const& key, TimingCacheValue const& value) noexcept = 0;
1214class VBuilderConfig : public VRoot
1217 virtual void setAvgTimingIterations(int32_t avgTiming)
noexcept = 0;
1218 virtual int32_t getAvgTimingIterations() const noexcept = 0;
1219 virtual
void setEngineCapability(
EngineCapability capability) noexcept = 0;
1221 virtual
void setFlags(
BuilderFlags builderFlags) noexcept = 0;
1223 virtual
void clearFlag(
BuilderFlag builderFlag) noexcept = 0;
1224 virtual
void setFlag(
BuilderFlag builderFlag) noexcept = 0;
1225 virtual
bool getFlag(
BuilderFlag builderFlag) const noexcept = 0;
1226 virtual
void setDeviceType(ILayer const* layer,
DeviceType deviceType) noexcept = 0;
1227 virtual
DeviceType getDeviceType(ILayer const* layer) const noexcept = 0;
1228 virtual
bool isDeviceTypeSet(ILayer const* layer) const noexcept = 0;
1229 virtual
void resetDeviceType(ILayer const* layer) noexcept = 0;
1230 virtual
bool canRunOnDLA(ILayer const* layer) const noexcept = 0;
1231 virtual
void setDLACore(int32_t dlaCore) noexcept = 0;
1232 virtual int32_t getDLACore() const noexcept = 0;
1233 virtual
void setDefaultDeviceType(
DeviceType deviceType) noexcept = 0;
1234 virtual
DeviceType getDefaultDeviceType() const noexcept = 0;
1235 virtual
void reset() noexcept = 0;
1236 virtual
void setProfileStream(const cudaStream_t stream) noexcept = 0;
1237 virtual cudaStream_t getProfileStream() const noexcept = 0;
1238 virtual int32_t addOptimizationProfile(IOptimizationProfile const* profile) noexcept = 0;
1239 virtual int32_t getNbOptimizationProfiles() const noexcept = 0;
1242 virtual
bool setTacticSources(
TacticSources tacticSources) noexcept = 0;
1243 virtual
TacticSources getTacticSources() const noexcept = 0;
1244 virtual
nvinfer1::ITimingCache* createTimingCache(
void const* blob, std::
size_t size) const noexcept = 0;
1245 virtual
bool setTimingCache(ITimingCache const& cache,
bool ignoreMismatch) noexcept = 0;
1246 virtual
nvinfer1::ITimingCache const* getTimingCache() const noexcept = 0;
1247 virtual
void setMemoryPoolLimit(
MemoryPoolType pool, std::
size_t poolSize) noexcept = 0;
1248 virtual std::
size_t getMemoryPoolLimit(
MemoryPoolType pool) const noexcept = 0;
1249 virtual
void setPreviewFeature(
PreviewFeature feature,
bool enable) noexcept = 0;
1250 virtual
bool getPreviewFeature(
PreviewFeature feature) const noexcept = 0;
1251 virtual
void setBuilderOptimizationLevel(int32_t level) noexcept = 0;
1252 virtual int32_t getBuilderOptimizationLevel() const noexcept = 0;
1255 virtual
void setPluginsToSerialize(
char const* const* paths, int32_t nbPaths) noexcept = 0;
1256 virtual
char const* getPluginToSerialize(int32_t index) const noexcept = 0;
1257 virtual int32_t getNbPluginsToSerialize() const noexcept = 0;
1258 virtual
void setMaxAuxStreams(int32_t nbStreams) noexcept = 0;
1259 virtual int32_t getMaxAuxStreams() const noexcept = 0;
1262 virtual
void setRuntimePlatform(
RuntimePlatform runtimePlatform) noexcept = 0;
1264 virtual
void setMaxNbTactics(int32_t maxTactics) noexcept = 0;
1265 virtual int32_t getMaxNbTactics() const noexcept = 0;
1268 virtual
bool setL2LimitForTiling(int64_t size) noexcept = 0;
1269 virtual int64_t getL2LimitForTiling() const noexcept = 0;
1270 TRT_NODISCARD virtual
bool setNbComputeCapabilities(int32_t maxNbComputeCapabilities) noexcept = 0;
1271 TRT_NODISCARD virtual int32_t getNbComputeCapabilities() const noexcept = 0;
1276class VSerializationConfig : public VRoot
1286class VBuilder : public VRoot
1289 virtual bool platformHasFastFp16() const noexcept = 0;
1290 virtual
bool platformHasFastInt8() const noexcept = 0;
1291 virtual int32_t getMaxDLABatchSize() const noexcept = 0;
1292 virtual int32_t getNbDLACores() const noexcept = 0;
1293 virtual
void setGpuAllocator(
IGpuAllocator* allocator) noexcept = 0;
1294 virtual
nvinfer1::IBuilderConfig* createBuilderConfig() noexcept = 0;
1296 virtual
nvinfer1::IOptimizationProfile* createOptimizationProfile() noexcept = 0;
1297 virtual
void setErrorRecorder(
IErrorRecorder* recorder) noexcept = 0;
1299 virtual
void reset() noexcept = 0;
1300 virtual
bool platformHasTf32() const noexcept = 0;
1301 virtual
nvinfer1::IHostMemory* buildSerializedNetwork(
1302 INetworkDefinition& network, IBuilderConfig& config) noexcept = 0;
1303 virtual
bool isNetworkSupported(INetworkDefinition const& network, IBuilderConfig const& config) const noexcept = 0;
1304 virtual ILogger*
getLogger() const noexcept = 0;
1305 virtual
bool setMaxThreads(int32_t maxThreads) noexcept = 0;
1306 virtual int32_t getMaxThreads() const noexcept = 0;
1308 virtual
bool buildSerializedNetworkToStream(
1309 INetworkDefinition& network, IBuilderConfig& config,
IStreamWriter& writer) noexcept = 0;
1312class VRuntimeConfig : public VRoot
1315 virtual IRuntimeConfig* getPImpl() noexcept = 0;
1319 virtual
bool setRuntimeCache(
nvinfer1::IRuntimeCache const& cache) noexcept = 0;
1321 virtual
void setDynamicShapesKernelSpecializationStrategy(
1328class VRuntimeCache : public VRoot
1332 virtual
bool deserialize(
void const* blob,
size_t size) noexcept = 0;
1333 virtual
bool reset() noexcept = 0;
TENSORRTAPI nvinfer1::IPluginRegistry * getPluginRegistry() noexcept
Return the plugin registry.
TENSORRTAPI nvinfer1::ILogger * getLogger() noexcept
Return the logger object.
#define TRT_NODISCARD
A stand-in for [[nodiscard]] and [[nodiscard(REASON)]] that works with older compilers.
Definition: NvInferRuntimeBase.h:57
Structure to define the dimensions of a tensor.
User-implemented callback for notification when value of a debug tensor is updated.
Reference counted application-implemented error reporting interface for TensorRT objects.
Application-implemented class for controlling allocation on the GPU.
Callback from ExecutionContext::enqueueV3()
Plugin class for the V3 generation of user-implemented layers.
Application-implemented interface for profiling.
Application-implemented progress reporting interface for TensorRT.
Application-implemented class for reading data in a stream-based manner.
Application-implemented class for reading data in a stream-based manner asynchronously....
Application-implemented class for writing data in a stream-based manner.
Class to handle library allocated memory that is accessible to the user.
Definition: NvInferRuntime.h:142
The TensorRT-RTX API version 1 namespace.
uint32_t TacticSources
Represents a collection of one or more TacticSource values combine using bitwise-OR operations.
Definition: NvInferRuntime.h:2958
v_1_0::IOutputAllocator IOutputAllocator
Definition: NvInferRuntime.h:4274
ResizeSelector
The coordinate selector when resize to single pixel output.
Definition: NvInfer.h:3992
EngineCapability
List of supported engine capability flows.
Definition: NvInferRuntime.h:76
DimensionOperation
An operation on two IDimensionExpr, which represent integer expressions used in dimension computation...
Definition: NvInferRuntime.h:179
MemoryPoolType
The type for memory pools used by TensorRT.
Definition: NvInfer.h:8977
ScaleMode
Controls how shift, scale and power are applied in a Scale layer.
Definition: NvInfer.h:1733
RuntimePlatform
Describes the intended runtime platform (operating system and CPU architecture) for the execution of ...
Definition: NvInfer.h:8554
TensorIOMode
Definition of tensor IO Mode.
Definition: NvInferRuntimeBase.h:658
HardwareCompatibilityLevel
Describes requirements of compatibility with GPU architectures other than that of the GPU on which th...
Definition: NvInfer.h:9096
CumulativeOperation
Enumerates the cumulative operations that may be performed by a Cumulative layer.
Definition: NvInfer.h:6504
SerializationFlag
List of valid flags that the engine can enable when serializing the bytes.
Definition: NvInferRuntime.h:2999
BoundingBoxFormat
Representation of bounding box data used for the Boxes input tensor in INMSLayer.
Definition: NvInfer.h:6058
ComputeCapability
Describes compute capability that an engine will be built for.
Definition: NvInfer.h:9145
v_1_0::IPluginV3 IPluginV3
Definition: NvInferPluginBase.h:273
UnaryOperation
Enumerates the unary operations that may be performed by a Unary layer.
Definition: NvInfer.h:2678
v_1_0::IStreamWriter IStreamWriter
Definition: NvInferRuntime.h:720
v_1_0::IProfiler IProfiler
Definition: NvInferRuntime.h:1318
DynamicShapesKernelSpecializationStrategy
Different kernel specialization strategies for dynamic shapes.
Definition: NvInferRuntime.h:3178
v_1_0::IStreamReaderV2 IStreamReaderV2
Definition: NvInferRuntime.h:797
ActivationType
Enumerates the types of activation to perform in an activation layer.
Definition: NvInfer.h:138
uint32_t TempfileControlFlags
Represents a collection of one or more TempfileControlFlag values combined using bitwise-OR operation...
Definition: NvInferRuntime.h:1396
FillOperation
Enumerates the tensor fill operations that may performed by a fill layer.
Definition: NvInfer.h:4973
EngineStat
The kind of engine statistics that queried from the ICudaEngine.
Definition: NvInferRuntime.h:3374
CudaGraphStrategy
Strategies available for CUDA graphs optimizations for JIT (Just-In-Time) inference.
Definition: NvInferRuntime.h:3217
ResizeRoundMode
The rounding mode for nearest neighbor resize.
Definition: NvInfer.h:4022
EngineValidity
Whether a TensorRT-RTX engine is likely to be valid on the current system.
Definition: NvInferRuntime.h:1863
PaddingMode
Enumerates the modes of padding to perform in convolution, deconvolution and pooling layer,...
Definition: NvInfer.h:911
TripLimit
Enum that describes kinds of trip limits.
Definition: NvInfer.h:4381
uint32_t NetworkDefinitionCreationFlags
Represents one or more NetworkDefinitionCreationFlag flags using binary OR operations....
Definition: NvInfer.h:10148
PreviewFeature
Define preview features.
Definition: NvInfer.h:9052
TilingOptimizationLevel
Define the optimization levels for Tiling.
Definition: NvInfer.h:9171
DataType
The type of weights and tensors. The datatypes other than kBOOL, kINT32, and kINT64 are "activation d...
Definition: NvInferRuntimeBase.h:145
uint32_t BuilderFlags
Represents one or more BuilderFlag values using binary OR operations, e.g., 1U << BuilderFlag::kFP16 ...
Definition: NvInfer.h:8586
DeviceType
The device that this layer/network will execute on.
Definition: NvInferRuntime.h:1350
LayerType
The type values of layer classes.
Definition: NvInfer.h:57
SampleMode
Controls how ISliceLayer and IGridSample handle out-of-bounds coordinates.
Definition: NvInfer.h:3136
GatherMode
Control form of IGatherLayer.
Definition: NvInfer.h:2425
v_1_0::IDebugListener IDebugListener
Definition: NvInferRuntime.h:4315
WeightsRole
How a layer uses particular Weights.
Definition: NvInferRuntime.h:1328
uint32_t TensorFormats
It is capable of representing one or more TensorFormat by binary OR operations, e....
Definition: NvInfer.h:130
ProfilingVerbosity
List of verbosity levels of layer information exposed in NVTX annotations and in IEngineInspector.
Definition: NvInferRuntime.h:2970
NetworkDefinitionCreationFlag
List of immutable network properties expressed at network creation time. NetworkDefinitionCreationFla...
Definition: NvInfer.h:10159
ElementWiseOperation
Enumerates the binary operations that may be performed by an ElementWise layer.
Definition: NvInfer.h:2335
uint32_t SerializationFlags
Represents one or more SerializationFlag values using binary OR operations, e.g., 1U << Serialization...
Definition: NvInferRuntime.h:2989
InterpolationMode
Enumerates various modes of interpolation.
Definition: NvInfer.h:3910
BuilderFlag
List of valid modes that the builder can enable when creating an engine from a network definition.
Definition: NvInfer.h:8596
TensorFormat
Format of the input/output tensors.
Definition: NvInferRuntime.h:1430
ExecutionContextAllocationStrategy
Different memory allocation behaviors for IExecutionContext.
Definition: NvInferRuntime.h:3104
TopKOperation
Enumerates the operations that may be performed by a TopK layer.
Definition: NvInfer.h:3417
ReduceOperation
Enumerates the reduce operations that may be performed by a Reduce layer.
Definition: NvInfer.h:2773
LayerInformationFormat
The format in which the IEngineInspector prints the layer information.
Definition: NvInferRuntime.h:5254
ScatterMode
Control form of IScatterLayer.
Definition: NvInfer.h:5792
MatrixOperation
Enumerates the operations that may be performed on a tensor by IMatrixMultiplyLayer before multiplica...
Definition: NvInfer.h:3570
ResizeCoordinateTransformation
The resize coordinate transformation function.
Definition: NvInfer.h:3938
LoopOutput
Enum that describes kinds of loop outputs.
Definition: NvInfer.h:4353
v_1_0::IStreamReader IStreamReader
Definition: NvInferRuntime.h:710
PoolingType
The type of pooling to perform in a pooling layer.
Definition: NvInfer.h:1347
v_1_0::IProgressMonitor IProgressMonitor
Definition: NvInfer.h:9287
TensorLocation
The location for tensor data storage, device or host.
Definition: NvInferRuntime.h:204
OptProfileSelector
When setting or querying optimization profile parameters (such as shape tensor inputs or dynamic dime...
Definition: NvInferRuntime.h:2632
AttentionNormalizationOp
Enumerates the operations that may be performed by the normalization in the attention subgraph.
Definition: NvInfer.h:6639