Skip to content

Commit e10fb9b

Browse files
[L0] Rebased against top of tree instead of CB events patch
Signed-off-by: Winston Zhang <[email protected]>
1 parent 6582a8a commit e10fb9b

File tree

2 files changed

+2
-38
lines changed

2 files changed

+2
-38
lines changed

source/adapters/level_zero/context.cpp

+2-10
Original file line numberDiff line numberDiff line change
@@ -561,9 +561,6 @@ ur_context_handle_t_::getEventFromContextCache(ur_event_flags_t Flags,
561561
ur_device_handle_t Device) {
562562
std::scoped_lock<ur_mutex> Lock(EventCacheMutex);
563563
auto Cache = getEventCache(Flags, Device);
564-
if (Flags & COUNTER_BASED) {
565-
Cache = getCounterBasedEventCache(Flags, Device);
566-
}
567564
if (Cache->empty())
568565
return nullptr;
569566

@@ -593,13 +590,8 @@ void ur_context_handle_t_::addEventToContextCache(ur_event_handle_t Event) {
593590
if (Event->isProfilingEnabled())
594591
Flags |= ENABLE_PROFILER;
595592

596-
if (Event->CounterBasedEventsEnabled) {
597-
auto Cache = getCounterBasedEventCache(Flags, Device);
598-
Cache->emplace_back(Event);
599-
} else {
600-
auto Cache = getEventCache(Flags, Device);
601-
Cache->emplace_back(Event);
602-
}
593+
auto Cache = getEventCache(Flags, Device);
594+
Cache->emplace_back(Event);
603595
}
604596

605597
ur_result_t

source/adapters/level_zero/context.hpp

-28
Original file line numberDiff line numberDiff line change
@@ -325,34 +325,6 @@ struct ur_context_handle_t_ : _ur_object {
325325
}
326326
}
327327
};
328-
auto getCounterBasedEventCache(ur_event_flags_t Flags,
329-
ur_device_handle_t Device) {
330-
if (Flags & USING_IMM_CMDLIST) {
331-
if (Device) {
332-
auto EventCachesMap =
333-
(Flags & ENABLE_PROFILER)
334-
? &EventCachesDeviceMap[CounterBasedImmediateProfilingCacheType]
335-
: &EventCachesDeviceMap[CounterBasedImmediateCacheType];
336-
return &EventCaches[(*EventCachesMap)[Device]];
337-
} else {
338-
return (Flags & ENABLE_PROFILER)
339-
? &EventCaches[CounterBasedImmediateProfilingCacheType]
340-
: &EventCaches[CounterBasedImmediateCacheType];
341-
}
342-
} else {
343-
if (Device) {
344-
auto EventCachesMap =
345-
(Flags & ENABLE_PROFILER)
346-
? &EventCachesDeviceMap[CounterBasedRegularProfilingCacheType]
347-
: &EventCachesDeviceMap[CounterBasedRegularCacheType];
348-
return &EventCaches[(*EventCachesMap)[Device]];
349-
} else {
350-
return (Flags & ENABLE_PROFILER)
351-
? &EventCaches[CounterBasedRegularProfilingCacheType]
352-
: &EventCaches[CounterBasedRegularCacheType];
353-
}
354-
}
355-
}
356328
};
357329

358330
// Helper function to release the context, a caller must lock the platform-level

0 commit comments

Comments
 (0)