coreylowman / cudarc

Safe rust wrapper around CUDA toolkit

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

alloc (without memsetting to 0) should be public

M1ngXU opened this issue · comments

commented

can this function be public?

unsafe fn alloc<T>(self: &Arc<Self>, len: usize) -> Result<CudaSlice<T>, DriverError> {

Sometimes i know that i'll overwrite/initialize the memory, but memsetting 2GB-3GB before is rather a waste of time.

Yeah that's fair, and I think many of the dfdx kernels could be moved to using this instead of memsetting 0s. I initially kept it as private just to be on the safer side, but I think since it's marked as unsafe, that should be enough

commented

yes ok, on the weekend i'll try to create a PR to fix the issues i created (54-57)