Skip to content

Commit ea4039f

Browse files
committed
add success return in cuda/hip enqueue
1 parent 69a552b commit ea4039f

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

unified-runtime/source/adapters/cuda/enqueue.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@ ur_result_t setCuMemAdvise(CUdeviceptr DevPtr, size_t Size,
9999
if (URAdviceFlags & UnmappedFlag) {
100100
logger::warning("Memory advice ignored because the CUDA backend does not "
101101
"support some of the specified flags.");
102+
return UR_RESULT_SUCCESS;
102103
}
103104
}
104105

@@ -1613,13 +1614,15 @@ UR_APIEXPORT ur_result_t UR_APICALL urEnqueueUSMPrefetch(
16131614
if (!getAttribute(Device, CU_DEVICE_ATTRIBUTE_CONCURRENT_MANAGED_ACCESS)) {
16141615
logger::warning("Prefetch hint ignored as device does not support "
16151616
"concurrent managed access.");
1617+
return UR_RESULT_SUCCESS;
16161618
}
16171619

16181620
unsigned int IsManaged;
16191621
UR_CHECK_ERROR(cuPointerGetAttribute(
16201622
&IsManaged, CU_POINTER_ATTRIBUTE_IS_MANAGED, (CUdeviceptr)pMem));
16211623
if (!IsManaged) {
16221624
logger::warning("Prefetch hint ignored as prefetch only works with USM.");
1625+
return UR_RESULT_SUCCESS;
16231626
}
16241627

16251628
ur_result_t Result = UR_RESULT_SUCCESS;
@@ -1671,7 +1674,7 @@ urEnqueueUSMAdvise(ur_queue_handle_t hQueue, const void *pMem, size_t size,
16711674
if (!getAttribute(Device, CU_DEVICE_ATTRIBUTE_CONCURRENT_MANAGED_ACCESS)) {
16721675
logger::warning("Mem advise ignored as device does not support "
16731676
"concurrent managed access.");
1674-
return UR_RESULT_ERROR_ADAPTER_SPECIFIC;
1677+
return UR_RESULT_SUCCESS;
16751678
}
16761679

16771680
// TODO: If ptr points to valid system-allocated pageable memory we should

unified-runtime/source/adapters/hip/enqueue.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1410,6 +1410,7 @@ UR_APIEXPORT ur_result_t UR_APICALL urEnqueueUSMPrefetch(
14101410
releaseEvent();
14111411
logger::warning("mem_advise ignored as device does not support "
14121412
"managed memory access.");
1413+
return UR_RESULT_SUCCESS;
14131414
}
14141415

14151416
hipPointerAttribute_t attribs;
@@ -1423,7 +1424,7 @@ UR_APIEXPORT ur_result_t UR_APICALL urEnqueueUSMPrefetch(
14231424
if (!attribs.isManaged) {
14241425
releaseEvent();
14251426
logger::warning("Prefetch hint ignored as prefetch only works with USM.");
1426-
return UR_RESULT_ERROR_ADAPTER_SPECIFIC;
1427+
return UR_RESULT_SUCCESS;
14271428
}
14281429

14291430
UR_CHECK_ERROR(
@@ -1480,6 +1481,7 @@ urEnqueueUSMAdvise(ur_queue_handle_t hQueue, const void *pMem, size_t size,
14801481
releaseEvent();
14811482
logger::warning("mem_advise ignored as device does not support "
14821483
"managed memory access.");
1484+
return UR_RESULT_SUCCESS;
14831485
}
14841486

14851487
// Passing MEM_ADVICE_SET/MEM_ADVICE_CLEAR_PREFERRED_LOCATION to
@@ -1496,6 +1498,7 @@ urEnqueueUSMAdvise(ur_queue_handle_t hQueue, const void *pMem, size_t size,
14961498
releaseEvent();
14971499
logger::warning("mem_advise ignored as device does not support "
14981500
"concurrent memory access.");
1501+
return UR_RESULT_SUCCESS;
14991502
}
15001503

15011504
// TODO: If pMem points to valid system-allocated pageable memory, we
@@ -1515,7 +1518,7 @@ urEnqueueUSMAdvise(ur_queue_handle_t hQueue, const void *pMem, size_t size,
15151518
releaseEvent();
15161519
logger::warning("mem_advise is ignored as the pointer argument is not "
15171520
"a shared USM pointer.");
1518-
return UR_RESULT_ERROR_ADAPTER_SPECIFIC;
1521+
return UR_RESULT_SUCCESS;
15191522
}
15201523

15211524
const auto DeviceID = Device->get();
@@ -1544,6 +1547,7 @@ urEnqueueUSMAdvise(ur_queue_handle_t hQueue, const void *pMem, size_t size,
15441547
releaseEvent();
15451548
logger::warning("mem_advise is ignored as the advice argument is not "
15461549
"supported by this device.");
1550+
return UR_RESULT_SUCCESS;
15471551
}
15481552
UR_CHECK_ERROR(Result);
15491553
}

0 commit comments

Comments
 (0)