@@ -590,7 +590,12 @@ ur_event_handle_t
590
590
ur_context_handle_t_::getEventFromContextCache (v2::event_flags_t Flags,
591
591
ur_device_handle_t Device) {
592
592
std::scoped_lock<ur_mutex> Lock (EventCacheMutex);
593
- auto Cache = getEventCache (Flags, Device);
593
+
594
+ auto Cache = getEventCache (Flags & v2::EVENT_FLAGS_HOST_VISIBLE,
595
+ Flags & v2::EVENT_FLAGS_PROFILING_ENABLED, Device,
596
+ Flags & v2::EVENT_FLAGS_COUNTER,
597
+ Flags & v2::EVENT_FLAGS_INTERRUPT);
598
+
594
599
if (Cache->empty ()) {
595
600
logger::info (" Cache empty (Host Visible: {}, Profiling: {}, Counter: {}, "
596
601
" Interrupt: {}, Device: {})" ,
@@ -625,16 +630,9 @@ void ur_context_handle_t_::addEventToContextCache(ur_event_handle_t Event) {
625
630
Device = Event->UrQueue ->Device ;
626
631
}
627
632
628
- v2::event_flags_t Flags = 0 ;
629
- if (Event->HostVisibleEvent )
630
- Flags |= v2::EVENT_FLAGS_HOST_VISIBLE;
631
- if (Event->isProfilingEnabled ())
632
- Flags |= v2::EVENT_FLAGS_PROFILING_ENABLED;
633
- if (Event->CounterBasedEventsEnabled )
634
- Flags |= v2::EVENT_FLAGS_COUNTER;
635
- if (Event->InterruptBasedEventsEnabled )
636
- Flags |= v2::EVENT_FLAGS_INTERRUPT;
637
- auto Cache = getEventCache (Flags, Device);
633
+ auto Cache = getEventCache (
634
+ Event->HostVisibleEvent , Event->isProfilingEnabled (), Device,
635
+ Event->CounterBasedEventsEnabled , Event->InterruptBasedEventsEnabled );
638
636
logger::info (" Inserting {} event (Host Visible: {}, Profiling: {}, Counter: "
639
637
" {}, Device: {}) into cache {}" ,
640
638
Event, Event->HostVisibleEvent , Event->isProfilingEnabled (),
0 commit comments