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
I am currently exploring moving from rustacuda to cust. cust now requires DeviceCopy: Copy, which is an insurmountable blocker for me:
Copy is not strong enough by itself. For instance, *const T and &T are Copy but must not be DeviceCopy in general (unless they point to unified memory).
Copy is 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 !Copy types 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.
The text was updated successfully, but these errors were encountered:
I am currently exploring moving from
rustacuda
tocust
.cust
now requiresDeviceCopy: Copy
, which is an insurmountable blocker for me:Copy
is not strong enough by itself. For instance,*const T
and&T
areCopy
but must not beDeviceCopy
in general (unless they point to unified memory).Copy
is 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!Copy
types 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 onDeviceCopy
. Otherwise, it severely limits the safe APIs one can develop on top ofcust
.The text was updated successfully, but these errors were encountered: