@@ -596,7 +596,12 @@ ur_event_handle_t
596
596
ur_context_handle_t_::getEventFromContextCache (v2::event_flags_t Flags,
597
597
ur_device_handle_t Device) {
598
598
std::scoped_lock<ur_mutex> Lock (EventCacheMutex);
599
- auto Cache = getEventCache (Flags, Device);
599
+
600
+ auto Cache = getEventCache (Flags & v2::EVENT_FLAGS_HOST_VISIBLE,
601
+ Flags & v2::EVENT_FLAGS_PROFILING_ENABLED, Device,
602
+ Flags & v2::EVENT_FLAGS_COUNTER,
603
+ Flags & v2::EVENT_FLAGS_INTERRUPT);
604
+
600
605
if (Cache->empty ()) {
601
606
logger::info (" Cache empty (Host Visible: {}, Profiling: {}, Counter: {}, "
602
607
" Interrupt: {}, Device: {})" ,
@@ -631,16 +636,9 @@ void ur_context_handle_t_::addEventToContextCache(ur_event_handle_t Event) {
631
636
Device = Event->UrQueue ->Device ;
632
637
}
633
638
634
- v2::event_flags_t Flags = 0 ;
635
- if (Event->HostVisibleEvent )
636
- Flags |= v2::EVENT_FLAGS_HOST_VISIBLE;
637
- if (Event->isProfilingEnabled ())
638
- Flags |= v2::EVENT_FLAGS_PROFILING_ENABLED;
639
- if (Event->CounterBasedEventsEnabled )
640
- Flags |= v2::EVENT_FLAGS_COUNTER;
641
- if (Event->InterruptBasedEventsEnabled )
642
- Flags |= v2::EVENT_FLAGS_INTERRUPT;
643
- auto Cache = getEventCache (Flags, Device);
639
+ auto Cache = getEventCache (
640
+ Event->HostVisibleEvent , Event->isProfilingEnabled (), Device,
641
+ Event->CounterBasedEventsEnabled , Event->InterruptBasedEventsEnabled );
644
642
logger::info (" Inserting {} event (Host Visible: {}, Profiling: {}, Counter: "
645
643
" {}, Device: {}) into cache {}" ,
646
644
Event, Event->HostVisibleEvent , Event->isProfilingEnabled (),
0 commit comments