Skip to content

Commit 51ce97a

Browse files
[L0] better naming for enums
Signed-off-by: Winston Zhang <winston.zhang@intel.com>
1 parent 32f5071 commit 51ce97a

File tree

1 file changed

+12
-11
lines changed

1 file changed

+12
-11
lines changed

source/adapters/level_zero/context.hpp

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ struct ur_context_handle_t_ : _ur_object {
217217
// Add ur_event_handle_t to cache.
218218
void addEventToContextCache(ur_event_handle_t);
219219

220-
enum EventPoolCacheType {
220+
enum ZeEventPoolCacheType {
221221
HostVisibleCacheType,
222222
HostInvisibleCacheType,
223223
HostVisibleCounterBasedRegularCacheType,
@@ -226,11 +226,20 @@ struct ur_context_handle_t_ : _ur_object {
226226
HostInvisibleCounterBasedImmediateCacheType
227227
};
228228

229+
enum EventCacheType {
230+
HostVisibleProfilingCacheType,
231+
HostVisibleRegularCacheType,
232+
HostInvisibleProfilingCacheType,
233+
HostInvisibleRegularCacheType,
234+
CounterBasedImmediateCacheType,
235+
CounterBasedRegularCacheType
236+
};
237+
229238
std::list<ze_event_pool_handle_t> *
230239
getZeEventPoolCache(bool HostVisible, bool WithProfiling,
231240
bool CounterBasedEventEnabled, bool UsingImmediateCmdList,
232241
ze_device_handle_t ZeDevice) {
233-
EventPoolCacheType CacheType;
242+
ZeEventPoolCacheType CacheType;
234243

235244
calculateCacheIndex(HostVisible, CounterBasedEventEnabled,
236245
UsingImmediateCmdList, CacheType);
@@ -253,7 +262,7 @@ struct ur_context_handle_t_ : _ur_object {
253262
ur_result_t calculateCacheIndex(bool HostVisible,
254263
bool CounterBasedEventEnabled,
255264
bool UsingImmediateCmdList,
256-
EventPoolCacheType &CacheType) {
265+
ZeEventPoolCacheType &CacheType) {
257266
if (CounterBasedEventEnabled && HostVisible && !UsingImmediateCmdList) {
258267
CacheType = HostVisibleCounterBasedRegularCacheType;
259268
} else if (CounterBasedEventEnabled && !HostVisible &&
@@ -311,14 +320,6 @@ struct ur_context_handle_t_ : _ur_object {
311320
ze_context_handle_t getZeHandle() const;
312321

313322
private:
314-
enum EventCacheType {
315-
HostVisibleProfilingCacheType,
316-
HostVisibleRegularCacheType,
317-
HostInvisibleProfilingCacheType,
318-
HostInvisibleRegularCacheType,
319-
CounterBasedRegularCacheType,
320-
CounterBasedImmediateCacheType
321-
};
322323
// Get the cache of events for a provided scope and profiling mode.
323324
auto getEventCache(bool HostVisible, bool WithProfiling,
324325
ur_device_handle_t Device) {

0 commit comments

Comments
 (0)