mesh-sieve 4.0.1

Modular, high-performance Rust library for mesh and data management, designed for scientific computing and PDE codes.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
//! CUDA allocation wrapper.

use cudarc::driver::CudaSlice;

use crate::accelerator::{DeviceBuffer, DeviceValue};

/// Opaque device allocation. It intentionally exposes no host slice methods.
#[derive(Debug)]
pub struct CudaBuffer<T: DeviceValue> {
    pub(super) inner: CudaSlice<T>,
    pub(super) backend_id: u64,
}

impl<T: DeviceValue> DeviceBuffer<T> for CudaBuffer<T> {
    fn len(&self) -> usize {
        self.inner.len()
    }
}