Skip to content

Commit 45aace3

Browse files
authored
[PI][UR] Report error from cuInit (#10353)
Currently if `cuInit` fails while getting platforms it returns UR_RESULT_SUCCESS. Instead we use `UR_CHECK_ERROR` to return the correct error code.
1 parent 0662e2a commit 45aace3

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

sycl/plugins/unified_runtime/ur/adapters/cuda/platform.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,8 @@ urPlatformGet(uint32_t NumEntries, ur_platform_handle_t *phPlatforms,
7373
std::call_once(
7474
InitFlag,
7575
[](ur_result_t &Result) {
76-
if (cuInit(0) != CUDA_SUCCESS) {
76+
Result = UR_CHECK_ERROR(cuInit(0));
77+
if (Result != UR_RESULT_SUCCESS) {
7778
NumPlatforms = 0;
7879
return;
7980
}

0 commit comments

Comments
 (0)