Skip to content

Commit 018679f

Browse files
authored
[UR] Implement getProviderNativeError in CUDA adptr. tests (#18055)
This fixes debug builds of UR with CUDA enabled; in that configuration the `test-adapter-cuda` emits a call to `umf::umf2urResult` which requires an implementaiton of `umf::getProviderNativeError`.
1 parent dd59886 commit 018679f

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

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

+10
Original file line numberDiff line numberDiff line change
@@ -166,3 +166,13 @@ void setPluginSpecificMessage(CUresult cu_res) {
166166
setErrorMessage(message, UR_RESULT_ERROR_ADAPTER_SPECIFIC);
167167
free(message);
168168
}
169+
170+
namespace umf {
171+
ur_result_t getProviderNativeError(const char *providerName, int32_t error) {
172+
if (strcmp(providerName, "CUDA") == 0) {
173+
return mapErrorUR(static_cast<CUresult>(error));
174+
}
175+
176+
return UR_RESULT_ERROR_UNKNOWN;
177+
}
178+
} // namespace umf

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

-10
Original file line numberDiff line numberDiff line change
@@ -22,16 +22,6 @@
2222

2323
#include <cuda.h>
2424

25-
namespace umf {
26-
ur_result_t getProviderNativeError(const char *providerName, int32_t error) {
27-
if (strcmp(providerName, "CUDA") == 0) {
28-
return mapErrorUR(static_cast<CUresult>(error));
29-
}
30-
31-
return UR_RESULT_ERROR_UNKNOWN;
32-
}
33-
} // namespace umf
34-
3525
/// USM: Implements USM Host allocations using CUDA Pinned Memory
3626
/// https://docs.nvidia.com/cuda/cuda-c-programming-guide/index.html#page-locked-host-memory
3727
UR_APIEXPORT ur_result_t UR_APICALL

0 commit comments

Comments
 (0)