`DeviceCopy` should not require `Copy`
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 5.4k
- Forks
- 249
- PR merge metrics
- No merged PRs in 30d
Description
I am currently exploring moving from rustacuda to cust. cust now requires DeviceCopy: Copy, which is an insurmountable blocker for me:
-
Copyis not strong enough by itself. For instance,*const Tand&TareCopybut must not beDeviceCopyin general (unless they point to unified memory). -
Copyis too strict. Passing data to the GPU can be modelled as a borrow instead of a copy. The bitwise copy is just an implementation detail. A well-designed API on the host can then ensure that the borrow (or even move or copy semantics) on the host and on the GPU are maintained. However, this requires some unsafe escape hatch for copying!Copytypes to the GPU.
Since cust does not implement any advanced rules for which types can and should be copied, it should - in my opinion - also not impose an overly strict requirement on DeviceCopy. Otherwise, it severely limits the safe APIs one can develop on top of cust.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
The issue names DeviceCopy and its Copy requirement but provides no files, tests, or entry points. Start by locating the DeviceCopy definition and its Copy bound, then establish an agreed design for pointer, reference, and !Copy cases; done requires that design and corresponding validation.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- hpc
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100