Struct Device¶
嵌套关系¶
嵌套类型¶
Struct 文档¶
-
struct Device¶
目标设备的设置数据结构。
Public 成员
-
DeviceType 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
要使用 DataType 类本身,请使用枚举进行接口,而不是常规实例化
ex. torch_tensorrt::DeviceType type = DeviceType::kGPU;
Public 类型
-
enum Value
支持 DeviceType 类的底层枚举类
如果需要使用 DeviceType 类本身,请使用此枚举进行接口,而不是常规实例化
ex. torch_tensorrt::DeviceType type = DeviceType::kGPU;
值
-
enumerator kGPU
目标 GPU,用于运行引擎。
-
enumerator kDLA
目标 DLA,用于运行引擎。
-
enumerator kGPU
Public 函数
-
DeviceType() = default
构造一个新的 设备 类型对象。
-
DeviceType(c10::DeviceType t)
从 torch 设备枚举构造一个新的 设备 类型对象 注意:唯一有效的值是 torch::kCUDA (不支持 torch::kCPU)
- 参数
t –
-
explicit operator bool() = delete
-
inline constexpr bool operator==(DeviceType other) const
DeviceType 的比较运算符。
- 参数
other –
- 返回值
true
- 返回值
false
-
inline constexpr bool operator!=(DeviceType other) const
DeviceType 的比较运算符。
- 参数
other –
- 返回值
true
- 返回值
false
-
enum Value
-
DeviceType device_type¶