18#ifndef NV_INFER_RUNTIME_BASE_H
19#define NV_INFER_RUNTIME_BASE_H
24#include <cuda_runtime_api.h>
32#define TRT_DETAIL_EMPTY
35#if __cplusplus >= 201402L
36#define TRT_DEPRECATED [[deprecated]]
37#define TRT_DEPRECATED_BECAUSE(REASON) [[deprecated(REASON)]] TRT_DETAIL##_EMPTY
38#define TRT_DEPRECATED_ENUM TRT_DEPRECATED
40#define TRT_DEPRECATED_API __declspec(dllexport) TRT_DETAIL##_EMPTY
42#define TRT_DEPRECATED_API [[deprecated]] __attribute__((visibility("default"))) TRT_DETAIL##_EMPTY
47#define TRT_DEPRECATED_ENUM
48#define TRT_DEPRECATED_API __declspec(dllexport) TRT_DETAIL##_EMPTY
50#define TRT_DEPRECATED __attribute__((deprecated)) TRT_DETAIL##_EMPTY
51#define TRT_DEPRECATED_ENUM
52#define TRT_DEPRECATED_API __attribute__((deprecated, visibility("default"))) TRT_DETAIL##_EMPTY
54#define TRT_DEPRECATED_BECAUSE(REASON) TRT_DEPRECATED TRT_DETAIL##_EMPTY
58#if __cplusplus >= 201907L
59#define TRT_NODISCARD [[nodiscard]]
60#define TRT_NODISCARD_BECAUSE(REASON) [[nodiscard(REASON)]] TRT_DETAIL##_EMPTY
61#elif __cplusplus >= 201603L
62#define TRT_NODISCARD [[nodiscard]]
63#define TRT_NODISCARD_BECAUSE(REASON) [[nodiscard]] TRT_DETAIL##_EMPTY
66#define TRT_NODISCARD_BECAUSE(REASON) TRT_DETAIL##_EMPTY
70#ifdef TENSORRT_BUILD_LIB
75#define TENSORRTAPI __attribute__((visibility("default"))) TRT_DETAIL##_EMPTY
90#if !defined(NV_INFER_INTERNAL_INCLUDE)
91static_assert(
false,
"Do not directly include this file. Include NvInferRuntime.h or NvInferPluginUtils.h");
106#define NV_TENSORRT_VERSION_INT(major, minor, patch) \
107 ((major) * 10000L + (minor) * 100L + (patch) * 1L) TRT_DETAIL##_EMPTY
111#define NV_TENSORRT_VERSION \
112 NV_TENSORRT_VERSION_INT(NV_TENSORRT_MAJOR, NV_TENSORRT_MINOR, NV_TENSORRT_PATCH) TRT_DETAIL##_EMPTY
219 static constexpr int32_t kVALUE = 12;
282 static constexpr int32_t kVALUE = 2;
423 static constexpr int32_t kVALUE = 11;
453 static constexpr size_t kMAX_DESC_LENGTH{127U};
488 virtual int32_t getNbErrors() const noexcept = 0;
508 virtual
ErrorCode getErrorCode(int32_t errorIdx) const noexcept = 0;
531 virtual
ErrorDesc getErrorDesc(int32_t errorIdx) const noexcept = 0;
548 virtual
bool hasOverflowed() const noexcept = 0;
564 virtual
void clear() noexcept = 0;
695 static constexpr int32_t kVALUE = 3;
#define TENSORRTAPI
Definition: NvInferRuntimeBase.h:78
TENSORRTAPI int32_t getInferLibVersion() noexcept
Return the library version number.
Definition: NvInferRuntimeBase.h:234
static constexpr int32_t MAX_DIMS
The maximum rank (number of dimensions) supported for a tensor.
Definition: NvInferRuntimeBase.h:237
int64_t d[MAX_DIMS]
The extent of each dimension.
Definition: NvInferRuntimeBase.h:243
int32_t nbDims
The rank (number of dimensions).
Definition: NvInferRuntimeBase.h:240
An Interface class for version control.
Definition: NvInferRuntimeBase.h:293
virtual InterfaceInfo getInterfaceInfo() const noexcept=0
Return version information associated with this interface. Applications must not override this method...
virtual APILanguage getAPILanguage() const noexcept
The language used to build the implementation of this Interface.
Definition: NvInferRuntimeBase.h:300
Holds version and kind information for a TensorRT interface.
Definition: NvInferRuntimeBase.h:258
InterfaceKind kind
Interface identifier. Must remain valid for use.
Definition: NvInferRuntimeBase.h:260
int32_t major
Definition: NvInferRuntimeBase.h:261
int32_t minor
Definition: NvInferRuntimeBase.h:262
Interface for recording and querying errors reported by TensorRT.
Definition: NvInferRuntimeBase.h:433
char const * ErrorDesc
A typedef of a C-style string for reporting error descriptions.
Definition: NvInferRuntimeBase.h:446
~IErrorRecorder() noexcept override=default
int32_t RefCount
A typedef of a 32-bit integer for reference counting.
Definition: NvInferRuntimeBase.h:458
InterfaceInfo getInterfaceInfo() const noexcept override
Return version information associated with this interface. Applications must not override this method...
Definition: NvInferRuntimeBase.h:438
Application-implemented logging interface for the builder, refitter and runtime.
Definition: NvInferRuntime.h:1614
The TensorRT API version 1 namespace.
Definition: NvInferSafePlugin.h:33
ErrorCode
Error codes that can be returned by TensorRT during execution.
Definition: NvInferRuntimeBase.h:326
TensorIOMode
Definition of tensor IO Mode.
Definition: NvInferRuntimeBase.h:677
@ kOUTPUT
Tensor is output by the engine.
@ kINPUT
Tensor is input to the engine.
APILanguage
Programming language used in the implementation of a TensorRT interface.
Definition: NvInferRuntimeBase.h:270
v_1_0::ILogger ILogger
Definition: NvInferRuntimeBase.h:135
char_t AsciiChar
Definition: NvInferRuntimeBase.h:126
char char_t
char_t is the type used by TensorRT to represent all valid characters.
Definition: NvInferRuntimeBase.h:122
DataType
The type of weights and tensors. The datatypes other than kBOOL, kINT32, and kINT64 are "activation d...
Definition: NvInferRuntimeBase.h:161
@ kINT64
Signed 64-bit integer type.
@ kFLOAT
32-bit floating point format.
@ kBOOL
8-bit boolean. 0 = false, 1 = true, other values undefined.
@ kHALF
IEEE 16-bit floating-point format – has a 5 bit exponent and 11 bit significand.
@ kINT8
Signed 8-bit integer representing a quantized floating-point value.
@ kE8M0
Unsigned representation of exponent-only 8-bit floating point type for quantization scales.
@ kBF16
Brain float – has an 8 bit exponent and 8 bit significand.
@ kINT4
Signed 4-bit integer type.
@ kINT32
Signed 32-bit integer format.
char const * InterfaceKind
Definition: NvInferRuntimeBase.h:251
constexpr int32_t EnumMax() noexcept
Definition: NvInferRuntimeBase.h:149
v_1_0::IErrorRecorder IErrorRecorder
Definition: NvInferRuntimeBase.h:134
Declaration of EnumMaxImpl struct to store the exclusive upper bound of an enumeration type.
Definition: NvInferRuntimeBase.h:142