Skip to content

Commit

Permalink
Merge pull request #1619 from npmiller/fix-timestamp-val
Browse files Browse the repository at this point in the history
Fix validation for urEnqueueTimestampRecordingExpTest
  • Loading branch information
kbenzie authored May 22, 2024
2 parents 2d71c76 + 75476b5 commit 719bb9c
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 1 deletion.
2 changes: 2 additions & 0 deletions include/ur_api.h
Original file line number Diff line number Diff line change
Expand Up @@ -8910,6 +8910,8 @@ urKernelSuggestMaxCooperativeGroupCountExp(
/// - ::UR_RESULT_ERROR_INVALID_NULL_POINTER
/// + `NULL == phEvent`
/// - ::UR_RESULT_ERROR_INVALID_EVENT_WAIT_LIST
/// + `phEventWaitList == NULL && numEventsInWaitList > 0`
/// + `phEventWaitList != NULL && numEventsInWaitList == 0`
UR_APIEXPORT ur_result_t UR_APICALL
urEnqueueTimestampRecordingExp(
ur_queue_handle_t hQueue, ///< [in] handle of the queue object
Expand Down
4 changes: 3 additions & 1 deletion scripts/core/exp-enqueue-timestamp-recording.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,4 +63,6 @@ params:
returns:
- $X_RESULT_ERROR_INVALID_NULL_HANDLE
- $X_RESULT_ERROR_INVALID_NULL_POINTER
- $X_RESULT_ERROR_INVALID_EVENT_WAIT_LIST
- $X_RESULT_ERROR_INVALID_EVENT_WAIT_LIST:
- "`phEventWaitList == NULL && numEventsInWaitList > 0`"
- "`phEventWaitList != NULL && numEventsInWaitList == 0`"
8 changes: 8 additions & 0 deletions source/loader/layers/validation/ur_valddi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8965,6 +8965,14 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueTimestampRecordingExp(
return UR_RESULT_ERROR_INVALID_NULL_POINTER;
}

if (phEventWaitList == NULL && numEventsInWaitList > 0) {
return UR_RESULT_ERROR_INVALID_EVENT_WAIT_LIST;
}

if (phEventWaitList != NULL && numEventsInWaitList == 0) {
return UR_RESULT_ERROR_INVALID_EVENT_WAIT_LIST;
}

if (phEventWaitList != NULL && numEventsInWaitList > 0) {
for (uint32_t i = 0; i < numEventsInWaitList; ++i) {
if (phEventWaitList[i] == NULL) {
Expand Down
2 changes: 2 additions & 0 deletions source/loader/ur_libapi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8324,6 +8324,8 @@ ur_result_t UR_APICALL urKernelSuggestMaxCooperativeGroupCountExp(
/// - ::UR_RESULT_ERROR_INVALID_NULL_POINTER
/// + `NULL == phEvent`
/// - ::UR_RESULT_ERROR_INVALID_EVENT_WAIT_LIST
/// + `phEventWaitList == NULL && numEventsInWaitList > 0`
/// + `phEventWaitList != NULL && numEventsInWaitList == 0`
ur_result_t UR_APICALL urEnqueueTimestampRecordingExp(
ur_queue_handle_t hQueue, ///< [in] handle of the queue object
bool
Expand Down
2 changes: 2 additions & 0 deletions source/ur_api.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7043,6 +7043,8 @@ ur_result_t UR_APICALL urKernelSuggestMaxCooperativeGroupCountExp(
/// - ::UR_RESULT_ERROR_INVALID_NULL_POINTER
/// + `NULL == phEvent`
/// - ::UR_RESULT_ERROR_INVALID_EVENT_WAIT_LIST
/// + `phEventWaitList == NULL && numEventsInWaitList > 0`
/// + `phEventWaitList != NULL && numEventsInWaitList == 0`
ur_result_t UR_APICALL urEnqueueTimestampRecordingExp(
ur_queue_handle_t hQueue, ///< [in] handle of the queue object
bool
Expand Down

0 comments on commit 719bb9c

Please sign in to comment.