Skip to content

Commit 75476b5

Browse files
committed
Fix validation for urEnqueueTimestampRecordingExpTest
This was failing with the HIP adapter when the pointer is null and the event wait list is not 0.
1 parent 65c39c8 commit 75476b5

File tree

5 files changed

+17
-1
lines changed

5 files changed

+17
-1
lines changed

include/ur_api.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8914,6 +8914,8 @@ urKernelSuggestMaxCooperativeGroupCountExp(
89148914
/// - ::UR_RESULT_ERROR_INVALID_NULL_POINTER
89158915
/// + `NULL == phEvent`
89168916
/// - ::UR_RESULT_ERROR_INVALID_EVENT_WAIT_LIST
8917+
/// + `phEventWaitList == NULL && numEventsInWaitList > 0`
8918+
/// + `phEventWaitList != NULL && numEventsInWaitList == 0`
89178919
UR_APIEXPORT ur_result_t UR_APICALL
89188920
urEnqueueTimestampRecordingExp(
89198921
ur_queue_handle_t hQueue, ///< [in] handle of the queue object

scripts/core/exp-enqueue-timestamp-recording.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,4 +63,6 @@ params:
6363
returns:
6464
- $X_RESULT_ERROR_INVALID_NULL_HANDLE
6565
- $X_RESULT_ERROR_INVALID_NULL_POINTER
66-
- $X_RESULT_ERROR_INVALID_EVENT_WAIT_LIST
66+
- $X_RESULT_ERROR_INVALID_EVENT_WAIT_LIST:
67+
- "`phEventWaitList == NULL && numEventsInWaitList > 0`"
68+
- "`phEventWaitList != NULL && numEventsInWaitList == 0`"

source/loader/layers/validation/ur_valddi.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8975,6 +8975,14 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueTimestampRecordingExp(
89758975
return UR_RESULT_ERROR_INVALID_NULL_POINTER;
89768976
}
89778977

8978+
if (phEventWaitList == NULL && numEventsInWaitList > 0) {
8979+
return UR_RESULT_ERROR_INVALID_EVENT_WAIT_LIST;
8980+
}
8981+
8982+
if (phEventWaitList != NULL && numEventsInWaitList == 0) {
8983+
return UR_RESULT_ERROR_INVALID_EVENT_WAIT_LIST;
8984+
}
8985+
89788986
if (phEventWaitList != NULL && numEventsInWaitList > 0) {
89798987
for (uint32_t i = 0; i < numEventsInWaitList; ++i) {
89808988
if (phEventWaitList[i] == NULL) {

source/loader/ur_libapi.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8328,6 +8328,8 @@ ur_result_t UR_APICALL urKernelSuggestMaxCooperativeGroupCountExp(
83288328
/// - ::UR_RESULT_ERROR_INVALID_NULL_POINTER
83298329
/// + `NULL == phEvent`
83308330
/// - ::UR_RESULT_ERROR_INVALID_EVENT_WAIT_LIST
8331+
/// + `phEventWaitList == NULL && numEventsInWaitList > 0`
8332+
/// + `phEventWaitList != NULL && numEventsInWaitList == 0`
83318333
ur_result_t UR_APICALL urEnqueueTimestampRecordingExp(
83328334
ur_queue_handle_t hQueue, ///< [in] handle of the queue object
83338335
bool

source/ur_api.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7047,6 +7047,8 @@ ur_result_t UR_APICALL urKernelSuggestMaxCooperativeGroupCountExp(
70477047
/// - ::UR_RESULT_ERROR_INVALID_NULL_POINTER
70487048
/// + `NULL == phEvent`
70497049
/// - ::UR_RESULT_ERROR_INVALID_EVENT_WAIT_LIST
7050+
/// + `phEventWaitList == NULL && numEventsInWaitList > 0`
7051+
/// + `phEventWaitList != NULL && numEventsInWaitList == 0`
70507052
ur_result_t UR_APICALL urEnqueueTimestampRecordingExp(
70517053
ur_queue_handle_t hQueue, ///< [in] handle of the queue object
70527054
bool

0 commit comments

Comments
 (0)