Skip to content

Commit

Permalink
[L0] Rebased against top of tree instead of CB events patch
Browse files Browse the repository at this point in the history
Signed-off-by: Winston Zhang <[email protected]>
  • Loading branch information
winstonzhang-intel committed Nov 5, 2024
1 parent 6582a8a commit e10fb9b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 38 deletions.
12 changes: 2 additions & 10 deletions source/adapters/level_zero/context.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -561,9 +561,6 @@ ur_context_handle_t_::getEventFromContextCache(ur_event_flags_t Flags,
ur_device_handle_t Device) {
std::scoped_lock<ur_mutex> Lock(EventCacheMutex);
auto Cache = getEventCache(Flags, Device);
if (Flags & COUNTER_BASED) {
Cache = getCounterBasedEventCache(Flags, Device);
}
if (Cache->empty())
return nullptr;

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

if (Event->CounterBasedEventsEnabled) {
auto Cache = getCounterBasedEventCache(Flags, Device);
Cache->emplace_back(Event);
} else {
auto Cache = getEventCache(Flags, Device);
Cache->emplace_back(Event);
}
auto Cache = getEventCache(Flags, Device);
Cache->emplace_back(Event);
}

ur_result_t
Expand Down
28 changes: 0 additions & 28 deletions source/adapters/level_zero/context.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -325,34 +325,6 @@ struct ur_context_handle_t_ : _ur_object {
}
}
};
auto getCounterBasedEventCache(ur_event_flags_t Flags,
ur_device_handle_t Device) {
if (Flags & USING_IMM_CMDLIST) {
if (Device) {
auto EventCachesMap =
(Flags & ENABLE_PROFILER)
? &EventCachesDeviceMap[CounterBasedImmediateProfilingCacheType]
: &EventCachesDeviceMap[CounterBasedImmediateCacheType];
return &EventCaches[(*EventCachesMap)[Device]];
} else {
return (Flags & ENABLE_PROFILER)
? &EventCaches[CounterBasedImmediateProfilingCacheType]
: &EventCaches[CounterBasedImmediateCacheType];
}
} else {
if (Device) {
auto EventCachesMap =
(Flags & ENABLE_PROFILER)
? &EventCachesDeviceMap[CounterBasedRegularProfilingCacheType]
: &EventCachesDeviceMap[CounterBasedRegularCacheType];
return &EventCaches[(*EventCachesMap)[Device]];
} else {
return (Flags & ENABLE_PROFILER)
? &EventCaches[CounterBasedRegularProfilingCacheType]
: &EventCaches[CounterBasedRegularCacheType];
}
}
}
};

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

0 comments on commit e10fb9b

Please sign in to comment.