@@ -165,10 +165,16 @@ UR_APIEXPORT ur_result_t UR_APICALL urEnqueueEventsWaitWithBarrier(
165
165
// event signal because it is already guaranteed that previous commands
166
166
// in this queue are completed when the signal is started.
167
167
//
168
+ // Only consideration here is that when profiling is used, signalEvent
169
+ // cannot be used if EventWaitList.Lenght == 0. In those cases, we need
170
+ // to fallback directly to barrier to have correct timestamps. See here:
171
+ // https://spec.oneapi.io/level-zero/latest/core/api.html?highlight=appendsignalevent#_CPPv430zeCommandListAppendSignalEvent24ze_command_list_handle_t17ze_event_handle_t
172
+ //
168
173
// TODO: this and other special handling of in-order queues to be
169
174
// updated when/if Level Zero adds native support for in-order queues.
170
175
//
171
- if (Queue->isInOrderQueue () && InOrderBarrierBySignal) {
176
+ if (Queue->isInOrderQueue () && InOrderBarrierBySignal &&
177
+ !Queue->isProfilingEnabled ()) {
172
178
if (EventWaitList.Length ) {
173
179
ZE2UR_CALL (zeCommandListAppendWaitOnEvents,
174
180
(CmdList->first , EventWaitList.Length ,
@@ -181,6 +187,7 @@ UR_APIEXPORT ur_result_t UR_APICALL urEnqueueEventsWaitWithBarrier(
181
187
(CmdList->first , Event->ZeEvent , EventWaitList.Length ,
182
188
EventWaitList.ZeEventList ));
183
189
}
190
+
184
191
return UR_RESULT_SUCCESS;
185
192
};
186
193
@@ -964,8 +971,7 @@ ur_result_t CleanupCompletedEvent(ur_event_handle_t Event, bool QueueLocked,
964
971
ur_result_t EventCreate (ur_context_handle_t Context, ur_queue_handle_t Queue,
965
972
bool HostVisible, ur_event_handle_t *RetEvent) {
966
973
967
- bool ProfilingEnabled =
968
- !Queue || (Queue->Properties & UR_QUEUE_FLAG_PROFILING_ENABLE) != 0 ;
974
+ bool ProfilingEnabled = !Queue || Queue->isProfilingEnabled ();
969
975
970
976
if (auto CachedEvent =
971
977
Context->getEventFromContextCache (HostVisible, ProfilingEnabled)) {
0 commit comments