Skip to content

Commit 4433929

Browse files
author
aidan.belton
committed
add check if memory is managed to cuda prefetch
1 parent ba5a126 commit 4433929

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

sycl/plugins/cuda/pi_cuda.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4762,6 +4762,12 @@ pi_result cuda_piextUSMEnqueuePrefetch(pi_queue queue, const void *ptr,
47624762
return PI_PLUGIN_SPECIFIC_ERROR;
47634763
}
47644764

4765+
unsigned int is_managed;
4766+
PI_CHECK_ERROR(cuPointerGetAttribute(
4767+
&is_managed, CU_POINTER_ATTRIBUTE_IS_MANAGED, (CUdeviceptr)ptr));
4768+
if (!is_managed)
4769+
return PI_SUCCESS;
4770+
47654771
// flags is currently unused so fail if set
47664772
if (flags != 0)
47674773
return PI_INVALID_VALUE;

0 commit comments

Comments
 (0)