Open
Description
Currently, there's only one way to get a CudaViewMut
from a non-mutable slice reference, which is as_view_mut
(which isn't actually unsafe). This is somewhat inconvenient, since that prevents me making multiple CudaViewMut
instances which would be required for functions like gemm
, or idiomatic use of asynchronous kernel calls.
There doesn't seem to be any practical reason why we can't turn a CudaView
into a CudaViewMut
arbitrarily. As such, I'd like to propose the following changes:
as_view_mut
should take in an&mut CudaSlice
. Possibly also make an unsafe version which does only take in an&
.- Add a method
unsafe fn as_mut_unchecked(&Self) -> CudaViewMut<'a, T>
toCudaView<'a, T>
. This would allow for use of multiple CudaViewMuts while still being clear on when things are being mutated.
Also, I believe that CudaView
should be Copy
able, since it only contains references; is there any reason that isn't the case currently?
Metadata
Metadata
Assignees
Labels
No labels