Skip to content

Commit b04b1c0

Browse files
committed
renamed mutexes to match with cache name
Signed-off-by: Byoungro So <[email protected]>
1 parent fabf4f2 commit b04b1c0

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

sycl/plugins/level_zero/pi_level_zero.cpp

+4-4
Original file line numberDiff line numberDiff line change
@@ -462,7 +462,7 @@ pi_result piPlatformsGet(pi_uint32 NumEntries, pi_platform *Platforms,
462462
}
463463

464464
static std::vector<pi_platform> PiPlatformsCache;
465-
static std::mutex PlatformsCacheMutex;
465+
static std::mutex PiPlatformsCacheMutex;
466466

467467
// This is a good time to initialize Level Zero.
468468
// TODO: We can still safely recover if something goes wrong during the init.
@@ -498,7 +498,7 @@ pi_result piPlatformsGet(pi_uint32 NumEntries, pi_platform *Platforms,
498498
assert(ZeDriverCount == 1);
499499
ZE_CALL(zeDriverGet(&ZeDriverCount, &ZeDriver));
500500

501-
std::lock_guard<std::mutex> Lock(PlatformsCacheMutex);
501+
std::lock_guard<std::mutex> Lock(PiPlatformsCacheMutex);
502502
for (const pi_platform CachedPlatform : PiPlatformsCache) {
503503
if (CachedPlatform->ZeDriver == ZeDriver) {
504504
Platforms[0] = CachedPlatform;
@@ -631,7 +631,7 @@ pi_result piDevicesGet(pi_platform Platform, pi_device_type DeviceType,
631631

632632
// Get number of devices supporting Level Zero
633633
uint32_t ZeDeviceCount = 0;
634-
std::lock_guard<std::mutex> Lock(Platform->DeviceCacheMutex);
634+
std::lock_guard<std::mutex> Lock(Platform->PiDevicesCacheMutex);
635635
if (Platform->CacheInvalidated) {
636636
for (const pi_device CachedDevice : Platform->PiDevicesCache) {
637637
CachedDevice->initialize();
@@ -709,7 +709,7 @@ pi_result piDeviceRelease(pi_device Device) {
709709
// but when would we free the device's data?
710710
if (--(Device->RefCount) == 0) {
711711
pi_platform Platform = Device->Platform;
712-
std::lock_guard<std::mutex> Lock(Platform->DeviceCacheMutex);
712+
std::lock_guard<std::mutex> Lock(Platform->PiDevicesCacheMutex);
713713
Platform->CacheInvalidated = true;
714714
}
715715

sycl/plugins/level_zero/pi_level_zero.hpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ struct _pi_platform {
7373

7474
// Cache pi_devices for reuse
7575
std::vector<pi_device> PiDevicesCache;
76-
std::mutex DeviceCacheMutex;
76+
std::mutex PiDevicesCacheMutex;
7777
// Flag to indicate PiDevicesCache is invalidated
7878
bool CacheInvalidated = false;
7979
};

0 commit comments

Comments
 (0)