add as_cuda_slice_mut to CudaStorage and CudaDType (#2859)

This commit is contained in:
Zack Angelo
2025-04-01 12:34:52 -05:00
committed by GitHub
parent 9541467d6b
commit b4daa03e59
2 changed files with 20 additions and 1 deletions

View File

@ -21,7 +21,9 @@ impl BenchDevice for Device {
Device::Cpu => Ok(()),
Device::Cuda(device) => {
#[cfg(feature = "cuda")]
return Ok(device.synchronize()?);
return Ok(device
.synchronize()
.map_err(|e| candle_core::Error::Cuda(Box::new(e)))?);
#[cfg(not(feature = "cuda"))]
panic!("Cuda device without cuda feature enabled: {:?}", device)
}