18#ifndef NV_INFER_RUNTIME_BASE_H
19#define NV_INFER_RUNTIME_BASE_H
24#include <cuda_runtime_api.h>
27#if __cplusplus >= 201402L
28#define TRT_DEPRECATED [[deprecated]]
30#define TRT_DEPRECATED_ENUM
32#define TRT_DEPRECATED_ENUM TRT_DEPRECATED
35#define TRT_DEPRECATED_API __declspec(dllexport)
37#define TRT_DEPRECATED_API [[deprecated]] __attribute__((visibility("default")))
42#define TRT_DEPRECATED_ENUM
43#define TRT_DEPRECATED_API __declspec(dllexport)
45#define TRT_DEPRECATED __attribute__((deprecated))
46#define TRT_DEPRECATED_ENUM
47#define TRT_DEPRECATED_API __attribute__((deprecated, visibility("default")))
52#ifdef TENSORRT_BUILD_LIB
54#define TENSORRTAPI __declspec(dllexport)
56#define TENSORRTAPI __attribute__((visibility("default")))
71#if !defined(NV_INFER_INTERNAL_INCLUDE)
72static_assert(
false,
"不要直接包含此文件。请包含 NvInferRuntime.h 或 NvInferPluginUtils.h");
87#define NV_TENSORRT_VERSION_INT(major, minor, patch) ((major) *10000L + (minor) *100L + (patch) *1L)
91#define NV_TENSORRT_VERSION NV_TENSORRT_VERSION_INT(NV_TENSORRT_MAJOR, NV_TENSORRT_MINOR, NV_TENSORRT_PATCH)
188 static constexpr int32_t kVALUE = 11;
253 static constexpr int32_t kVALUE = 2;
393 static constexpr int32_t kVALUE = 11;
420static constexpr size_t kMAX_DESC_LENGTH{127U};
455 virtual int32_t getNbErrors() const noexcept = 0;
475 virtual
ErrorCode getErrorCode(int32_t errorIdx) const noexcept = 0;
498 virtual
ErrorDesc getErrorDesc(int32_t errorIdx) const noexcept = 0;
514 virtual
bool hasOverflowed() const noexcept = 0;
530 virtual
void clear() noexcept = 0;
661 static constexpr int32_t kVALUE = 3;
#define TENSORRTAPI
Definition: NvInferRuntimeBase.h:59
int32_t getInferLibVersion() noexcept
返回库版本号。
Definition: NvInferRuntimeBase.h:203
static constexpr int32_t MAX_DIMS
张量支持的最大秩(维度数量)。
Definition: NvInferRuntimeBase.h:206
int64_t d[MAX_DIMS]
每个维度的范围。
Definition: NvInferRuntimeBase.h:212
int32_t nbDims
秩(维度数量)。
Definition: NvInferRuntimeBase.h:209
用于版本控制的接口类。
Definition: NvInferRuntimeBase.h:263
virtual InterfaceInfo getInterfaceInfo() const noexcept=0
返回与此接口关联的版本信息。应用程序不得覆盖此方法...
virtual APILanguage getAPILanguage() const noexcept
用于构建此接口实现的语言。
Definition: NvInferRuntimeBase.h:270
与 TRT 接口关联的版本信息。
Definition: NvInferRuntimeBase.h:228
InterfaceKind kind
Definition: NvInferRuntimeBase.h:230
int32_t major
Definition: NvInferRuntimeBase.h:231
int32_t minor
Definition: NvInferRuntimeBase.h:232
Definition: NvInferRuntimeBase.h:400
char const * ErrorDesc
用于报告错误描述的 C 风格字符串的 typedef。
Definition: NvInferRuntimeBase.h:413
~IErrorRecorder() noexcept override=default
int32_t RefCount
用于引用计数的 32 位整数的 typedef。
Definition: NvInferRuntimeBase.h:425
InterfaceInfo getInterfaceInfo() const noexcept override
返回与此接口关联的版本信息。应用程序不得覆盖此方法...
定义: NvInferRuntimeBase.h:405
ErrorCode
TensorRT 在执行期间可能返回的错误代码。
定义: NvInferRuntimeBase.h:296
TensorIOMode
张量 IO 模式的定义。
定义: NvInferRuntimeBase.h:643
APILanguage
在 TRT 接口实现中使用的编程语言。
定义: NvInferRuntimeBase.h:241
char_t AsciiChar
定义: NvInferRuntimeBase.h:105
char char_t
char_t 是 TensorRT 用于表示所有有效字符的类型。
定义: NvInferRuntimeBase.h:101
DataType
权重和张量的类型。
定义: NvInferRuntimeBase.h:133
@ kBOOL
8 位布尔值。0 = false,1 = true,其他值未定义。
@ kHALF
IEEE 16 位浮点格式 – 具有 5 位指数和 11 位尾数。
@ kINT8
有符号 8 位整数,表示量化的浮点值。
@ kBF16
Brain float – 具有 8 位指数和 8 位尾数。
char const * InterfaceKind
定义: NvInferRuntimeBase.h:220
constexpr int32_t EnumMax() noexcept
枚举类型中元素的最大数量。
定义: NvInferRuntimeBase.h:123
v_1_0::IErrorRecorder IErrorRecorder
定义: NvInferRuntimeBase.h:112
EnumMaxImpl 结构的声明,用于存储枚举类型中元素的最大数量。
定义: NvInferRuntimeBase.h:118