Skip to content

Commit 8ed7a36

Browse files
author
aidan.belton
committed
emit warning
1 parent 172708b commit 8ed7a36

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

sycl/plugins/cuda/pi_cuda.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4803,12 +4803,14 @@ pi_result cuda_piextUSMEnqueueMemAdvise(pi_queue queue, const void *ptr,
48034803
pi_result result = PI_SUCCESS;
48044804
std::unique_ptr<_pi_event> event_ptr{nullptr};
48054805

4806-
// Ignore mem advice if memory is not managed
48074806
unsigned int is_managed;
48084807
PI_CHECK_ERROR(cuPointerGetAttribute(
48094808
&is_managed, CU_POINTER_ATTRIBUTE_IS_MANAGED, (CUdeviceptr)ptr));
4810-
if (!is_managed)
4811-
return PI_SUCCESS;
4809+
if (!is_managed) {
4810+
setErrorMessage("Prefetch hint ignored as mem advise only works with USM",
4811+
PI_SUCCESS);
4812+
return PI_PLUGIN_SPECIFIC_ERROR;
4813+
}
48124814

48134815
try {
48144816
ScopedContext active(queue->get_context());

0 commit comments

Comments
 (0)