@@ -172,23 +172,21 @@ std::vector<platform> platform_impl::get_platforms() {
172
172
std::vector<std::pair<platform, AdapterPtr>> PlatformsWithAdapter;
173
173
174
174
// Then check backend-specific adapters
175
- std::vector<platform> Platforms;
176
175
for (auto &Adapter : Adapters) {
177
176
const auto &AdapterPlatforms = getAdapterPlatforms (Adapter);
178
177
for (const auto &P : AdapterPlatforms) {
179
- Platforms.push_back (P);
180
178
PlatformsWithAdapter.push_back ({P, Adapter});
181
179
}
182
180
}
183
181
184
182
// For the selected platforms register them with their adapters
185
- // std::vector<platform> Platforms;
186
- // for (auto &Platform : PlatformsWithAdapter) {
187
- // auto &Adapter = Platform.second;
188
- // std::lock_guard<std::mutex> Guard(*Adapter->getAdapterMutex());
189
- // Adapter->getPlatformId(getSyclObjImpl(Platform.first)->getHandleRef());
190
- // Platforms.push_back(Platform.first);
191
- // }
183
+ std::vector<platform> Platforms;
184
+ for (auto &Platform : PlatformsWithAdapter) {
185
+ auto &Adapter = Platform.second ;
186
+ std::lock_guard<std::mutex> Guard (*Adapter->getAdapterMutex ());
187
+ Adapter->getPlatformId (getSyclObjImpl (Platform.first )->getHandleRef ());
188
+ Platforms.push_back (Platform.first );
189
+ }
192
190
193
191
// This initializes a function-local variable whose destructor is invoked as
194
192
// the SYCL shared library is first being unloaded.
0 commit comments