MCPcopy Create free account
hub / github.com/Rust-GPU/rust-cuda / copy_from

Method copy_from

crates/cust/src/module.rs:500–509  ·  view source on GitHub ↗
(&mut self, val: &T)

Source from the content-addressed store, hash-verified

498}
499impl<'a, T: DeviceCopy> CopyDestination<T> for Symbol<'a, T> {
500 fn copy_from(&mut self, val: &T) -> CudaResult<()> {
501 let size = mem::size_of::<T>();
502 if size != 0 {
503 unsafe {
504 cuda::cuMemcpyHtoD_v2(self.ptr.as_raw(), val as *const T as *const c_void, size)
505 .to_result()?
506 }
507 }
508 Ok(())
509 }
510
511 fn copy_to(&self, val: &mut T) -> CudaResult<()> {
512 let size = mem::size_of::<T>();

Callers

nothing calls this directly

Calls 2

to_resultMethod · 0.45
as_rawMethod · 0.45

Tested by

no test coverage detected