cubecl_cuda/
device.rs

1// It is not clear if CUDA has a limit on the number of bindings it can hold at
2// any given time, but it's highly unlikely that it's more than this. We can
3// also assume that we'll never have more than this many bindings in flight,
4// so it's 'safe' to store only this many bindings.
5pub const CUDA_MAX_BINDINGS: u32 = 1024;
6
7#[derive(new, Clone, PartialEq, Eq, Default, Hash)]
8pub struct CudaDevice {
9    pub index: usize,
10}
11
12impl core::fmt::Debug for CudaDevice {
13    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
14        write!(f, "Cuda({})", self.index)
15    }
16}