Skip to content

Commit 957625e

Browse files
committed
Add UR_PROFILING_INFO_COMMAND_COMPLETE to ur_profling_info_t.
1 parent 86b4cd6 commit 957625e

File tree

7 files changed

+38
-12
lines changed

7 files changed

+38
-12
lines changed

include/ur.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1652,6 +1652,9 @@ class ur_profiling_info_v(IntEnum):
16521652
## when the event starts execution
16531653
COMMAND_END = 3 ## [uint64_t] A 64-bit value of current device counter in nanoseconds
16541654
## when the event has finished execution
1655+
COMMAND_COMPLETE = 4 ## [uint64_t] A 64-bit value of current device counter in nanoseconds
1656+
## when the event and any child events enqueued by this event on the
1657+
## device have finished execution
16551658

16561659
class ur_profiling_info_t(c_int):
16571660
def __str__(self):

include/ur_api.h

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4369,14 +4369,17 @@ typedef enum ur_event_info_t {
43694369
///////////////////////////////////////////////////////////////////////////////
43704370
/// @brief Profiling query information type
43714371
typedef enum ur_profiling_info_t {
4372-
UR_PROFILING_INFO_COMMAND_QUEUED = 0, ///< [uint64_t] A 64-bit value of current device counter in nanoseconds
4373-
///< when the event is enqueued
4374-
UR_PROFILING_INFO_COMMAND_SUBMIT = 1, ///< [uint64_t] A 64-bit value of current device counter in nanoseconds
4375-
///< when the event is submitted
4376-
UR_PROFILING_INFO_COMMAND_START = 2, ///< [uint64_t] A 64-bit value of current device counter in nanoseconds
4377-
///< when the event starts execution
4378-
UR_PROFILING_INFO_COMMAND_END = 3, ///< [uint64_t] A 64-bit value of current device counter in nanoseconds
4379-
///< when the event has finished execution
4372+
UR_PROFILING_INFO_COMMAND_QUEUED = 0, ///< [uint64_t] A 64-bit value of current device counter in nanoseconds
4373+
///< when the event is enqueued
4374+
UR_PROFILING_INFO_COMMAND_SUBMIT = 1, ///< [uint64_t] A 64-bit value of current device counter in nanoseconds
4375+
///< when the event is submitted
4376+
UR_PROFILING_INFO_COMMAND_START = 2, ///< [uint64_t] A 64-bit value of current device counter in nanoseconds
4377+
///< when the event starts execution
4378+
UR_PROFILING_INFO_COMMAND_END = 3, ///< [uint64_t] A 64-bit value of current device counter in nanoseconds
4379+
///< when the event has finished execution
4380+
UR_PROFILING_INFO_COMMAND_COMPLETE = 4, ///< [uint64_t] A 64-bit value of current device counter in nanoseconds
4381+
///< when the event and any child events enqueued by this event on the
4382+
///< device have finished execution
43804383
/// @cond
43814384
UR_PROFILING_INFO_FORCE_UINT32 = 0x7fffffff
43824385
/// @endcond
@@ -4434,7 +4437,7 @@ urEventGetInfo(
44344437
/// - ::UR_RESULT_ERROR_INVALID_NULL_HANDLE
44354438
/// + `NULL == hEvent`
44364439
/// - ::UR_RESULT_ERROR_INVALID_ENUMERATION
4437-
/// + `::UR_PROFILING_INFO_COMMAND_END < propName`
4440+
/// + `::UR_PROFILING_INFO_COMMAND_COMPLETE < propName`
44384441
/// - ::UR_RESULT_ERROR_INVALID_VALUE
44394442
/// + `pPropValue && propSize == 0`
44404443
/// - ::UR_RESULT_ERROR_INVALID_EVENT

scripts/core/event.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,8 @@ etors:
122122
desc: "[uint64_t] A 64-bit value of current device counter in nanoseconds when the event starts execution"
123123
- name: COMMAND_END
124124
desc: "[uint64_t] A 64-bit value of current device counter in nanoseconds when the event has finished execution"
125+
- name: COMMAND_COMPLETE
126+
desc: "[uint64_t] A 64-bit value of current device counter in nanoseconds when the event and any child events enqueued by this event on the device have finished execution"
125127
--- #--------------------------------------------------------------------------
126128
type: function
127129
desc: "Get event object information"

source/common/ur_params.hpp

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7542,6 +7542,10 @@ inline std::ostream &operator<<(std::ostream &os,
75427542
case UR_PROFILING_INFO_COMMAND_END:
75437543
os << "UR_PROFILING_INFO_COMMAND_END";
75447544
break;
7545+
7546+
case UR_PROFILING_INFO_COMMAND_COMPLETE:
7547+
os << "UR_PROFILING_INFO_COMMAND_COMPLETE";
7548+
break;
75457549
default:
75467550
os << "unknown enumerator";
75477551
break;
@@ -7614,6 +7618,20 @@ inline void serializeTagged(std::ostream &os, const void *ptr,
76147618

76157619
os << ")";
76167620
} break;
7621+
7622+
case UR_PROFILING_INFO_COMMAND_COMPLETE: {
7623+
const uint64_t *tptr = (const uint64_t *)ptr;
7624+
if (sizeof(uint64_t) > size) {
7625+
os << "invalid size (is: " << size
7626+
<< ", expected: >=" << sizeof(uint64_t) << ")";
7627+
return;
7628+
}
7629+
os << (void *)(tptr) << " (";
7630+
7631+
os << *tptr;
7632+
7633+
os << ")";
7634+
} break;
76177635
default:
76187636
os << "unknown enumerator";
76197637
break;

source/loader/layers/validation/ur_valddi.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3186,7 +3186,7 @@ __urdlllocal ur_result_t UR_APICALL urEventGetProfilingInfo(
31863186
return UR_RESULT_ERROR_INVALID_NULL_HANDLE;
31873187
}
31883188

3189-
if (UR_PROFILING_INFO_COMMAND_END < propName) {
3189+
if (UR_PROFILING_INFO_COMMAND_COMPLETE < propName) {
31903190
return UR_RESULT_ERROR_INVALID_ENUMERATION;
31913191
}
31923192

source/loader/ur_libapi.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3525,7 +3525,7 @@ ur_result_t UR_APICALL urEventGetInfo(
35253525
/// - ::UR_RESULT_ERROR_INVALID_NULL_HANDLE
35263526
/// + `NULL == hEvent`
35273527
/// - ::UR_RESULT_ERROR_INVALID_ENUMERATION
3528-
/// + `::UR_PROFILING_INFO_COMMAND_END < propName`
3528+
/// + `::UR_PROFILING_INFO_COMMAND_COMPLETE < propName`
35293529
/// - ::UR_RESULT_ERROR_INVALID_VALUE
35303530
/// + `pPropValue && propSize == 0`
35313531
/// - ::UR_RESULT_ERROR_INVALID_EVENT

source/ur_api.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2946,7 +2946,7 @@ ur_result_t UR_APICALL urEventGetInfo(
29462946
/// - ::UR_RESULT_ERROR_INVALID_NULL_HANDLE
29472947
/// + `NULL == hEvent`
29482948
/// - ::UR_RESULT_ERROR_INVALID_ENUMERATION
2949-
/// + `::UR_PROFILING_INFO_COMMAND_END < propName`
2949+
/// + `::UR_PROFILING_INFO_COMMAND_COMPLETE < propName`
29502950
/// - ::UR_RESULT_ERROR_INVALID_VALUE
29512951
/// + `pPropValue && propSize == 0`
29522952
/// - ::UR_RESULT_ERROR_INVALID_EVENT

0 commit comments

Comments
 (0)