Open
Description
I don't think that the various allocation methods (alloc
, alloc_unified
, alloc_pinned
) should be marked unsafe, because allocating uninitialized device memory is not unsafe, its the actual reading of uninitialized values that is unsafe.
We also know that rust and cuda likely have different rules for undefined behavior.
Things to check:
- When doing rust -> cuda memcpy, is it undefined behavior to read uninitialized values in rust for copying to cuda?
- When doing cuda -> rust memcpy, is it undefined behavior if the cuda values are uninitialized?
- When doing cuda -> cuda memcpy, is it undefined behavior if values are uninitialized?
Additionally, for CudaStream::memcpy_dtov
, do we need to mark it as unsafe because the resulting Vec<T>
might contain uninitialized or invalid values for T
?
Metadata
Metadata
Assignees
Labels
No labels