Skip to content

Commit

Permalink
[SYCL][CUDA] Set cuda_piextUSMEnqueuePrefetch to fail for windows (#4908
Browse files Browse the repository at this point in the history
)

`cuMemPrefetchAsync` currently has issues on Windows machines, this appears to be a problem with CUDA and not the plugins usage of the function.
I think `cuda_piextUSMEnqueuePrefetch` which uses `cuMemPrefetchAsync` should be set to fail for windows and send a message to the user that this functionality is not available on windows devices.

More details: #4809
  • Loading branch information
AidanBeltonS authored Nov 9, 2021
1 parent 2f4de56 commit 0c33048
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions sycl/plugins/cuda/pi_cuda.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4651,6 +4651,14 @@ pi_result cuda_piextUSMEnqueuePrefetch(pi_queue queue, const void *ptr,
const pi_event *events_waitlist,
pi_event *event) {

// CUDA has an issue with cuMemPrefetchAsync returning cudaErrorInvalidDevice
// for Windows machines
// TODO: Remove when fix is found
#ifdef _MSC_VER
cl::sycl::detail::pi::die(
"cuda_piextUSMEnqueuePrefetch does not currently work on Windows");
#endif

// flags is currently unused so fail if set
if (flags != 0)
return PI_INVALID_VALUE;
Expand Down

0 comments on commit 0c33048

Please sign in to comment.