You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
cuda_core::DeviceCopy is missing several standard-library impls that are safe under the trait's byte-copy and zero-initialization contract. In particular, bool, char, and transparent wrapper/container types such as PhantomData<T>, MaybeUninit<T>, and Wrapping<T> cannot currently be used in otherwise transfer-safe device buffer payloads.
Why this matters
DeviceCopy is the core marker for values that may cross the host/device boundary. Missing impls force users either to avoid ordinary Rust field types or to add local unsafe wrapper impls even when the layout rule is already known and can be encoded once in cuda-core.
The all-zero validity requirement still matters: types such as bare NonZero*, blanket Option<T>, and blanket Result<T, E> should not be accepted unless their zero bit pattern is known to be valid.
Expected behavior
DeviceCopy should cover standard types whose copy and zero-initialization semantics are valid and layout-stable enough for the trait:
bool and char;
PhantomData<T>;
MaybeUninit<T> when T: DeviceCopy;
Wrapping<T> when T: DeviceCopy.
Acceptance criteria
A compile regression using these standard types fails on upstream/main without the impls.
The same regression passes on the patched branch.
Device and pinned-host zeroed-buffer tests prove the newly accepted scalar values work with the existing all-zero initialization API.
The patch does not add unsafe blanket impls for NonZero*, Option<T>, or Result<T, E>.
Activity
niklebedenko commentedon Jun 16, 2026
N.b. bool and char haven't been added in #202, everything else I mentioned has.