Skip to content

Commit 3a7d00f

Browse files
authored
Merge pull request #1485 from aarongreig/aaron/addDeviceNotAvailableErrC
Add UR_ERROR_DEVICE_NOT_AVAILABLE and appropriate translation for CL.
2 parents cd5ad7b + 9e5c620 commit 3a7d00f

File tree

4 files changed

+8
-0
lines changed

4 files changed

+8
-0
lines changed

include/ur_api.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -493,6 +493,7 @@ typedef enum ur_result_t {
493493
///< retrieved via the urPlatformGetLastError entry point.
494494
UR_RESULT_ERROR_LAYER_NOT_PRESENT = 68, ///< A requested layer was not found by the loader.
495495
UR_RESULT_ERROR_IN_EVENT_LIST_EXEC_STATUS = 69, ///< An event in the provided wait list has ::UR_EVENT_STATUS_ERROR.
496+
UR_RESULT_ERROR_DEVICE_NOT_AVAILABLE = 70, ///< Device in question has `::UR_DEVICE_INFO_AVAILABLE == false`
496497
UR_RESULT_ERROR_INVALID_COMMAND_BUFFER_EXP = 0x1000, ///< Invalid Command-Buffer
497498
UR_RESULT_ERROR_INVALID_COMMAND_BUFFER_SYNC_POINT_EXP = 0x1001, ///< Sync point is not valid for the command-buffer
498499
UR_RESULT_ERROR_INVALID_COMMAND_BUFFER_SYNC_POINT_WAIT_LIST_EXP = 0x1002, ///< Sync point wait list is invalid

include/ur_print.hpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1542,6 +1542,9 @@ inline std::ostream &operator<<(std::ostream &os, enum ur_result_t value) {
15421542
case UR_RESULT_ERROR_IN_EVENT_LIST_EXEC_STATUS:
15431543
os << "UR_RESULT_ERROR_IN_EVENT_LIST_EXEC_STATUS";
15441544
break;
1545+
case UR_RESULT_ERROR_DEVICE_NOT_AVAILABLE:
1546+
os << "UR_RESULT_ERROR_DEVICE_NOT_AVAILABLE";
1547+
break;
15451548
case UR_RESULT_ERROR_INVALID_COMMAND_BUFFER_EXP:
15461549
os << "UR_RESULT_ERROR_INVALID_COMMAND_BUFFER_EXP";
15471550
break;

scripts/core/common.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -276,6 +276,8 @@ etors:
276276
desc: "A requested layer was not found by the loader."
277277
- name: ERROR_IN_EVENT_LIST_EXEC_STATUS
278278
desc: "An event in the provided wait list has $X_EVENT_STATUS_ERROR."
279+
- name: ERROR_DEVICE_NOT_AVAILABLE
280+
desc: "Device in question has `$X_DEVICE_INFO_AVAILABLE == false`"
279281
- name: ERROR_UNKNOWN
280282
value: "0x7ffffffe"
281283
desc: "Unknown or internal error"

source/adapters/opencl/common.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,8 @@ ur_result_t mapCLErrorToUR(cl_int Result) {
8383
return UR_RESULT_ERROR_INVALID_COMMAND_BUFFER_SYNC_POINT_WAIT_LIST_EXP;
8484
case CL_EXEC_STATUS_ERROR_FOR_EVENTS_IN_WAIT_LIST:
8585
return UR_RESULT_ERROR_IN_EVENT_LIST_EXEC_STATUS;
86+
case CL_DEVICE_NOT_AVAILABLE:
87+
return UR_RESULT_ERROR_DEVICE_NOT_AVAILABLE;
8688
default:
8789
return UR_RESULT_ERROR_UNKNOWN;
8890
}

0 commit comments

Comments
 (0)