MCPcopy Create free account
hub / github.com/evilsocket/cake / gpu_alloc

Method gpu_alloc

cake-core/src/backends/rocm/mod.rs:209–214  ·  view source on GitHub ↗
(&self, count: usize)

Source from the content-addressed store, hash-verified

207
208 #[inline]
209 fn gpu_alloc(&self, count: usize) -> Result<GpuBuf> {
210 let mut ptr = std::ptr::null_mut();
211 let err = unsafe { (self.ffi.hip_malloc)(&mut ptr, count * 4) };
212 if err != 0 { return Err(candle_core::Error::Msg(format!("hipMalloc: {err}"))); }
213 Ok(GpuBuf { ptr, count, ffi: &*self.ffi as *const RocmFfi })
214 }
215
216 #[inline]
217 fn gpu_upload(&self, data: &[f32]) -> Result<GpuBuf> {

Callers 3

gpu_uploadMethod · 0.80
rocblas_gemmMethod · 0.80
tensor_matmulMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected