Skip to content

Commit 38b0489

Browse files
[L0] Fixed parameters for ur_event_flag_t
Signed-off-by: Winston Zhang <[email protected]>
1 parent 7b478ae commit 38b0489

File tree

4 files changed

+10
-10
lines changed

4 files changed

+10
-10
lines changed

source/adapters/level_zero/context.cpp

+4-4
Original file line numberDiff line numberDiff line change
@@ -470,7 +470,7 @@ static const uint32_t MaxNumEventsPerPool = [] {
470470
}();
471471

472472
ur_result_t ur_context_handle_t_::getFreeSlotInExistingOrNewPool(
473-
ze_event_pool_handle_t &Pool, size_t &Index, enum ur_event_flag_t Flags,
473+
ze_event_pool_handle_t &Pool, size_t &Index, ur_event_flags_t Flags,
474474
ur_device_handle_t Device) {
475475
// Lock while updating event pool machinery.
476476
std::scoped_lock<ur_mutex> Lock(ZeEventPoolCacheMutex);
@@ -552,7 +552,7 @@ ur_result_t ur_context_handle_t_::getFreeSlotInExistingOrNewPool(
552552
}
553553

554554
ur_event_handle_t
555-
ur_context_handle_t_::getEventFromContextCache(enum ur_event_flag_t Flags,
555+
ur_context_handle_t_::getEventFromContextCache(ur_event_flags_t Flags,
556556
ur_device_handle_t Device) {
557557
std::scoped_lock<ur_mutex> Lock(EventCacheMutex);
558558
auto Cache = getEventCache(Flags, Device);
@@ -578,7 +578,7 @@ void ur_context_handle_t_::addEventToContextCache(ur_event_handle_t Event) {
578578
Device = Legacy(Event->UrQueue)->Device;
579579
}
580580

581-
enum ur_event_flag_t Flags = static_cast<enum ur_event_flag_t>(
581+
ur_event_flags_t Flags = static_cast<ur_event_flags_t>(
582582
Event->isHostVisible() ? HOST_VISIBLE
583583
: 0 | Event->isProfilingEnabled() ? ENABLE_PROFILER
584584
: 0);
@@ -605,7 +605,7 @@ ur_context_handle_t_::decrementUnreleasedEventsInPool(ur_event_handle_t Event) {
605605
ZeDevice = Legacy(Event->UrQueue)->Device->ZeDevice;
606606
}
607607

608-
enum ur_event_flag_t Flags = static_cast<enum ur_event_flag_t>(
608+
ur_event_flags_t Flags = static_cast<ur_event_flags_t>(
609609
Event->isHostVisible() ? HOST_VISIBLE
610610
: 0 | Event->isProfilingEnabled() ? ENABLE_PROFILER
611611
: 0 | Event->CounterBasedEventsEnabled ? COUNTER_BASED

source/adapters/level_zero/context.hpp

+4-4
Original file line numberDiff line numberDiff line change
@@ -198,11 +198,11 @@ struct ur_context_handle_t_ : _ur_object {
198198
// slot for a host-visible event. The ProfilingEnabled tells is we need a
199199
// slot for an event with profiling capabilities.
200200
ur_result_t getFreeSlotInExistingOrNewPool(ze_event_pool_handle_t &, size_t &,
201-
enum ur_event_flag_t Flags,
201+
ur_event_flags_t Flags,
202202
ur_device_handle_t Device);
203203

204204
// Get ur_event_handle_t from cache.
205-
ur_event_handle_t getEventFromContextCache(enum ur_event_flag_t Flags,
205+
ur_event_handle_t getEventFromContextCache(ur_event_flags_t Flags,
206206
ur_device_handle_t Device);
207207

208208
// Add ur_event_handle_t to cache.
@@ -218,7 +218,7 @@ struct ur_context_handle_t_ : _ur_object {
218218
};
219219

220220
std::list<ze_event_pool_handle_t> *
221-
getZeEventPoolCache(enum ur_event_flag_t Flags, ze_device_handle_t ZeDevice) {
221+
getZeEventPoolCache(ur_event_flags_t Flags, ze_device_handle_t ZeDevice) {
222222
Flags = static_cast<ur_event_flag_t>(Flags & ~MULTIDEVICE);
223223
if (ZeDevice) {
224224
auto ZeEventPoolCacheMap =
@@ -270,7 +270,7 @@ struct ur_context_handle_t_ : _ur_object {
270270

271271
private:
272272
// Get the cache of events for a provided scope and profiling mode.
273-
auto getEventCache(enum ur_event_flag_t Flags, ur_device_handle_t Device) {
273+
auto getEventCache(ur_event_flags_t Flags, ur_device_handle_t Device) {
274274
if (Flags & HOST_VISIBLE) {
275275
if (Device) {
276276
auto EventCachesMap = Flags & ENABLE_PROFILER

source/adapters/level_zero/event.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -1236,7 +1236,7 @@ ur_result_t EventCreate(ur_context_handle_t Context,
12361236
bool ProfilingEnabled =
12371237
ForceDisableProfiling ? false : (!Queue || Queue->isProfilingEnabled());
12381238
bool UsingImmediateCommandlists = !Queue || Queue->UsingImmCmdLists;
1239-
enum ur_event_flag_t Flags = static_cast<enum ur_event_flag_t>(
1239+
ur_event_flags_t Flags = static_cast<ur_event_flags_t>(
12401240
ProfilingEnabled ? ENABLE_PROFILER
12411241
: 0 | UsingImmediateCommandlists ? USING_IMM_CMDLIST
12421242
: 0 | HostVisible ? HOST_VISIBLE

source/adapters/level_zero/event.hpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ struct ur_event_handle_t_ : _ur_object {
132132
OwnNativeHandle = OwnZeEvent;
133133
}
134134

135-
enum ur_event_flag_t flags;
135+
ur_event_flags_t flags;
136136
// Level Zero event handle.
137137
ze_event_handle_t ZeEvent;
138138

0 commit comments

Comments
 (0)