@@ -147,9 +147,10 @@ struct ur_context_handle_t_ : _ur_object {
147
147
// head.
148
148
//
149
149
// Cache of event pools to which host-visible events are added to.
150
- std::vector<std::list<ze_event_pool_handle_t >> ZeEventPoolCache{12 };
150
+ std::vector<std::list<ze_event_pool_handle_t >> ZeEventPoolCache{
151
+ ZeEventPoolCacheTypeCount * 2 };
151
152
std::vector<std::unordered_map<ze_device_handle_t , size_t >>
152
- ZeEventPoolCacheDeviceMap{12 };
153
+ ZeEventPoolCacheDeviceMap{ZeEventPoolCacheTypeCount * 2 };
153
154
154
155
// This map will be used to determine if a pool is full or not
155
156
// by storing number of empty slots available in the pool.
@@ -171,9 +172,9 @@ struct ur_context_handle_t_ : _ur_object {
171
172
172
173
// Caches for events.
173
174
using EventCache = std::vector<std::list<ur_event_handle_t >>;
174
- EventCache EventCaches{6 };
175
+ EventCache EventCaches{EventCacheTypeCount };
175
176
std::vector<std::unordered_map<ur_device_handle_t , size_t >>
176
- EventCachesDeviceMap{6 };
177
+ EventCachesDeviceMap{EventCacheTypeCount };
177
178
178
179
// Initialize the PI context.
179
180
ur_result_t initialize ();
@@ -223,7 +224,8 @@ struct ur_context_handle_t_ : _ur_object {
223
224
HostVisibleCounterBasedRegularCacheType,
224
225
HostInvisibleCounterBasedRegularCacheType,
225
226
HostVisibleCounterBasedImmediateCacheType,
226
- HostInvisibleCounterBasedImmediateCacheType
227
+ HostInvisibleCounterBasedImmediateCacheType,
228
+ ZeEventPoolCacheTypeCount
227
229
};
228
230
229
231
enum EventCacheType {
@@ -232,7 +234,8 @@ struct ur_context_handle_t_ : _ur_object {
232
234
HostInvisibleProfilingCacheType,
233
235
HostInvisibleRegularCacheType,
234
236
CounterBasedImmediateCacheType,
235
- CounterBasedRegularCacheType
237
+ CounterBasedRegularCacheType,
238
+ EventCacheTypeCount
236
239
};
237
240
238
241
std::list<ze_event_pool_handle_t > *
0 commit comments