-
Notifications
You must be signed in to change notification settings - Fork 219
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Don't assume host pointers are directly usable on the device. (#1342)
Since CUDA.jl 3.4, we now always reconstruct a buffer object when creating an array from a pointer. In the case of a HostBuffer, that means we want the host pointer in the buffer object, which is converted to a device pointer on request. However, unsafe_wrap is invoked with a device pointer. Generally, those pointers are identical, but on GPUs where CU_DEVICE_ATTRIBUTE_CAN_USE_HOST_POINTER_FOR_REGISTERED_MEM==0, that is not the case. Instead, recover the host pointer from the device pointer passed to unsafe_wrap. This is going back and forth between both pointer representations, but those calls are reasonably cheap.
- Loading branch information
Showing
3 changed files
with
32 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters