Skip to content

Commit

Permalink
⚗️ (tracing-msg): proc_env::DeviceType -> GpuDeviceType
Browse files Browse the repository at this point in the history
  • Loading branch information
czy-29 committed Jan 12, 2025
1 parent 91a9a12 commit aa15e05
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions tracing-surreal/src/tracing_msg/proc_env.rs
Original file line number Diff line number Diff line change
Expand Up @@ -84,15 +84,15 @@ impl From<IpNetwork> for sysinfo::IpNetwork {

#[repr(u8)]
#[derive(Serialize, Deserialize, Debug, Clone, Copy, Eq, PartialEq, Hash)]
pub enum DeviceType {
pub enum GpuDeviceType {
Other,
IntegratedGpu,
DiscreteGpu,
VirtualGpu,
Cpu,
}

impl From<wgpu::DeviceType> for DeviceType {
impl From<wgpu::DeviceType> for GpuDeviceType {
fn from(device_type: wgpu::DeviceType) -> Self {
match device_type {
wgpu::DeviceType::Other => Self::Other,
Expand All @@ -104,14 +104,14 @@ impl From<wgpu::DeviceType> for DeviceType {
}
}

impl From<DeviceType> for wgpu::DeviceType {
fn from(device_type: DeviceType) -> Self {
impl From<GpuDeviceType> for wgpu::DeviceType {
fn from(device_type: GpuDeviceType) -> Self {
match device_type {
DeviceType::Other => Self::Other,
DeviceType::IntegratedGpu => Self::IntegratedGpu,
DeviceType::DiscreteGpu => Self::DiscreteGpu,
DeviceType::VirtualGpu => Self::VirtualGpu,
DeviceType::Cpu => Self::Cpu,
GpuDeviceType::Other => Self::Other,
GpuDeviceType::IntegratedGpu => Self::IntegratedGpu,
GpuDeviceType::DiscreteGpu => Self::DiscreteGpu,
GpuDeviceType::VirtualGpu => Self::VirtualGpu,
GpuDeviceType::Cpu => Self::Cpu,
}
}
}
Expand Down Expand Up @@ -212,7 +212,7 @@ pub struct GpuEnv {
pub name: String,
pub vendor_id: u32,
pub device_id: u32,
pub device_type: DeviceType,
pub device_type: GpuDeviceType,
pub driver: String,
pub driver_info: String,
pub backend: Backend,
Expand Down

0 comments on commit aa15e05

Please sign in to comment.