TensorRT for RTX 1.5.0
NvInferImpl.h
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: Copyright (c) 1993-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
3 * SPDX-License-Identifier: Apache-2.0
4 *
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
8 *
9 * http://www.apache.org/licenses/LICENSE-2.0
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16 */
17
18#ifndef NV_INFER_IMPL_H
19#define NV_INFER_IMPL_H
20
21#include "NvInferLegacyDims.h"
23
24// @cond SuppressDoxyWarnings
25
26namespace nvinfer1
27{
28
29namespace v_1_0
30{
31class ILogger;
33} // namespace v_1_0
36
37namespace v_1_0
38{
39class IProfiler;
40} // namespace v_1_0
42
43namespace v_1_0
44{
46} // namespace v_1_0
48
49namespace v_1_0
50{
51class IDebugListener;
52} // namespace v_1_0
54
55class IActivationLayer;
56class IAssertionLayer;
57class IAttention;
58class IBuilder;
59class IBuilderConfig;
60class IConcatenationLayer;
61class IConditionLayer;
62class IConstantLayer;
63class IConvolutionLayer;
64class ICudaEngine;
65class ICumulativeLayer;
66class IDeconvolutionLayer;
67class IDequantizeLayer;
68class IDimensionExpr;
69class IDynamicQuantizeLayer;
70class IEinsumLayer;
71class IElementWiseLayer;
72class IEngineInspector;
73class IExecutionContext;
74class IFillLayer;
75class IGatherLayer;
76class IGridSampleLayer;
77class IHostMemory;
78class IIdentityLayer;
79class ICastLayer;
80class IIfConditional;
81class IIfConditionalInputLayer;
82class IIfConditionalOutputLayer;
83class IIteratorLayer;
84class IKVCacheUpdateLayer;
85class ILayer;
86class ILoop;
87class ILoopOutputLayer;
88class ILRNLayer;
89class IMatrixMultiplyLayer;
90class IMoELayer;
91class IDistCollectiveLayer;
92class INetworkDefinition;
93class INormalizationLayer;
94class INMSLayer;
95class INonZeroLayer;
96class IOneHotLayer;
97class IOptimizationProfile;
98class IPaddingLayer;
99class IParametricReLULayer;
100class IPlugin;
101class IPluginExt;
102class IPluginFactory;
103class IPluginLayer;
104class IPluginRegistry;
105class IPluginV2Layer;
106class IRotaryEmbeddingLayer;
107class IRuntimeCache;
108class IRuntimeConfig;
109
110namespace v_1_0
111{
112class IPluginV3;
113} // namespace v_1_0
115
116namespace v_1_0
117{
118class IStreamReader;
119class IStreamWriter;
120} // namespace v_1_0
123namespace v_1_0
124{
125class IStreamReaderV2;
126} // namespace v_1_0
128
129class IPluginV3Layer;
130class IPoolingLayer;
131class IQuantizeLayer;
132class IRaggedSoftMaxLayer;
133class IRecurrenceLayer;
134class IReduceLayer;
135class IRefitter;
136class IResizeLayer;
137class IReverseSequenceLayer;
138class IRuntime;
139class IScaleLayer;
140class IScatterLayer;
141class ISelectLayer;
142class ISerializationConfig;
143class IShapeLayer;
144class IShuffleLayer;
145class ISliceLayer;
146class ISoftMaxLayer;
147class ISqueezeLayer;
148class ITensor;
149
150namespace v_1_0
151{
152struct TimingCacheKey;
153struct TimingCacheValue;
154} // namespace v_1_0
155using TimingCacheKey = v_1_0::TimingCacheKey;
156using TimingCacheValue = v_1_0::TimingCacheValue;
157
158class ITimingCache;
159class ITopKLayer;
160class ITripLimitLayer;
161class IUnaryLayer;
162class IUnsqueezeLayer;
163struct Permutation;
164class Weights;
165
166enum class ActivationType : int32_t;
167enum class AttentionIOForm : int32_t;
168enum class AttentionNormalizationOp : int32_t;
169enum class BoundingBoxFormat : int32_t;
170enum class CausalMaskKind : int32_t;
171enum class BuilderFlag : int32_t;
172enum class CumulativeOperation : int32_t;
173enum class DeviceType : int32_t;
174enum class DimensionOperation : int32_t;
175enum class ElementWiseOperation : int32_t;
176enum class EngineCapability : int32_t;
177enum class FillOperation : int32_t;
178enum class GatherMode : int32_t;
179enum class KVCacheMode : int32_t;
180enum class LayerInformationFormat : int32_t;
181enum class LayerType : int32_t;
182enum class LoopOutput : int32_t;
183enum class MatrixOperation : int32_t;
184enum class MemoryPoolType : int32_t;
185enum class MoEActType : int32_t;
186enum class NetworkDefinitionCreationFlag : int32_t;
187enum class OptProfileSelector : int32_t;
188enum class PaddingMode : int32_t;
189enum class PoolingType : int32_t;
190enum class ProfilingVerbosity : int32_t;
191enum class ReduceOperation : int32_t;
192enum class CollectiveOperation : int32_t;
193enum class ResizeCoordinateTransformation : int32_t;
194enum class InterpolationMode : int32_t;
195enum class ResizeRoundMode : int32_t;
196enum class ResizeSelector : int32_t;
197enum class ScaleMode : int32_t;
198enum class ScatterMode : int32_t;
199enum class SampleMode : int32_t;
200enum class SerializationFlag : int32_t;
201enum class TensorIOMode : int32_t;
202enum class TensorLocation : int32_t;
203enum class TopKOperation : int32_t;
204enum class TripLimit : int32_t;
205enum class UnaryOperation : int32_t;
206enum class WeightsRole : int32_t;
207enum class PreviewFeature : int32_t;
208enum class HardwareCompatibilityLevel : int32_t;
209enum class ExecutionContextAllocationStrategy : int32_t;
210enum class RuntimePlatform : int32_t;
211enum class TilingOptimizationLevel : int32_t;
212enum class ComputeCapability : int32_t;
213enum class EngineValidity : int32_t;
214enum class EngineStat : int32_t;
215
217enum class CudaGraphStrategy : int32_t;
218
219using TacticSources = uint32_t;
220using TensorFormats = uint32_t;
221using BuilderFlags = uint32_t;
222using NetworkDefinitionCreationFlags = uint32_t;
223using TempfileControlFlags = uint32_t;
224using SerializationFlags = uint32_t;
225
233
234namespace apiv
235{
236
237class VRoot
238{
239public:
240 virtual ~VRoot() noexcept = default;
241};
242
243class VHostMemory : public VRoot
244{
245public:
246 virtual void* data() const noexcept = 0;
247 virtual std::size_t size() const noexcept = 0;
248 virtual DataType type() const noexcept = 0;
249};
250
251class VDimensionExpr : public VRoot
252{
253public:
254 virtual bool isConstant() const = 0;
255 virtual int64_t getConstantValue() const = 0;
256 virtual bool isSizeTensor() const = 0;
257};
258
259class VExprBuilder : public VRoot
260{
261public:
262 virtual IDimensionExpr const* constant(int64_t value) = 0;
263 virtual IDimensionExpr const* operation(
264 DimensionOperation op, IDimensionExpr const& first, IDimensionExpr const& second)
265 = 0;
266 virtual IDimensionExpr const* declareSizeTensor(
267 int32_t outputIndex, IDimensionExpr const& opt, IDimensionExpr const& upper)
268 = 0;
269};
270
271class VRuntime : public VRoot
272{
273public:
274 virtual IRuntime* getPImpl() noexcept = 0;
275 virtual nvinfer1::ICudaEngine* deserializeCudaEngine(void const* blob, std::size_t size) noexcept = 0;
276 virtual void setDLACore(int32_t dlaCore) noexcept = 0;
277 virtual int32_t getDLACore() const noexcept = 0;
278 virtual int32_t getNbDLACores() const noexcept = 0;
279 virtual void setGpuAllocator(IGpuAllocator* allocator) noexcept = 0;
280 virtual void setErrorRecorder(IErrorRecorder* recorder) noexcept = 0;
281 virtual IErrorRecorder* getErrorRecorder() const noexcept = 0;
282 virtual ILogger* getLogger() const noexcept = 0;
283 virtual bool setMaxThreads(int32_t maxThreads) noexcept = 0;
284 virtual int32_t getMaxThreads() const noexcept = 0;
285 virtual void setTemporaryDirectory(char const*) noexcept = 0;
286 virtual char const* getTemporaryDirectory() const noexcept = 0;
287 virtual void setTempfileControlFlags(TempfileControlFlags) noexcept = 0;
288 virtual TempfileControlFlags getTempfileControlFlags() const noexcept = 0;
289 virtual IPluginRegistry& getPluginRegistry() noexcept = 0;
290 virtual void setPluginRegistryParent(IPluginRegistry* parent) noexcept = 0;
291 virtual IRuntime* loadRuntime(char const* path) noexcept = 0;
292 virtual void setEngineHostCodeAllowed(bool allowed) noexcept = 0;
293 virtual bool getEngineHostCodeAllowed() const noexcept = 0;
294 // Added in TensorRT version 10.7
295 virtual nvinfer1::ICudaEngine* deserializeCudaEngineV2(IStreamReaderV2& streamReader) noexcept = 0;
296 virtual int64_t getEngineHeaderSize() const noexcept = 0;
297 virtual EngineValidity getEngineValidity(void const* blob, int64_t blobSize, uint64_t* diagnostics) const noexcept = 0;
298};
299
300class VRefitter : public VRoot
301{
302public:
303 virtual IRefitter* getPImpl() noexcept = 0;
304 virtual bool setWeights(char const* layerName, WeightsRole role, const Weights weights) noexcept = 0;
305 virtual bool refitCudaEngine() noexcept = 0;
306 virtual int32_t getMissing(int32_t size, char const** layerNames, WeightsRole* roles) noexcept = 0;
307 virtual int32_t getAll(int32_t size, char const** layerNames, WeightsRole* roles) noexcept = 0;
308 virtual void setErrorRecorder(IErrorRecorder* recorder) noexcept = 0;
309 virtual IErrorRecorder* getErrorRecorder() const noexcept = 0;
310 virtual bool setNamedWeights(char const* name, Weights weights) noexcept = 0;
311 virtual int32_t getMissingWeights(int32_t size, char const** weightsNames) noexcept = 0;
312 virtual int32_t getAllWeights(int32_t size, char const** weightsNames) noexcept = 0;
313 virtual ILogger* getLogger() const noexcept = 0;
314 virtual bool setMaxThreads(int32_t maxThreads) noexcept = 0;
315 virtual int32_t getMaxThreads() const noexcept = 0;
316 virtual bool setNamedWeightsWithLocation(char const* name, Weights weights, TensorLocation location) noexcept = 0;
317 virtual Weights getNamedWeights(char const* weightsName) const noexcept = 0;
318 virtual TensorLocation getWeightsLocation(char const* weightsName) const noexcept = 0;
319 virtual bool unsetNamedWeights(char const* weightsName) noexcept = 0;
320 virtual void setWeightsValidation(bool weightsValidation) noexcept = 0;
321 virtual bool getWeightsValidation() const noexcept = 0;
322 virtual bool refitCudaEngineAsync(cudaStream_t stream) noexcept = 0;
323 virtual Weights getWeightsPrototype(char const* weightsName) const noexcept = 0;
324};
325
326class VOptimizationProfile : public VRoot
327{
328public:
329 virtual bool setDimensions(char const* inputName, OptProfileSelector select, Dims const& dims) noexcept = 0;
330 virtual Dims getDimensions(char const* inputName, OptProfileSelector select) const noexcept = 0;
331 virtual int32_t getNbShapeValues(char const* inputName) const noexcept = 0;
332 virtual bool setExtraMemoryTarget(float target) noexcept = 0;
333 virtual float getExtraMemoryTarget() const noexcept = 0;
334 virtual bool isValid() const noexcept = 0;
335 // Added in TensorRT 10.11
336 TRT_NODISCARD virtual bool setShapeValuesV2(
337 char const* inputName, OptProfileSelector select, int64_t const* values, int32_t nbValues) noexcept = 0;
338 TRT_NODISCARD virtual int64_t const* getShapeValuesV2(
339 char const* inputName, OptProfileSelector select) const noexcept = 0;
340};
341
342class VCudaEngine : public VRoot
343{
344public:
345 virtual ICudaEngine* getPImpl() noexcept = 0;
346 virtual int32_t getNbLayers() const noexcept = 0;
347 virtual IHostMemory* serialize() const noexcept = 0;
348 virtual IExecutionContext* createExecutionContext(ExecutionContextAllocationStrategy strategy) noexcept = 0;
349 virtual bool isRefittable() const noexcept = 0;
350 virtual char const* getName() const noexcept = 0;
351 virtual int32_t getNbOptimizationProfiles() const noexcept = 0;
352 virtual EngineCapability getEngineCapability() const noexcept = 0;
353 virtual void setErrorRecorder(IErrorRecorder* recorder) noexcept = 0;
354 virtual IErrorRecorder* getErrorRecorder() const noexcept = 0;
355 virtual TacticSources getTacticSources() const noexcept = 0;
356 virtual ProfilingVerbosity getProfilingVerbosity() const noexcept = 0;
357 virtual IEngineInspector* createEngineInspector() const noexcept = 0;
358 virtual Dims getTensorShape(char const* tensorName) const noexcept = 0;
359 virtual DataType getTensorDataType(char const* tensorName) const noexcept = 0;
360 virtual TensorLocation getTensorLocation(char const* tensorName) const noexcept = 0;
361 virtual bool isShapeInferenceIO(char const* tensorName) const noexcept = 0;
362 virtual TensorIOMode getTensorIOMode(char const* tensorName) const noexcept = 0;
363 virtual int32_t getTensorBytesPerComponent(char const* tensorName) const noexcept = 0;
364 virtual int32_t getTensorComponentsPerElement(char const* tensorName) const noexcept = 0;
365 virtual TensorFormat getTensorFormat(char const* tensorName) const noexcept = 0;
366 virtual char const* getTensorFormatDesc(char const* tensorName) const noexcept = 0;
367 virtual int32_t getTensorVectorizedDim(char const* tensorName) const noexcept = 0;
368 virtual Dims getProfileShape(
369 char const* tensorName, int32_t profileIndex, OptProfileSelector select) const noexcept = 0;
370 virtual int32_t getNbIOTensors() const noexcept = 0;
371 virtual char const* getIOTensorName(int32_t index) const noexcept = 0;
372 virtual HardwareCompatibilityLevel getHardwareCompatibilityLevel() const noexcept = 0;
373 virtual int32_t getNbAuxStreams() const noexcept = 0;
374
375 virtual int32_t getTensorBytesPerComponentV2(char const* tensorName, int32_t profileIndex) const noexcept = 0;
376 virtual int32_t getTensorComponentsPerElementV2(char const* tensorName, int32_t profileIndex) const noexcept = 0;
377 virtual TensorFormat getTensorFormatV2(char const* tensorName, int32_t profileIndex) const noexcept = 0;
378 virtual char const* getTensorFormatDescV2(char const* tensorName, int32_t profileIndex) const noexcept = 0;
379 virtual int32_t getTensorVectorizedDimV2(char const* tensorName, int32_t profileIndex) const noexcept = 0;
380
381 virtual ISerializationConfig* createSerializationConfig() noexcept = 0;
382 virtual IHostMemory* serializeWithConfig(ISerializationConfig& config) const noexcept = 0;
383
384 virtual IRefitter* createRefitter(ILogger& logger) noexcept = 0;
385
386 virtual int64_t getStreamableWeightsSize() const noexcept = 0;
387
388 virtual bool isDebugTensor(char const* name) const noexcept = 0;
389
390 // Added in TensorRT 10.1
391 virtual bool setWeightStreamingBudgetV2(int64_t gpuMemoryBudget) noexcept = 0;
392 virtual int64_t getWeightStreamingBudgetV2() const noexcept = 0;
393 virtual int64_t getWeightStreamingAutomaticBudget() const noexcept = 0;
394 virtual int64_t getWeightStreamingScratchMemorySize() const noexcept = 0;
395 virtual int64_t getDeviceMemorySizeV2() const noexcept = 0;
396 virtual int64_t getDeviceMemorySizeForProfileV2(int32_t profileIndex) const noexcept = 0;
397 // Added in TensorRT 10.11
398 TRT_NODISCARD virtual int64_t const* getProfileTensorValuesV2(
399 char const* tensorName, int32_t profileIndex, OptProfileSelector select) const noexcept = 0;
400 TRT_NODISCARD virtual IExecutionContext* createExecutionContextWithRuntimeConfig(
401 IRuntimeConfig* runtimeConfig) noexcept = 0;
402 TRT_NODISCARD virtual IRuntimeConfig* createRuntimeConfig() noexcept = 0;
403 TRT_NODISCARD virtual int64_t getEngineStat(EngineStat stat) const noexcept = 0;
404 // Added in TensorRT 10.15
405 TRT_NODISCARD virtual char const* getAliasedInputTensor(char const* tensorName) const noexcept = 0;
406};
407
408class VExecutionContext : public VRoot
409{
410public:
411 virtual IExecutionContext* getPImpl() noexcept = 0;
412 virtual void setDebugSync(bool sync) noexcept = 0;
413 virtual bool getDebugSync() const noexcept = 0;
414 virtual void setProfiler(IProfiler*) noexcept = 0;
415 virtual IProfiler* getProfiler() const noexcept = 0;
416 virtual ICudaEngine const& getEngine() const noexcept = 0;
417 virtual void setName(char const* name) noexcept = 0;
418 virtual char const* getName() const noexcept = 0;
419 virtual void setDeviceMemory(void* memory) noexcept = 0;
420 virtual int32_t getOptimizationProfile() const noexcept = 0;
421 virtual bool allInputDimensionsSpecified() const noexcept = 0;
422 virtual void setErrorRecorder(IErrorRecorder* recorder) noexcept = 0;
423 virtual IErrorRecorder* getErrorRecorder() const noexcept = 0;
424 virtual bool executeV2(void* const* bindings) noexcept = 0;
425 virtual bool setOptimizationProfileAsync(int32_t profileIndex, cudaStream_t stream) noexcept = 0;
426 virtual void setEnqueueEmitsProfile(bool enqueueEmitsProfile) noexcept = 0;
427 virtual bool getEnqueueEmitsProfile() const noexcept = 0;
428 virtual bool reportToProfiler() const noexcept = 0;
429 virtual bool setInputShape(char const* tensorName, Dims const& dims) noexcept = 0;
430 virtual Dims getTensorShape(char const* tensorName) const noexcept = 0;
431 virtual Dims getTensorStrides(char const* tensorName) const noexcept = 0;
432 virtual bool setTensorAddress(char const* tensorName, void* data) noexcept = 0;
433 virtual void const* getTensorAddress(char const* tensorName) const noexcept = 0;
434 virtual bool setInputTensorAddress(char const* tensorName, void const* data) noexcept = 0;
435 virtual bool setOutputTensorAddress(char const* tensorName, void* data) noexcept = 0;
436 virtual int32_t inferShapes(int32_t nbMaxNames, char const** tensorNames) noexcept = 0;
437 virtual bool setInputConsumedEvent(cudaEvent_t event) noexcept = 0;
438 virtual cudaEvent_t getInputConsumedEvent() const noexcept = 0;
439 virtual void* getOutputTensorAddress(char const* tensorName) const noexcept = 0;
440 virtual bool setOutputAllocator(char const* tensorName, IOutputAllocator* outputAllocator) noexcept = 0;
441 virtual IOutputAllocator* getOutputAllocator(char const* name) noexcept = 0;
442 virtual int64_t getMaxOutputSize(char const* tensorName) const noexcept = 0;
443 virtual bool setTemporaryStorageAllocator(IGpuAllocator* allocator) noexcept = 0;
444 virtual IGpuAllocator* getTemporaryStorageAllocator() const noexcept = 0;
445 virtual bool enqueueV3(cudaStream_t stream) noexcept = 0;
446 virtual void setPersistentCacheLimit(size_t size) noexcept = 0;
447 virtual size_t getPersistentCacheLimit() const noexcept = 0;
448 virtual bool setNvtxVerbosity(ProfilingVerbosity verbosity) noexcept = 0;
449 virtual ProfilingVerbosity getNvtxVerbosity() const noexcept = 0;
450 virtual void setAuxStreams(cudaStream_t* auxStreams, int32_t nbStreams) noexcept = 0;
451 virtual bool setDebugListener(IDebugListener* listener) noexcept = 0;
452 virtual IDebugListener* getDebugListener() noexcept = 0;
453 virtual bool setTensorDebugState(char const* name, bool flag) noexcept = 0;
454 virtual bool getDebugState(char const* name) const noexcept = 0;
455 virtual bool setAllTensorsDebugState(bool flag) noexcept = 0;
456 virtual size_t updateDeviceMemorySizeForShapes() noexcept = 0;
457 virtual void setDeviceMemoryV2(void* memory, int64_t size) noexcept = 0;
458 TRT_NODISCARD virtual IRuntimeConfig* getRuntimeConfig() const noexcept = 0;
459 virtual bool setUnfusedTensorsDebugState(bool flag) noexcept = 0;
460 virtual bool getUnfusedTensorsDebugState() const noexcept = 0;
461 virtual bool isStreamCapturable(cudaStream_t stream) const noexcept = 0;
462 virtual bool setCommunicator(void* communicator) noexcept = 0;
463};
464
465class VEngineInspector : public VRoot
466{
467public:
468 virtual IEngineInspector* getPImpl() noexcept = 0;
469 virtual bool setExecutionContext(IExecutionContext const* context) noexcept = 0;
470 virtual IExecutionContext const* getExecutionContext() const noexcept = 0;
471 virtual char const* getLayerInformation(int32_t layerIndex, LayerInformationFormat format) const noexcept = 0;
472 virtual char const* getEngineInformation(LayerInformationFormat format) const noexcept = 0;
473 virtual void setErrorRecorder(IErrorRecorder* recorder) noexcept = 0;
474 virtual IErrorRecorder* getErrorRecorder() const noexcept = 0;
475};
476
477class VTensor : public VRoot
478{
479public:
480 virtual void setName(char const* name) noexcept = 0;
481 virtual char const* getName() const noexcept = 0;
482 virtual void setDimensions(Dims const& dimensions) noexcept = 0;
483 virtual Dims getDimensions() const noexcept = 0;
484 virtual DataType getType() const noexcept = 0;
485 virtual bool isNetworkInput() const noexcept = 0;
486 virtual bool isNetworkOutput() const noexcept = 0;
487 virtual void setAllowedFormats(TensorFormats formats) noexcept = 0;
488 virtual TensorFormats getAllowedFormats() const noexcept = 0;
489 virtual bool isShapeTensor() const noexcept = 0;
490 virtual bool isExecutionTensor() const noexcept = 0;
491 virtual void setDimensionName(int32_t index, char const* name) noexcept = 0;
492 virtual char const* getDimensionName(int32_t index) const noexcept = 0;
493};
494
495class VLayer : public VRoot
496{
497public:
498 virtual LayerType getType() const noexcept = 0;
499 virtual void setName(char const* name) noexcept = 0;
500 virtual char const* getName() const noexcept = 0;
501 virtual int32_t getNbInputs() const noexcept = 0;
502 virtual ITensor* getInput(int32_t index) const noexcept = 0;
503 virtual int32_t getNbOutputs() const noexcept = 0;
504 virtual ITensor* getOutput(int32_t index) const noexcept = 0;
505 virtual void setInput(int32_t index, ITensor& tensor) noexcept = 0;
506 virtual DataType getOutputType(int32_t index) const noexcept = 0;
507 virtual void setMetadata(char const* docString) noexcept = 0;
508 virtual char const* getMetadata() const noexcept = 0;
509 virtual bool setNbRanks(int32_t nbRanks) noexcept = 0;
510 virtual int32_t getNbRanks() const noexcept = 0;
511};
512
513class VConvolutionLayer : public VRoot
514{
515public:
516 virtual void setNbOutputMaps(int64_t nbOutputMaps) noexcept = 0;
517 virtual int64_t getNbOutputMaps() const noexcept = 0;
518 virtual void setNbGroups(int64_t nbGroups) noexcept = 0;
519 virtual int64_t getNbGroups() const noexcept = 0;
520 virtual void setKernelWeights(Weights weights) noexcept = 0;
521 virtual Weights getKernelWeights() const noexcept = 0;
522 virtual void setBiasWeights(Weights weights) noexcept = 0;
523 virtual Weights getBiasWeights() const noexcept = 0;
524 virtual void setPrePadding(Dims const& padding) noexcept = 0;
525 virtual Dims getPrePadding() const noexcept = 0;
526 virtual void setPostPadding(Dims const& padding) noexcept = 0;
527 virtual Dims getPostPadding() const noexcept = 0;
528 virtual void setPaddingMode(PaddingMode paddingMode) noexcept = 0;
529 virtual PaddingMode getPaddingMode() const noexcept = 0;
530 virtual void setKernelSizeNd(Dims const& kernelSize) noexcept = 0;
531 virtual Dims getKernelSizeNd() const noexcept = 0;
532 virtual void setStrideNd(Dims const& stride) noexcept = 0;
533 virtual Dims getStrideNd() const noexcept = 0;
534 virtual void setPaddingNd(Dims const& padding) noexcept = 0;
535 virtual Dims getPaddingNd() const noexcept = 0;
536 virtual void setDilationNd(Dims const& dilation) noexcept = 0;
537 virtual Dims getDilationNd() const noexcept = 0;
538};
539
540class VActivationLayer : public VRoot
541{
542public:
543 virtual void setActivationType(ActivationType type) noexcept = 0;
544 virtual ActivationType getActivationType() const noexcept = 0;
545 virtual void setAlpha(float alpha) noexcept = 0;
546 virtual void setBeta(float beta) noexcept = 0;
547 virtual float getAlpha() const noexcept = 0;
548 virtual float getBeta() const noexcept = 0;
549};
550
551class VPoolingLayer : public VRoot
552{
553public:
554 virtual void setPoolingType(PoolingType type) noexcept = 0;
555 virtual PoolingType getPoolingType() const noexcept = 0;
556 virtual void setBlendFactor(float blendFactor) noexcept = 0;
557 virtual float getBlendFactor() const noexcept = 0;
558 virtual void setAverageCountExcludesPadding(bool exclusive) noexcept = 0;
559 virtual bool getAverageCountExcludesPadding() const noexcept = 0;
560 virtual void setPrePadding(Dims const& padding) noexcept = 0;
561 virtual Dims getPrePadding() const noexcept = 0;
562 virtual void setPostPadding(Dims const& padding) noexcept = 0;
563 virtual Dims getPostPadding() const noexcept = 0;
564 virtual void setPaddingMode(PaddingMode paddingMode) noexcept = 0;
565 virtual PaddingMode getPaddingMode() const noexcept = 0;
566 virtual void setWindowSizeNd(Dims const& windowSize) noexcept = 0;
567 virtual Dims getWindowSizeNd() const noexcept = 0;
568 virtual void setStrideNd(Dims const& stride) noexcept = 0;
569 virtual Dims getStrideNd() const noexcept = 0;
570 virtual void setPaddingNd(Dims const& padding) noexcept = 0;
571 virtual Dims getPaddingNd() const noexcept = 0;
572};
573
574class VLRNLayer : public VRoot
575{
576public:
577 virtual void setWindowSize(int64_t windowSize) noexcept = 0;
578 virtual int64_t getWindowSize() const noexcept = 0;
579 virtual void setAlpha(float alpha) noexcept = 0;
580 virtual float getAlpha() const noexcept = 0;
581 virtual void setBeta(float beta) noexcept = 0;
582 virtual float getBeta() const noexcept = 0;
583 virtual void setK(float k) noexcept = 0;
584 virtual float getK() const noexcept = 0;
585};
586
587class VScaleLayer : public VRoot
588{
589public:
590 virtual void setMode(ScaleMode mode) noexcept = 0;
591 virtual ScaleMode getMode() const noexcept = 0;
592 virtual void setShift(Weights shift) noexcept = 0;
593 virtual Weights getShift() const noexcept = 0;
594 virtual void setScale(Weights scale) noexcept = 0;
595 virtual Weights getScale() const noexcept = 0;
596 virtual void setPower(Weights power) noexcept = 0;
597 virtual Weights getPower() const noexcept = 0;
598 virtual int32_t getChannelAxis() const noexcept = 0;
599 virtual void setChannelAxis(int32_t channelAxis) noexcept = 0;
600};
601
602class VSoftMaxLayer : public VRoot
603{
604public:
605 virtual void setAxes(uint32_t axes) noexcept = 0;
606 virtual uint32_t getAxes() const noexcept = 0;
607};
608
609class VConcatenationLayer : public VRoot
610{
611public:
612 virtual void setAxis(int32_t axis) noexcept = 0;
613 virtual int32_t getAxis() const noexcept = 0;
614};
615
616class VDeconvolutionLayer : public VRoot
617{
618public:
619 virtual void setNbOutputMaps(int64_t nbOutputMaps) noexcept = 0;
620 virtual int64_t getNbOutputMaps() const noexcept = 0;
621 virtual void setNbGroups(int64_t nbGroups) noexcept = 0;
622 virtual int64_t getNbGroups() const noexcept = 0;
623 virtual void setKernelWeights(Weights weights) noexcept = 0;
624 virtual Weights getKernelWeights() const noexcept = 0;
625 virtual void setBiasWeights(Weights weights) noexcept = 0;
626 virtual Weights getBiasWeights() const noexcept = 0;
627 virtual void setPrePadding(Dims const& padding) noexcept = 0;
628 virtual Dims getPrePadding() const noexcept = 0;
629 virtual void setPostPadding(Dims const& padding) noexcept = 0;
630 virtual Dims getPostPadding() const noexcept = 0;
631 virtual void setPaddingMode(PaddingMode paddingMode) noexcept = 0;
632 virtual PaddingMode getPaddingMode() const noexcept = 0;
633 virtual void setKernelSizeNd(Dims const& kernelSize) noexcept = 0;
634 virtual Dims getKernelSizeNd() const noexcept = 0;
635 virtual void setStrideNd(Dims const& stride) noexcept = 0;
636 virtual Dims getStrideNd() const noexcept = 0;
637 virtual void setPaddingNd(Dims const& padding) noexcept = 0;
638 virtual Dims getPaddingNd() const noexcept = 0;
639 virtual void setDilationNd(Dims const& dilation) noexcept = 0;
640 virtual Dims getDilationNd() const noexcept = 0;
641};
642
643class VElementWiseLayer : public VRoot
644{
645public:
646 virtual void setOperation(ElementWiseOperation op) noexcept = 0;
647 virtual ElementWiseOperation getOperation() const noexcept = 0;
648};
649
650class VGatherLayer : public VRoot
651{
652public:
653 virtual void setGatherAxis(int32_t axis) noexcept = 0;
654 virtual int32_t getGatherAxis() const noexcept = 0;
655 virtual void setNbElementWiseDims(int32_t k) noexcept = 0;
656 virtual int32_t getNbElementWiseDims() const noexcept = 0;
657 virtual void setMode(GatherMode mode) noexcept = 0;
658 virtual GatherMode getMode() const noexcept = 0;
659};
660
661class VPluginLayer : public VRoot
662{
663public:
664 virtual IPlugin& getPlugin() noexcept = 0;
665};
666
667class VPluginV2Layer : public VRoot
668{
669public:
670 virtual IPluginV2& getPlugin() noexcept = 0;
671};
672
673class VPluginV3Layer : public VRoot
674{
675public:
676 virtual IPluginV3& getPlugin() noexcept = 0;
677};
678
679class VUnaryLayer : public VRoot
680{
681public:
682 virtual void setOperation(UnaryOperation op) noexcept = 0;
683 virtual UnaryOperation getOperation() const noexcept = 0;
684};
685
686class VReduceLayer : public VRoot
687{
688public:
689 virtual void setOperation(ReduceOperation op) noexcept = 0;
690 virtual ReduceOperation getOperation() const noexcept = 0;
691 virtual void setReduceAxes(uint32_t reduceAxes) noexcept = 0;
692 virtual uint32_t getReduceAxes() const noexcept = 0;
693 virtual void setKeepDimensions(bool keepDimensions) noexcept = 0;
694 virtual bool getKeepDimensions() const noexcept = 0;
695};
696
697class VPaddingLayer : public VRoot
698{
699public:
700 virtual void setPrePaddingNd(Dims const& padding) noexcept = 0;
701 virtual Dims getPrePaddingNd() const noexcept = 0;
702 virtual void setPostPaddingNd(Dims const& padding) noexcept = 0;
703 virtual Dims getPostPaddingNd() const noexcept = 0;
704};
705
706class VShuffleLayer : public VRoot
707{
708public:
709 virtual void setFirstTranspose(Permutation const& permutation) noexcept = 0;
710 virtual Permutation const& getFirstTranspose() const noexcept = 0;
711 virtual void setReshapeDimensions(Dims const& dimensions) noexcept = 0;
712 virtual Dims getReshapeDimensions() const noexcept = 0;
713 virtual void setSecondTranspose(Permutation const& permutation) noexcept = 0;
714 virtual Permutation const& getSecondTranspose() const noexcept = 0;
715 virtual void setZeroIsPlaceholder(bool zeroIsPlaceholder) noexcept = 0;
716 virtual bool getZeroIsPlaceholder() const noexcept = 0;
717};
718
719class VSliceLayer : public VRoot
720{
721public:
722 virtual void setStart(Dims const& start) noexcept = 0;
723 virtual Dims getStart() const noexcept = 0;
724 virtual void setSize(Dims const& size) noexcept = 0;
725 virtual Dims getSize() const noexcept = 0;
726 virtual void setStride(Dims const& stride) noexcept = 0;
727 virtual Dims getStride() const noexcept = 0;
728 virtual void setMode(SampleMode mode) noexcept = 0;
729 virtual SampleMode getMode() const noexcept = 0;
730 virtual void setAxes(Dims const& axes) noexcept = 0;
731 virtual Dims getAxes() const noexcept = 0;
732};
733
734class VShapeLayer : public VRoot
735{
736public:
737};
738
739class VTopKLayer : public VRoot
740{
741public:
742 virtual void setOperation(TopKOperation op) noexcept = 0;
743 virtual TopKOperation getOperation() const noexcept = 0;
744 virtual void setK(int32_t k) noexcept = 0;
745 virtual int32_t getK() const noexcept = 0;
746 virtual void setReduceAxes(uint32_t reduceAxes) noexcept = 0;
747 virtual uint32_t getReduceAxes() const noexcept = 0;
748 virtual bool setIndicesType(DataType type) noexcept = 0;
749 virtual DataType getIndicesType() const noexcept = 0;
750};
751
752class VMatrixMultiplyLayer : public VRoot
753{
754public:
755 virtual void setOperation(int32_t index, MatrixOperation op) noexcept = 0;
756 virtual MatrixOperation getOperation(int32_t index) const noexcept = 0;
757};
758
759class VNonZeroLayer : public VRoot
760{
761public:
762 virtual bool setIndicesType(DataType type) noexcept = 0;
763 virtual DataType getIndicesType() const noexcept = 0;
764};
765
766class VRaggedSoftMaxLayer : public VRoot
767{
768public:
769};
770
771class VIdentityLayer : public VRoot
772{
773public:
774};
775
776class VCastLayer : public VRoot
777{
778public:
779 virtual void setToType(DataType toType) noexcept = 0;
780 virtual DataType getToType() const noexcept = 0;
781};
782
783class VConstantLayer : public VRoot
784{
785public:
786 virtual void setWeights(Weights weights) noexcept = 0;
787 virtual Weights getWeights() const noexcept = 0;
788 virtual void setDimensions(Dims const& dimensions) noexcept = 0;
789 virtual Dims getDimensions() const noexcept = 0;
790};
791
792class VParametricReLULayer : public VRoot
793{
794public:
795};
796
797class VResizeLayer : public VRoot
798{
799public:
800 virtual void setOutputDimensions(Dims const& dimensions) noexcept = 0;
801 virtual Dims getOutputDimensions() const noexcept = 0;
802 virtual void setScales(float const* scales, int32_t nbScales) noexcept = 0;
803 virtual int32_t getScales(int32_t size, float* scales) const noexcept = 0;
804 virtual void setResizeMode(InterpolationMode interpolationMode) noexcept = 0;
805 virtual InterpolationMode getResizeMode() const noexcept = 0;
806 virtual void setCoordinateTransformation(ResizeCoordinateTransformation coordTransform) noexcept = 0;
807 virtual ResizeCoordinateTransformation getCoordinateTransformation() const noexcept = 0;
808 virtual void setSelectorForSinglePixel(ResizeSelector selector) noexcept = 0;
809 virtual ResizeSelector getSelectorForSinglePixel() const noexcept = 0;
810 virtual void setNearestRounding(ResizeRoundMode value) noexcept = 0;
811 virtual ResizeRoundMode getNearestRounding() const noexcept = 0;
812 virtual void setCubicCoeff(float value) noexcept = 0;
813 virtual float getCubicCoeff() const noexcept = 0;
814 virtual void setExcludeOutside(bool value) noexcept = 0;
815 virtual bool getExcludeOutside() const noexcept = 0;
816};
817
818class VLoopBoundaryLayer : public VRoot
819{
820public:
821 virtual ILoop* getLoop() const noexcept = 0;
822};
823
824class VRecurrenceLayer : public VRoot
825{
826public:
827};
828
829class VLoopOutputLayer : public VRoot
830{
831public:
832 virtual LoopOutput getLoopOutput() const noexcept = 0;
833 virtual void setAxis(int32_t axis) noexcept = 0;
834 virtual int32_t getAxis() const noexcept = 0;
835};
836
837class VTripLimitLayer : public VRoot
838{
839public:
840 virtual TripLimit getTripLimit() const noexcept = 0;
841};
842
843class VIteratorLayer : public VRoot
844{
845public:
846 virtual void setAxis(int32_t axis) noexcept = 0;
847 virtual int32_t getAxis() const noexcept = 0;
848 virtual void setReverse(bool reverse) noexcept = 0;
849 virtual bool getReverse() const noexcept = 0;
850};
851class VLoop : public VRoot
852{
853public:
854 virtual IRecurrenceLayer* addRecurrence(ITensor& initialValue) noexcept = 0;
855 virtual ITripLimitLayer* addTripLimit(ITensor& tensor, TripLimit limit) noexcept = 0;
856 virtual IIteratorLayer* addIterator(ITensor& tensor, int32_t axis = 0, bool reverse = false) noexcept = 0;
857 virtual ILoopOutputLayer* addLoopOutput(ITensor& tensor, LoopOutput outputKind, int32_t axis = 0) noexcept = 0;
858 virtual void setName(char const* name) noexcept = 0;
859 virtual char const* getName() const noexcept = 0;
860};
861
862class VConditionalBoundaryLayer : public VRoot
863{
864public:
865 virtual IIfConditional* getConditional() const noexcept = 0;
866};
867
868class VConditionLayer : public VRoot
869{
870public:
871};
872
873class VConditionalInputLayer : public VRoot
874{
875public:
876};
877
878class VConditionalOutputLayer : public VRoot
879{
880public:
881};
882
883class VIfConditional : public VRoot
884{
885public:
886 virtual IConditionLayer* setCondition(ITensor& tensor) noexcept = 0;
887 virtual IIfConditionalInputLayer* addInput(ITensor& tensor) noexcept = 0;
888 virtual IIfConditionalOutputLayer* addOutput(ITensor& trueTensor, ITensor& falseTensor) noexcept = 0;
889 virtual void setName(char const* name) noexcept = 0;
890 virtual char const* getName() const noexcept = 0;
891};
892
893class VAttentionBoundaryLayer : public VRoot
894{
895public:
896 virtual IAttention* getAttention() const noexcept = 0;
897};
898
899class VAttentionInputLayer : public VRoot
900{
901public:
902};
903
904class VAttentionOutputLayer : public VRoot
905{
906public:
907};
908
909class VAttention : public VRoot
910{
911public:
912 TRT_NODISCARD virtual bool setInput(int32_t index, ITensor& input) noexcept = 0;
913 TRT_NODISCARD virtual int32_t getNbInputs() const noexcept = 0;
914 TRT_NODISCARD virtual ITensor* getInput(int32_t index) const noexcept = 0;
915 TRT_NODISCARD virtual int32_t getNbOutputs() const noexcept = 0;
916 TRT_NODISCARD virtual ITensor* getOutput(int32_t index) const noexcept = 0;
917 TRT_NODISCARD virtual bool setName(char const* name) noexcept = 0;
918 TRT_NODISCARD virtual char const* getName() const noexcept = 0;
919 TRT_NODISCARD virtual bool setNormalizationOperation(AttentionNormalizationOp op) noexcept = 0;
920 TRT_NODISCARD virtual AttentionNormalizationOp getNormalizationOperation() const noexcept = 0;
921 TRT_DEPRECATED virtual bool setCausal(bool isCausal) noexcept = 0;
922 TRT_DEPRECATED virtual bool getCausal() const noexcept = 0;
923 TRT_NODISCARD virtual bool setMask(ITensor& mask) noexcept = 0;
924 TRT_NODISCARD virtual ITensor* getMask() const noexcept = 0;
925 TRT_NODISCARD virtual bool setDecomposable(bool decomposable) noexcept = 0;
926 TRT_NODISCARD virtual bool getDecomposable() const noexcept = 0;
927 TRT_NODISCARD virtual bool setNormalizationQuantizeScale(ITensor& tensor) noexcept = 0;
928 TRT_NODISCARD virtual ITensor* getNormalizationQuantizeScale() const noexcept = 0;
929 TRT_NODISCARD virtual bool setNormalizationQuantizeToType(DataType type) noexcept = 0;
930 TRT_NODISCARD virtual DataType getNormalizationQuantizeToType() const noexcept = 0;
931 TRT_NODISCARD virtual bool setMetadata(char const* docString) noexcept = 0;
932 TRT_NODISCARD virtual char const* getMetadata() const noexcept = 0;
933 TRT_NODISCARD virtual bool setNbRanks(int32_t nbRanks) noexcept = 0;
934 TRT_NODISCARD virtual int32_t getNbRanks() const noexcept = 0;
935 TRT_NODISCARD virtual bool setCausalKind(CausalMaskKind kind) noexcept = 0;
936 TRT_NODISCARD virtual CausalMaskKind getCausalKind() const noexcept = 0;
937 TRT_NODISCARD virtual bool setQueryForm(AttentionIOForm form) noexcept = 0;
938 TRT_NODISCARD virtual AttentionIOForm getQueryForm() const noexcept = 0;
939 TRT_NODISCARD virtual bool setKeyValueForm(AttentionIOForm form) noexcept = 0;
940 TRT_NODISCARD virtual AttentionIOForm getKeyValueForm() const noexcept = 0;
941 TRT_NODISCARD virtual bool setQueryLengths(ITensor* lengths) noexcept = 0;
942 TRT_NODISCARD virtual ITensor* getQueryLengths() const noexcept = 0;
943 TRT_NODISCARD virtual bool setKeyValueLengths(ITensor* lengths) noexcept = 0;
944 TRT_NODISCARD virtual ITensor* getKeyValueLengths() const noexcept = 0;
945}; // class VAttention
946
947class VSelectLayer : public VRoot
948{
949};
950
951class VAssertionLayer : public VRoot
952{
953public:
954 virtual void setMessage(char const* message) noexcept = 0;
955 virtual char const* getMessage() const noexcept = 0;
956};
957
958class VFillLayer : public VRoot
959{
960public:
961 virtual void setDimensions(Dims const& dimensions) noexcept = 0;
962 virtual Dims getDimensions() const noexcept = 0;
963 virtual void setOperation(FillOperation op) noexcept = 0;
964 virtual FillOperation getOperation() const noexcept = 0;
965 virtual void setAlpha(double alpha) noexcept = 0;
966 virtual double getAlpha() const noexcept = 0;
967 virtual void setBeta(double beta) noexcept = 0;
968 virtual double getBeta() const noexcept = 0;
969 virtual void setAlphaInt64(int64_t alpha) noexcept = 0;
970 virtual int64_t getAlphaInt64() const noexcept = 0;
971 virtual void setBetaInt64(int64_t beta) noexcept = 0;
972 virtual int64_t getBetaInt64() const noexcept = 0;
973 virtual bool isAlphaBetaInt64() const noexcept = 0;
974 virtual DataType getToType() const noexcept = 0;
975 virtual void setToType(DataType toType) noexcept = 0;
976};
977
978class VQuantizeLayer : public VRoot
979{
980public:
981 virtual int32_t getAxis() const noexcept = 0;
982 virtual void setAxis(int32_t axis) noexcept = 0;
983 virtual DataType getToType() const noexcept = 0;
984 virtual void setToType(DataType toType) noexcept = 0;
985 virtual Dims getBlockShape() const noexcept = 0;
986 virtual bool setBlockShape(Dims const& blockShape) noexcept = 0;
987};
988
989class VDequantizeLayer : public VRoot
990{
991public:
992 virtual int32_t getAxis() const noexcept = 0;
993 virtual void setAxis(int32_t axis) noexcept = 0;
994 virtual DataType getToType() const noexcept = 0;
995 virtual void setToType(DataType toType) noexcept = 0;
996 virtual Dims getBlockShape() const noexcept = 0;
997 virtual bool setBlockShape(Dims const& blockShape) noexcept = 0;
998};
999
1000class VDynamicQuantizeLayer : public VRoot
1001{
1002public:
1003 TRT_DEPRECATED virtual int32_t getAxis() const noexcept = 0;
1004 TRT_DEPRECATED virtual void setAxis(int32_t axis) noexcept = 0;
1005 TRT_DEPRECATED virtual int32_t getBlockSize() const noexcept = 0;
1006 TRT_DEPRECATED virtual void setBlockSize(int32_t axis) noexcept = 0;
1007 virtual DataType getScaleType() const noexcept = 0;
1008 virtual void setScaleType(DataType axis) noexcept = 0;
1009 virtual DataType getToType() const noexcept = 0;
1010 virtual void setToType(DataType toType) noexcept = 0;
1011 virtual Dims getBlockShape() const noexcept = 0;
1012 virtual void setBlockShape(Dims const& blockShape) noexcept = 0;
1013};
1014
1015class VScatterLayer : public VRoot
1016{
1017public:
1018 virtual void setMode(ScatterMode mode) noexcept = 0;
1019 virtual ScatterMode getMode() const noexcept = 0;
1020 virtual void setAxis(int32_t axis) noexcept = 0;
1021 virtual int32_t getAxis() const noexcept = 0;
1022}; // class VScatterLayer
1023
1024class VEinsumLayer : public VRoot
1025{
1026public:
1027 virtual bool setEquation(char const* equation) noexcept = 0;
1028 virtual char const* getEquation() const noexcept = 0;
1029};
1030
1031class VOneHotLayer : public VRoot
1032{
1033public:
1034 virtual int32_t getAxis() const noexcept = 0;
1035 virtual void setAxis(int32_t axis) noexcept = 0;
1036}; // class VOneHotLayer
1037
1038class VGridSampleLayer : public VRoot
1039{
1040public:
1041 virtual void setInterpolationMode(InterpolationMode mode) noexcept = 0;
1042 virtual InterpolationMode getInterpolationMode() const noexcept = 0;
1043 virtual void setAlignCorners(bool alignCorners) noexcept = 0;
1044 virtual bool getAlignCorners() const noexcept = 0;
1045 virtual bool setSampleMode(SampleMode mode) noexcept = 0;
1046 virtual SampleMode getSampleMode() const noexcept = 0;
1047}; // class VGridSampleLayer
1048
1049class VNMSLayer : public VRoot
1050{
1051public:
1052 virtual void setBoundingBoxFormat(BoundingBoxFormat fmt) noexcept = 0;
1053 virtual BoundingBoxFormat getBoundingBoxFormat() const noexcept = 0;
1054 virtual void setTopKBoxLimit(int32_t limit) noexcept = 0;
1055 virtual int32_t getTopKBoxLimit() const noexcept = 0;
1056 virtual bool setIndicesType(DataType type) noexcept = 0;
1057 virtual DataType getIndicesType() const noexcept = 0;
1058}; // class VNMSLayer
1059
1060class VReverseSequenceLayer : public VRoot
1061{
1062public:
1063 virtual void setBatchAxis(int32_t batchAxis) noexcept = 0;
1064 virtual int32_t getBatchAxis() const noexcept = 0;
1065
1066 virtual void setSequenceAxis(int32_t sequenceAxis) noexcept = 0;
1067 virtual int32_t getSequenceAxis() const noexcept = 0;
1068}; // class VReverseSequenceLayer
1069
1070class VNormalizationLayer : public VRoot
1071{
1072public:
1073 virtual void setEpsilon(float eps) noexcept = 0;
1074 virtual float getEpsilon() const noexcept = 0;
1075 virtual void setAxes(uint32_t axesMask) noexcept = 0;
1076 virtual uint32_t getAxes() const noexcept = 0;
1077 virtual void setNbGroups(int64_t nbGroups) noexcept = 0;
1078 virtual int64_t getNbGroups() const noexcept = 0;
1079 virtual bool isV2() const noexcept = 0;
1080}; // class VNormalizationLayer
1081
1082class VSqueezeLayer : public VRoot
1083{
1084};
1085
1086class VUnsqueezeLayer : public VRoot
1087{
1088};
1089
1090class VCumulativeLayer : public VRoot
1091{
1092public:
1093 virtual bool setOperation(CumulativeOperation op) noexcept = 0;
1094 virtual CumulativeOperation getOperation() const noexcept = 0;
1095 virtual void setExclusive(bool exclusive) noexcept = 0;
1096 virtual bool getExclusive() const noexcept = 0;
1097 virtual void setReverse(bool reverse) noexcept = 0;
1098 virtual bool getReverse() const noexcept = 0;
1099}; // class VCumulativeLayer
1100
1101class VRotaryEmbeddingLayer : public VRoot
1102{
1103public:
1104 virtual void setInterleaved(bool interleaved) noexcept = 0;
1105 virtual bool getInterleaved() const noexcept = 0;
1106 virtual bool setRotaryEmbeddingDim(int32_t rotaryEmbeddingDim) noexcept = 0;
1107 virtual int32_t getRotaryEmbeddingDim() const noexcept = 0;
1108 virtual void setInput(int32_t index, ITensor& input) noexcept = 0;
1109}; // class VRotaryEmbeddingLayer
1110
1111class VKVCacheUpdateLayer : public VRoot
1112{
1113public:
1114 TRT_NODISCARD virtual bool setCacheMode(KVCacheMode cacheMode) noexcept = 0;
1115 TRT_NODISCARD virtual KVCacheMode getCacheMode() const noexcept = 0;
1116 TRT_NODISCARD virtual bool setUpdateForm(AttentionIOForm form) noexcept = 0;
1117 TRT_NODISCARD virtual AttentionIOForm getUpdateForm() const noexcept = 0;
1118 TRT_NODISCARD virtual bool setUpdateLengths(ITensor* lengths) noexcept = 0;
1119 TRT_NODISCARD virtual ITensor* getUpdateLengths() const noexcept = 0;
1120}; // class VKVCacheUpdateLayer
1121
1122class VMoELayer : public VRoot
1123{
1124public:
1125 virtual void setGatedWeights(ITensor& fcGateWeights, ITensor& fcUpWeights, ITensor& fcDownWeights, MoEActType activationType) noexcept = 0;
1126 virtual void setGatedBiases(ITensor& fcGateBiases, ITensor& fcUpBiases, ITensor& fcDownBiases) noexcept = 0;
1127 virtual void setActivationType(MoEActType activationType) noexcept = 0;
1128 virtual MoEActType getActivationType() const noexcept = 0;
1129 virtual void setQuantizationStatic(ITensor& fcDownActivationScale, DataType dataType) noexcept = 0;
1130 virtual void setQuantizationDynamicDblQ(ITensor& fcDownActivationDblQScale, DataType dataType, Dims const& blockShape, DataType dynQOutputScaleType) noexcept = 0;
1131 virtual void setQuantizationToType(DataType type) noexcept = 0;
1132 virtual DataType getQuantizationToType() const noexcept = 0;
1133 virtual void setQuantizationBlockShape(Dims const& blockShape) noexcept = 0;
1134 virtual Dims getQuantizationBlockShape() const noexcept = 0;
1135 virtual void setDynQOutputScaleType(DataType type) noexcept = 0;
1136 virtual DataType getDynQOutputScaleType() const noexcept = 0;
1137 virtual void setSwigluParams(float limit, float alpha, float beta) noexcept = 0;
1138 virtual void setSwigluParamLimit(float limit) noexcept = 0;
1139 virtual float getSwigluParamLimit() const noexcept = 0;
1140 virtual void setSwigluParamAlpha(float alpha) noexcept = 0;
1141 virtual float getSwigluParamAlpha() const noexcept = 0;
1142 virtual void setSwigluParamBeta(float beta) noexcept = 0;
1143 virtual float getSwigluParamBeta() const noexcept = 0;
1144 virtual void setInput(int32_t index, ITensor& tensor) noexcept = 0;
1145}; // class VMoELayer
1146
1147
1148class VNetworkDefinition : public VRoot
1149{
1150public:
1151 virtual ITensor* addInput(char const* name, DataType type, Dims const& dimensions) noexcept = 0;
1152 virtual void markOutput(ITensor& tensor) noexcept = 0;
1153 virtual IActivationLayer* addActivation(ITensor& input, ActivationType type) noexcept = 0;
1154 virtual ILRNLayer* addLRN(ITensor& input, int64_t window, float alpha, float beta, float k) noexcept = 0;
1155 virtual IScaleLayer* addScale(
1156 ITensor& input, ScaleMode mode, Weights shift, Weights scale, Weights power) noexcept = 0;
1157 virtual ISoftMaxLayer* addSoftMax(ITensor& input) noexcept = 0;
1158 virtual IConcatenationLayer* addConcatenation(ITensor* const* inputs, int32_t nbInputs) noexcept = 0;
1159 virtual IElementWiseLayer* addElementWise(ITensor& input1, ITensor& input2, ElementWiseOperation op) noexcept = 0;
1160 virtual IUnaryLayer* addUnary(ITensor& input, UnaryOperation operation) noexcept = 0;
1161 virtual IShuffleLayer* addShuffle(ITensor& input) noexcept = 0;
1162 virtual int32_t getNbLayers() const noexcept = 0;
1163 virtual ILayer* getLayer(int32_t index) const noexcept = 0;
1164 virtual int32_t getNbInputs() const noexcept = 0;
1165 virtual ITensor* getInput(int32_t index) const noexcept = 0;
1166 virtual int32_t getNbOutputs() const noexcept = 0;
1167 virtual ITensor* getOutput(int32_t index) const noexcept = 0;
1168 virtual IReduceLayer* addReduce(
1169 ITensor& input, ReduceOperation operation, uint32_t reduceAxes, bool keepDimensions) noexcept
1170 = 0;
1171 virtual ITopKLayer* addTopK(ITensor& input, TopKOperation op, int32_t k, uint32_t reduceAxes) noexcept = 0;
1172 virtual IGatherLayer* addGather(ITensor& data, ITensor& indices, int32_t axis) noexcept = 0;
1173 virtual IRaggedSoftMaxLayer* addRaggedSoftMax(ITensor& input, ITensor& bounds) noexcept = 0;
1174 virtual IMatrixMultiplyLayer* addMatrixMultiply(
1175 ITensor& input0, MatrixOperation op0, ITensor& input1, MatrixOperation op1) noexcept = 0;
1176 virtual IConstantLayer* addConstant(Dims const& dimensions, Weights weights) noexcept = 0;
1177 virtual IIdentityLayer* addIdentity(ITensor& input) noexcept = 0;
1178 virtual void removeTensor(ITensor& tensor) noexcept = 0;
1179 virtual void unmarkOutput(ITensor& tensor) noexcept = 0;
1180 virtual ISliceLayer* addSlice(ITensor& input, Dims const& start, Dims const& size, Dims const& stride) noexcept = 0;
1181 virtual void setName(char const* name) noexcept = 0;
1182 virtual char const* getName() const noexcept = 0;
1183 virtual IShapeLayer* addShape(ITensor& input) noexcept = 0;
1184 virtual bool hasImplicitBatchDimension() const noexcept = 0;
1185 virtual bool markOutputForShapes(ITensor& tensor) noexcept = 0;
1186 virtual bool unmarkOutputForShapes(ITensor& tensor) noexcept = 0;
1187 virtual IParametricReLULayer* addParametricReLU(ITensor& input, ITensor& slope) noexcept = 0;
1188 virtual IConvolutionLayer* addConvolutionNd(
1189 ITensor& input, int64_t nbOutputMaps, Dims const& kernelSize, Weights kernelWeights, Weights biasWeights) noexcept
1190 = 0;
1191 virtual IPoolingLayer* addPoolingNd(ITensor& input, PoolingType type, Dims const& windowSize) noexcept = 0;
1192 virtual IDeconvolutionLayer* addDeconvolutionNd(
1193 ITensor& input, int64_t nbOutputMaps, Dims const& kernelSize, Weights kernelWeights, Weights biasWeights) noexcept
1194 = 0;
1195 virtual IScaleLayer* addScaleNd(
1196 ITensor& input, ScaleMode mode, Weights shift, Weights scale, Weights power, int32_t channelAxis) noexcept = 0;
1197 virtual IResizeLayer* addResize(ITensor& input) noexcept = 0;
1198 virtual ILoop* addLoop() noexcept = 0;
1199 virtual ISelectLayer* addSelect(ITensor& condition, ITensor& thenInput, ITensor& elseInput) noexcept = 0;
1200 virtual IPaddingLayer* addPaddingNd(ITensor& input, Dims const& prePadding, Dims const& postPadding) noexcept = 0;
1201 virtual bool setWeightsName(Weights weights, char const* name) noexcept = 0;
1202 virtual void setErrorRecorder(IErrorRecorder* recorder) noexcept = 0;
1203 virtual IErrorRecorder* getErrorRecorder() const noexcept = 0;
1204 virtual IGatherLayer* addGatherV2(ITensor& data, ITensor& indices, GatherMode mode) noexcept = 0;
1205 virtual IIfConditional* addIfConditional() noexcept = 0;
1206 virtual IScatterLayer* addScatter(ITensor& data, ITensor& indices, ITensor& updates, ScatterMode mode) noexcept = 0;
1207 virtual IEinsumLayer* addEinsum(ITensor* const* inputs, int32_t nbInputs, char const* equation) noexcept = 0;
1208 virtual IAssertionLayer* addAssertion(ITensor& condition, char const* message) noexcept = 0;
1209 virtual IOneHotLayer* addOneHot(ITensor& indices, ITensor& values, ITensor& depth, int32_t axis) noexcept = 0;
1210 virtual INonZeroLayer* addNonZero(ITensor& input) noexcept = 0;
1211 virtual IGridSampleLayer* addGridSample(ITensor& input, ITensor& grid) noexcept = 0;
1212 virtual INMSLayer* addNMS(ITensor& boxes, ITensor& scores, ITensor& maxOutputBoxesPerClass) noexcept = 0;
1213 virtual IReverseSequenceLayer* addReverseSequence(ITensor& input, ITensor& sequenceLens) noexcept = 0;
1214 virtual INormalizationLayer* addNormalization(
1215 ITensor& input, ITensor& scale, ITensor& bias, uint32_t axesMask) noexcept = 0;
1216 virtual ICastLayer* addCast(ITensor& input, DataType toType) noexcept = 0;
1217 virtual IBuilder& getBuilder() const noexcept = 0;
1218 virtual NetworkDefinitionCreationFlags getFlags() const noexcept = 0;
1219 virtual bool getFlag(NetworkDefinitionCreationFlag networkDefinitionCreationFlag) const noexcept = 0;
1220 virtual IQuantizeLayer* addQuantizeV2(ITensor& input, ITensor& scale, DataType outputType) noexcept = 0;
1221 virtual IDequantizeLayer* addDequantizeV2(ITensor& input, ITensor& scale, DataType outputType) noexcept = 0;
1222 virtual IFillLayer* addFillV2(Dims const& dimensions, FillOperation op, DataType outputType) noexcept = 0;
1223 virtual bool markDebug(ITensor& tensor) noexcept = 0;
1224 virtual bool unmarkDebug(ITensor& tensor) noexcept = 0;
1225 virtual bool isDebugTensor(ITensor const& tensor) const noexcept = 0;
1226 virtual bool markWeightsRefittable(char const* name) noexcept = 0;
1227 virtual bool unmarkWeightsRefittable(char const* name) noexcept = 0;
1228 virtual bool areWeightsMarkedRefittable(char const* name) const noexcept = 0;
1229 virtual ISqueezeLayer* addSqueeze(ITensor& input, ITensor& axes) noexcept = 0;
1230 virtual IUnsqueezeLayer* addUnsqueeze(ITensor& input, ITensor& axes) noexcept = 0;
1231 virtual IDynamicQuantizeLayer* addDynamicQuantize(
1232 ITensor& input, int32_t axis, int32_t blockSize, DataType toType, DataType scaleType) noexcept = 0;
1233 virtual ICumulativeLayer* addCumulative(
1234 ITensor& input, ITensor& axis, CumulativeOperation operation, bool exclusive, bool reverse) noexcept = 0;
1235 virtual bool markUnfusedTensorsAsDebugTensors() noexcept = 0;
1236 virtual bool unmarkUnfusedTensorsAsDebugTensors() noexcept = 0;
1237 virtual ITopKLayer* addTopKV2(
1238 ITensor& input, TopKOperation op, int32_t k, uint32_t reduceAxes, DataType indicesType) noexcept = 0;
1239 virtual INonZeroLayer* addNonZeroV2(ITensor& input, DataType indicesType) noexcept = 0;
1240 virtual INMSLayer* addNMSV2(
1241 ITensor& boxes, ITensor& scores, ITensor& maxOutputBoxesPerClass, DataType indicesType) noexcept = 0;
1242 TRT_DEPRECATED virtual IAttention* addAttention(
1243 ITensor& query, ITensor& key, ITensor& value, AttentionNormalizationOp normOp, bool isCausal) noexcept = 0;
1244 virtual IRotaryEmbeddingLayer* addRotaryEmbedding(ITensor& input, ITensor& cosCache, ITensor& sinCache,
1245 bool interleaved, int32_t rotaryEmbeddingDim) noexcept = 0;
1246 virtual IDynamicQuantizeLayer* addDynamicQuantizeV2(
1247 ITensor& input, Dims const& blockShape, DataType toType, DataType scaleType) noexcept = 0;
1248 virtual IKVCacheUpdateLayer* addKVCacheUpdate(
1249 ITensor& cache, ITensor& update, ITensor& writeIndices, KVCacheMode cacheMode) noexcept = 0;
1250 virtual INormalizationLayer* addNormalizationV2(
1251 ITensor& input, ITensor& scale, ITensor& bias, uint32_t axesMask) noexcept = 0;
1252 virtual IMoELayer* addMoE(
1253 ITensor& hiddenStates, ITensor& selectedExpertsForTokens, ITensor& scoresForSelectedExperts) noexcept = 0;
1254 virtual IDistCollectiveLayer* addDistCollective(ITensor& input, CollectiveOperation distCollectiveOp,
1255 ReduceOperation reduceOp, int64_t root, int64_t* groups, int64_t groupSize) noexcept = 0;
1256 virtual IAttention* addAttentionV2(ITensor& query, ITensor& key, ITensor& value, AttentionNormalizationOp normOp,
1257 CausalMaskKind causalKind) noexcept = 0;
1258};
1259
1260class VTimingCache : public VRoot
1261{
1262public:
1263 virtual nvinfer1::IHostMemory* serialize() const noexcept = 0;
1264 virtual bool combine(ITimingCache const& inputCache, bool ignoreMismatch) noexcept = 0;
1265 virtual bool reset() noexcept = 0;
1266 virtual int64_t queryKeys(TimingCacheKey* keyBuffer, int64_t capacity) const noexcept = 0;
1267 virtual TimingCacheValue query(TimingCacheKey const& key) const noexcept = 0;
1268 virtual bool update(TimingCacheKey const& key, TimingCacheValue const& value) noexcept = 0;
1269};
1270
1271class VBuilderConfig : public VRoot
1272{
1273public:
1274 virtual void setAvgTimingIterations(int32_t avgTiming) noexcept = 0;
1275 virtual int32_t getAvgTimingIterations() const noexcept = 0;
1276 virtual void setEngineCapability(EngineCapability capability) noexcept = 0;
1277 virtual EngineCapability getEngineCapability() const noexcept = 0;
1278 virtual void setFlags(BuilderFlags builderFlags) noexcept = 0;
1279 virtual BuilderFlags getFlags() const noexcept = 0;
1280 virtual void clearFlag(BuilderFlag builderFlag) noexcept = 0;
1281 virtual void setFlag(BuilderFlag builderFlag) noexcept = 0;
1282 virtual bool getFlag(BuilderFlag builderFlag) const noexcept = 0;
1283 virtual void setDeviceType(ILayer const* layer, DeviceType deviceType) noexcept = 0;
1284 virtual DeviceType getDeviceType(ILayer const* layer) const noexcept = 0;
1285 virtual bool isDeviceTypeSet(ILayer const* layer) const noexcept = 0;
1286 virtual void resetDeviceType(ILayer const* layer) noexcept = 0;
1287 virtual bool canRunOnDLA(ILayer const* layer) const noexcept = 0;
1288 virtual void setDLACore(int32_t dlaCore) noexcept = 0;
1289 virtual int32_t getDLACore() const noexcept = 0;
1290 virtual void setDefaultDeviceType(DeviceType deviceType) noexcept = 0;
1291 virtual DeviceType getDefaultDeviceType() const noexcept = 0;
1292 virtual void reset() noexcept = 0;
1293 virtual void setProfileStream(const cudaStream_t stream) noexcept = 0;
1294 virtual cudaStream_t getProfileStream() const noexcept = 0;
1295 virtual int32_t addOptimizationProfile(IOptimizationProfile const* profile) noexcept = 0;
1296 virtual int32_t getNbOptimizationProfiles() const noexcept = 0;
1297 virtual void setProfilingVerbosity(ProfilingVerbosity verbosity) noexcept = 0;
1298 virtual ProfilingVerbosity getProfilingVerbosity() const noexcept = 0;
1299 virtual bool setTacticSources(TacticSources tacticSources) noexcept = 0;
1300 virtual TacticSources getTacticSources() const noexcept = 0;
1301 virtual nvinfer1::ITimingCache* createTimingCache(void const* blob, std::size_t size) const noexcept = 0;
1302 virtual bool setTimingCache(ITimingCache const& cache, bool ignoreMismatch) noexcept = 0;
1303 virtual nvinfer1::ITimingCache const* getTimingCache() const noexcept = 0;
1304 virtual void setMemoryPoolLimit(MemoryPoolType pool, std::size_t poolSize) noexcept = 0;
1305 virtual std::size_t getMemoryPoolLimit(MemoryPoolType pool) const noexcept = 0;
1306 virtual void setPreviewFeature(PreviewFeature feature, bool enable) noexcept = 0;
1307 virtual bool getPreviewFeature(PreviewFeature feature) const noexcept = 0;
1308 virtual void setBuilderOptimizationLevel(int32_t level) noexcept = 0;
1309 virtual int32_t getBuilderOptimizationLevel() const noexcept = 0;
1310 virtual void setHardwareCompatibilityLevel(HardwareCompatibilityLevel hardwareCompatibilityLevel) noexcept = 0;
1311 virtual HardwareCompatibilityLevel getHardwareCompatibilityLevel() const noexcept = 0;
1312 virtual void setPluginsToSerialize(char const* const* paths, int32_t nbPaths) noexcept = 0;
1313 virtual char const* getPluginToSerialize(int32_t index) const noexcept = 0;
1314 virtual int32_t getNbPluginsToSerialize() const noexcept = 0;
1315 virtual bool setMaxAuxStreams(int32_t nbStreams) noexcept = 0;
1316 virtual int32_t getMaxAuxStreams() const noexcept = 0;
1317 virtual void setProgressMonitor(IProgressMonitor* monitor) noexcept = 0;
1318 virtual IProgressMonitor* getProgressMonitor() const noexcept = 0;
1319 virtual void setRuntimePlatform(RuntimePlatform runtimePlatform) noexcept = 0;
1320 virtual RuntimePlatform getRuntimePlatform() const noexcept = 0;
1321 virtual void setMaxNbTactics(int32_t maxTactics) noexcept = 0;
1322 virtual int32_t getMaxNbTactics() const noexcept = 0;
1323 virtual bool setTilingOptimizationLevel(TilingOptimizationLevel level) noexcept = 0;
1324 virtual TilingOptimizationLevel getTilingOptimizationLevel() const noexcept = 0;
1325 virtual bool setL2LimitForTiling(int64_t size) noexcept = 0;
1326 virtual int64_t getL2LimitForTiling() const noexcept = 0;
1327 TRT_NODISCARD virtual bool setNbComputeCapabilities(int32_t maxNbComputeCapabilities) noexcept = 0;
1328 TRT_NODISCARD virtual int32_t getNbComputeCapabilities() const noexcept = 0;
1329 TRT_NODISCARD virtual bool setComputeCapability(ComputeCapability computeCapability, int32_t index) noexcept = 0;
1330 TRT_NODISCARD virtual ComputeCapability getComputeCapability(int32_t index) const noexcept = 0;
1331};
1332
1333class VSerializationConfig : public VRoot
1334{
1335public:
1336 virtual bool setFlags(SerializationFlags serializationFlags) noexcept = 0;
1337 virtual SerializationFlags getFlags() const noexcept = 0;
1338 virtual bool clearFlag(SerializationFlag serializationFlag) noexcept = 0;
1339 virtual bool setFlag(SerializationFlag serializationFlag) noexcept = 0;
1340 virtual bool getFlag(SerializationFlag serializationFlag) const noexcept = 0;
1341};
1342
1343class VBuilder : public VRoot
1344{
1345public:
1346 virtual int32_t getMaxDLABatchSize() const noexcept = 0;
1347 virtual int32_t getNbDLACores() const noexcept = 0;
1348 virtual void setGpuAllocator(IGpuAllocator* allocator) noexcept = 0;
1349 virtual nvinfer1::IBuilderConfig* createBuilderConfig() noexcept = 0;
1350 virtual nvinfer1::INetworkDefinition* createNetworkV2(NetworkDefinitionCreationFlags flags) noexcept = 0;
1351 virtual nvinfer1::IOptimizationProfile* createOptimizationProfile() noexcept = 0;
1352 virtual void setErrorRecorder(IErrorRecorder* recorder) noexcept = 0;
1353 virtual IErrorRecorder* getErrorRecorder() const noexcept = 0;
1354 virtual void reset() noexcept = 0;
1355 virtual nvinfer1::IHostMemory* buildSerializedNetwork(
1356 INetworkDefinition& network, IBuilderConfig& config) noexcept = 0;
1357 virtual bool isNetworkSupported(INetworkDefinition const& network, IBuilderConfig const& config) const noexcept = 0;
1358 virtual ILogger* getLogger() const noexcept = 0;
1359 virtual bool setMaxThreads(int32_t maxThreads) noexcept = 0;
1360 virtual int32_t getMaxThreads() const noexcept = 0;
1361 virtual IPluginRegistry& getPluginRegistry() noexcept = 0;
1362 virtual bool buildSerializedNetworkToStream(
1363 INetworkDefinition& network, IBuilderConfig& config, IStreamWriter& writer) noexcept = 0;
1364};
1365
1366class VRuntimeConfig : public VRoot
1367{
1368public:
1369 virtual IRuntimeConfig* getPImpl() noexcept = 0;
1370 virtual void setExecutionContextAllocationStrategy(ExecutionContextAllocationStrategy strategy) noexcept = 0;
1371 virtual ExecutionContextAllocationStrategy getExecutionContextAllocationStrategy() const noexcept = 0;
1372 TRT_NODISCARD virtual nvinfer1::IRuntimeCache* createRuntimeCache() const noexcept = 0;
1373 virtual bool setRuntimeCache(nvinfer1::IRuntimeCache const& cache) noexcept = 0;
1374 TRT_NODISCARD virtual nvinfer1::IRuntimeCache* getRuntimeCache() const noexcept = 0;
1375 virtual void setDynamicShapesKernelSpecializationStrategy(
1376 DynamicShapesKernelSpecializationStrategy dynamicShapesKernelSpecializationStrategy) noexcept = 0;
1377 virtual DynamicShapesKernelSpecializationStrategy getDynamicShapesKernelSpecializationStrategy() const noexcept = 0;
1378 virtual bool setCudaGraphStrategy(CudaGraphStrategy strategy) noexcept = 0;
1379 virtual CudaGraphStrategy getCudaGraphStrategy() const noexcept = 0;
1380};
1381
1382class VRuntimeCache : public VRoot
1383{
1384public:
1385 TRT_NODISCARD virtual nvinfer1::IHostMemory* serialize() const noexcept = 0;
1386 virtual bool deserialize(void const* blob, size_t size) noexcept = 0;
1387 virtual bool reset() noexcept = 0;
1388};
1389
1390class VDistCollectiveLayer : public VRoot
1391{
1392}; // VDistCollectiveLayer
1393
1394} // namespace apiv
1395} // namespace nvinfer1
1396
1397// @endcond
1398
1399#endif // NV_INFER_RUNTIME_IMPL_H
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
#define TRT_DEPRECATED
Definition: NvInferRuntimeBase.h:42
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:139
The TensorRT API version 1 namespace.
Definition: NvInferPluginBase.h:29
uint32_t TacticSources
Represents a collection of one or more TacticSource values combine using bitwise-OR operations.
Definition: NvInferRuntime.h:2870
v_1_0::IOutputAllocator IOutputAllocator
Definition: NvInferRuntime.h:4170
ResizeSelector
The coordinate selector when resize to single pixel output.
Definition: NvInfer.h:3917
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:178
MemoryPoolType
The type for memory pools used by TensorRT.
Definition: NvInfer.h:10185
AttentionIOForm
Enumerates the layout of the input/output tensors in an Attention layer.
Definition: NvInfer.h:6728
ScaleMode
Controls how shift, scale and power are applied in a Scale layer.
Definition: NvInfer.h:1587
RuntimePlatform
Describes the intended runtime platform (operating system and CPU architecture) for the execution of ...
Definition: NvInfer.h:9803
TensorIOMode
Definition of tensor IO Mode.
Definition: NvInferRuntimeBase.h:662
HardwareCompatibilityLevel
Describes requirements of compatibility with GPU architectures other than that of the GPU on which th...
Definition: NvInfer.h:10293
CumulativeOperation
Enumerates the cumulative operations that may be performed by a Cumulative layer.
Definition: NvInfer.h:6536
SerializationFlag
List of valid flags that the engine can enable when serializing the bytes.
Definition: NvInferRuntime.h:2911
BoundingBoxFormat
Representation of bounding box data used for the Boxes input tensor in INMSLayer.
Definition: NvInfer.h:6103
ComputeCapability
Describes compute capability that an engine will be built for.
Definition: NvInfer.h:10339
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:2545
v_1_0::IStreamWriter IStreamWriter
Definition: NvInferRuntime.h:699
v_1_0::IProfiler IProfiler
Definition: NvInferRuntime.h:1309
DynamicShapesKernelSpecializationStrategy
Different kernel specialization strategies for dynamic shapes.
Definition: NvInferRuntime.h:3091
v_1_0::IStreamReaderV2 IStreamReaderV2
Definition: NvInferRuntime.h:776
ActivationType
Enumerates the types of activation to perform in an activation layer.
Definition: NvInfer.h:143
uint32_t TempfileControlFlags
Represents a collection of one or more TempfileControlFlag values combined using bitwise-OR operation...
Definition: NvInferRuntime.h:1387
FillOperation
Enumerates the tensor fill operations that may performed by a fill layer.
Definition: NvInfer.h:4920
EngineStat
The kind of engine statistics that queried from the ICudaEngine.
Definition: NvInferRuntime.h:3282
CudaGraphStrategy
Strategies available for CUDA graphs optimizations for JIT (Just-In-Time) inference.
Definition: NvInferRuntime.h:3127
ResizeRoundMode
The rounding mode for nearest neighbor resize.
Definition: NvInfer.h:3944
EngineValidity
Whether a TensorRT-RTX engine is likely to be valid on the current system.
Definition: NvInferRuntime.h:1859
v_1_0::ILogger ILogger
Definition: NvInferRuntimeBase.h:125
CausalMaskKind
Enumerates the causal mask alignment orientation for the attention.
Definition: NvInfer.h:6700
PaddingMode
Enumerates the modes of padding to perform in convolution, deconvolution and pooling layer,...
Definition: NvInfer.h:763
TripLimit
Enum that describes kinds of trip limits.
Definition: NvInfer.h:4302
uint32_t NetworkDefinitionCreationFlags
Represents one or more NetworkDefinitionCreationFlag flags using binary OR operations....
Definition: NvInfer.h:11345
PreviewFeature
Define preview features.
Definition: NvInfer.h:10259
TilingOptimizationLevel
Define the optimization levels for Tiling.
Definition: NvInfer.h:10367
DataType
The type of weights and tensors. The datatypes other than kBOOL, kINT32, and kINT64 are "activation d...
Definition: NvInferRuntimeBase.h:149
uint32_t BuilderFlags
Represents one or more BuilderFlag values using binary OR operations, e.g., 1U << BuilderFlag::kDEBUG...
Definition: NvInfer.h:9832
DeviceType
The device that this layer/network will execute on.
Definition: NvInferRuntime.h:1341
LayerType
The type values of layer classes.
Definition: NvInfer.h:58
SampleMode
Controls how ISliceLayer and IGridSample handle out-of-bounds coordinates.
Definition: NvInfer.h:3047
GatherMode
Control form of IGatherLayer.
Definition: NvInfer.h:2286
v_1_0::IDebugListener IDebugListener
Definition: NvInferRuntime.h:4211
MoEActType
Enumerates the activation type for the MoE layer.
Definition: NvInfer.h:7617
WeightsRole
How a layer uses particular Weights.
Definition: NvInferRuntime.h:1319
uint32_t TensorFormats
It is capable of representing one or more TensorFormat by binary OR operations, e....
Definition: NvInfer.h:135
ProfilingVerbosity
List of verbosity levels of layer information exposed in NVTX annotations and in IEngineInspector.
Definition: NvInferRuntime.h:2882
NetworkDefinitionCreationFlag
List of immutable network properties expressed at network creation time. NetworkDefinitionCreationFla...
Definition: NvInfer.h:11356
ElementWiseOperation
Enumerates the binary operations that may be performed by an ElementWise layer.
Definition: NvInfer.h:2197
CollectiveOperation
Enumerates the collective operations that may be performed by a DistCollective layer.
Definition: NvInfer.h:2675
uint32_t SerializationFlags
Represents one or more SerializationFlag values using binary OR operations, e.g., 1U << Serialization...
Definition: NvInferRuntime.h:2901
InterpolationMode
Enumerates various modes of interpolation.
Definition: NvInfer.h:3841
BuilderFlag
List of valid modes that the builder can enable when creating an engine from a network definition.
Definition: NvInfer.h:9842
TensorFormat
Format of the input/output tensors.
Definition: NvInferRuntime.h:1421
ExecutionContextAllocationStrategy
Different memory allocation behaviors for IExecutionContext.
Definition: NvInferRuntime.h:3018
TopKOperation
Enumerates the operations that may be performed by a TopK layer.
Definition: NvInfer.h:3332
ReduceOperation
Enumerates the reduce operations that may be performed by a Reduce layer.
Definition: NvInfer.h:2647
LayerInformationFormat
The format in which the IEngineInspector prints the layer information.
Definition: NvInferRuntime.h:5166
ScatterMode
Control form of IScatterLayer.
Definition: NvInfer.h:5830
MatrixOperation
Enumerates the operations that may be performed on a tensor by IMatrixMultiplyLayer before multiplica...
Definition: NvInfer.h:3487
ResizeCoordinateTransformation
The resize coordinate transformation function.
Definition: NvInfer.h:3866
LoopOutput
Enum that describes kinds of loop outputs.
Definition: NvInfer.h:4274
KVCacheMode
Enumerates the KVCache modes that may be performed by a KVCacheUpdate layer.
Definition: NvInfer.h:7464
v_1_0::IStreamReader IStreamReader
Definition: NvInferRuntime.h:689
PoolingType
The type of pooling to perform in a pooling layer.
Definition: NvInfer.h:1200
v_1_0::IProgressMonitor IProgressMonitor
Definition: NvInfer.h:10480
TensorLocation
The location for tensor data storage, device or host.
Definition: NvInferRuntime.h:203
OptProfileSelector
When setting or querying optimization profile parameters (such as shape tensor inputs or dynamic dime...
Definition: NvInferRuntime.h:2629
AttentionNormalizationOp
Enumerates the operations that may be performed by the normalization in the attention subgraph.
Definition: NvInfer.h:6668

  Copyright © 2024 NVIDIA Corporation
  Privacy Policy | Manage My Privacy | Do Not Sell or Share My Data | Terms of Service | Accessibility | Corporate Policies | Product Security | Contact