File tree Expand file tree Collapse file tree 4 files changed +10
-7
lines changed Expand file tree Collapse file tree 4 files changed +10
-7
lines changed Original file line number Diff line number Diff line change @@ -52,7 +52,8 @@ ProgramManager &GlobalHandler::getProgramManager() {
52
52
53
53
Sync &GlobalHandler::getSync () { return getOrCreate (MSync); }
54
54
55
- std::map<PlatformImplPtr, std::vector<DeviceImplPtr>> &GlobalHandler::getPlatformDeviceCache () {
55
+ std::map<PlatformImplPtr, std::vector<DeviceImplPtr>> &
56
+ GlobalHandler::getPlatformDeviceCache () {
56
57
return getOrCreate (MPlatformDeviceCache);
57
58
}
58
59
Original file line number Diff line number Diff line change 11
11
#include < CL/sycl/detail/spinlock.hpp>
12
12
#include < CL/sycl/detail/util.hpp>
13
13
14
- #include < memory>
15
14
#include < map>
15
+ #include < memory>
16
16
17
17
__SYCL_INLINE_NAMESPACE (cl) {
18
18
namespace sycl {
@@ -54,7 +54,8 @@ class GlobalHandler {
54
54
Scheduler &getScheduler ();
55
55
ProgramManager &getProgramManager ();
56
56
Sync &getSync ();
57
- std::map<PlatformImplPtr, std::vector<DeviceImplPtr>> &getPlatformDeviceCache ();
57
+ std::map<PlatformImplPtr, std::vector<DeviceImplPtr>> &
58
+ getPlatformDeviceCache ();
58
59
std::mutex &getPlatformMapMutex ();
59
60
std::mutex &getFilterMutex ();
60
61
std::vector<plugin> &getPlugins ();
@@ -80,7 +81,8 @@ class GlobalHandler {
80
81
InstWithLock<Scheduler> MScheduler;
81
82
InstWithLock<ProgramManager> MProgramManager;
82
83
InstWithLock<Sync> MSync;
83
- InstWithLock<std::map<PlatformImplPtr, std::vector<DeviceImplPtr>>> MPlatformDeviceCache;
84
+ InstWithLock<std::map<PlatformImplPtr, std::vector<DeviceImplPtr>>>
85
+ MPlatformDeviceCache;
84
86
InstWithLock<std::mutex> MPlatformMapMutex;
85
87
InstWithLock<std::mutex> MFilterMutex;
86
88
InstWithLock<std::vector<plugin>> MPlugins;
Original file line number Diff line number Diff line change @@ -608,7 +608,7 @@ void fillPlatformAndDeviceCache(plugin &Plugin) {
608
608
PlatformImpl->getOrMakeDeviceImpl (PiDevice, PlatformImpl);
609
609
DeviceCache.emplace_back (Device);
610
610
}
611
-
611
+
612
612
PlatformDeviceCache[PlatformImpl] = DeviceCache;
613
613
}
614
614
DeviceNum += UnfilteredDeviceCount;
Original file line number Diff line number Diff line change @@ -87,7 +87,7 @@ DeviceImplPtr platform_impl::getOrMakeDeviceImpl(
87
87
GlobalHandler::instance ().getPlatformDeviceCache ();
88
88
89
89
// If we've already seen this device, return the impl
90
- std::vector<DeviceImplPtr>& DeviceCache = PlatformDeviceCache[PlatformImpl];
90
+ std::vector<DeviceImplPtr> & DeviceCache = PlatformDeviceCache[PlatformImpl];
91
91
for (const DeviceImplPtr &Device : DeviceCache) {
92
92
if (Device->getHandleRef () == PiDevice)
93
93
return Device;
@@ -115,7 +115,7 @@ platform_impl::get_devices(info::device_type DeviceType) const {
115
115
Platform = Pair.first ;
116
116
}
117
117
}
118
- std::vector<DeviceImplPtr>& DeviceCache = PlatformDeviceCache[Platform];
118
+ std::vector<DeviceImplPtr> & DeviceCache = PlatformDeviceCache[Platform];
119
119
for (const DeviceImplPtr &Device : DeviceCache) {
120
120
// Assumption here is that there is 1-to-1 mapping between PiDevType and
121
121
// Sycl device type for GPU, CPU, and ACC.
You can’t perform that action at this time.
0 commit comments