Shortcuts

设备结构

嵌套关系

嵌套类型

结构体文档

struct Device

为目标设备设置数据结构。

公共函数

inline Device()

设备 结构的构造函数

公共成员

设备类型 device_type

设置设备的数据结构 此结构体将保存目标设备相关的参数,如device_type、gpu_id、dla_core。

int64_t gpu_id
int64_t dla_core
bool allow_gpu_fallback

(仅在针对DLA(设备)时使用)如果引擎在DLA上不支持某些层,则让它们在GPU上运行

class DeviceType

支持的设备类型,可与TensorRT引擎一起使用

该类与c10::DeviceTypes兼容(但会检查TRT支持),唯一适用的值是at::kCUDA,它映射到DeviceType::kGPU

要使用数据类型类本身,接口使用枚举与普通实例化

例如. torch_tensorrt::DeviceType type = DeviceType::kGPU;

公共类型

enum Value

支持设备类型类的基础枚举类

在需要使用设备类型类本身的情况下,使用此枚举与普通实例化进行接口

例如. torch_tensorrt::DeviceType type = DeviceType::kGPU;

值:

enumerator kGPU

目标GPU运行引擎。

enumerator kDLA

目标DLA运行引擎。

公共函数

DeviceType() = default

构造一个新的设备类型对象。

inline constexpr DeviceType( t)

从内部枚举构造一个新的设备类型对象。

DeviceType(c10::DeviceType t)

从torch设备枚举中构造一个新的设备类型对象 注意:唯一有效的值是torch::kCUDA(不支持torch::kCPU)

Parameters

t

inline operator () const

设备对象中获取内部值。

Returns

explicit operator bool() = delete
inline constexpr bool operator==(设备类型 other) const

设备类型 的比较运算符。

Parameters

其他

Returns

Returns

inline constexpr bool operator!=(设备类型 other) const

比较运算符用于设备类型

Parameters

其他

Returns

Returns