ionian-core 0.1.0

Core tensor engine and hardware abstraction for the Ionian AI framework.
Documentation
use super::device::{Device, DeviceType};

pub struct Gpu {
    name: String,
    total_memory: u64, // in bytes
}

impl Gpu {
    pub fn new(name: &str, memory: u64) -> Self {
        Gpu {
            name: name.to_string(),
            total_memory: memory,
        }
    }
}

impl Device for Gpu {
    fn name(&self) -> String {
        self.name.clone()
    }

    fn device_type(&self) -> DeviceType {
        DeviceType::Gpu
    }

    fn memory_info(&self) -> String {
        format!("{} MB", self.total_memory / (1024 * 1024))
    }
}