Skip to content

Commit 07cae8d

Browse files
[L0] Fixed a few syntax and scope errors
Signed-off-by: Winston Zhang <winston.zhang@intel.com>
1 parent 854cb87 commit 07cae8d

File tree

3 files changed

+14
-12
lines changed

3 files changed

+14
-12
lines changed

source/adapters/level_zero/context.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -589,7 +589,7 @@ void ur_context_handle_t_::addEventToContextCache(ur_event_handle_t Event) {
589589
Device = Event->UrQueue->Device;
590590
}
591591

592-
if (!Event->CounterBasedEventsEnabled) {
592+
if (Event->CounterBasedEventsEnabled) {
593593
auto Cache = getCounterBasedEventCache(
594594
!Event->UrQueue || Event->UrQueue->UsingImmCmdLists, Device);
595595
Cache->emplace_back(Event);

source/adapters/level_zero/context.hpp

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -208,10 +208,11 @@ struct ur_context_handle_t_ : _ur_object {
208208
bool UsingImmCmdList);
209209

210210
// Get ur_event_handle_t from cache.
211-
ur_event_handle_t
212-
getEventFromContextCache(bool HostVisible, bool WithProfiling,
213-
ur_device_handle_t Device,
214-
bool CounterBasedEventEnabled bool UsingImmCmdList);
211+
ur_event_handle_t getEventFromContextCache(bool HostVisible,
212+
bool WithProfiling,
213+
ur_device_handle_t Device,
214+
bool CounterBasedEventEnabled,
215+
bool UsingImmCmdList);
215216

216217
// Add ur_event_handle_t to cache.
217218
void addEventToContextCache(ur_event_handle_t);
@@ -340,7 +341,7 @@ struct ur_context_handle_t_ : _ur_object {
340341
return WithProfiling ? &EventCaches[2] : &EventCaches[3];
341342
}
342343
}
343-
}
344+
};
344345
auto getCounterBasedEventCache(bool UsingImmediateCmdList,
345346
ur_device_handle_t Device) {
346347
if (UsingImmediateCmdList) {
@@ -368,9 +369,10 @@ struct ur_context_handle_t_ : _ur_object {
368369
return &EventCaches[5];
369370
}
370371
}
371-
};
372+
}
373+
};
372374

373-
// Helper function to release the context, a caller must lock the
374-
// platform-level mutex guarding the container with contexts because the
375-
// context can be removed from the list of tracked contexts.
376-
ur_result_t ContextReleaseHelper(ur_context_handle_t Context);
375+
// Helper function to release the context, a caller must lock the
376+
// platform-level mutex guarding the container with contexts because the
377+
// context can be removed from the list of tracked contexts.
378+
ur_result_t ContextReleaseHelper(ur_context_handle_t Context);

source/adapters/level_zero/event.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -998,7 +998,7 @@ ur_result_t ur_event_handle_t_::getOrCreateHostVisibleEvent(
998998
}
999999

10001000
ur_result_t urEventReleaseInternal(ur_event_handle_t Event) {
1001-
if (!Event->CounterBasedEventsEnabled && !Event->RefCount.decrementAndTest())
1001+
if (!Event->RefCount.decrementAndTest())
10021002
return UR_RESULT_SUCCESS;
10031003

10041004
if (Event->CommandType == UR_COMMAND_MEM_UNMAP && Event->CommandData) {

0 commit comments

Comments
 (0)