Skip to content

Commit 6cd5c2e

Browse files
authored
[SYCL][E2E] Fix multiple platform issue in Config/allowlist.cpp test (#20953)
Test was failing on platform having multiple platforms, eg. BMG + integrated
1 parent b703d41 commit 6cd5c2e

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

sycl/test-e2e/Config/allowlist.cpp

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,8 +134,17 @@ int main() {
134134
auto Platforms = sycl::platform::get_platforms();
135135
if (Platforms.empty())
136136
throw std::runtime_error("No platform is found");
137-
else if (Platforms.size() != 1)
138-
throw std::runtime_error("Expected only one platform.");
137+
138+
std::string FirstName =
139+
Platforms.at(0).get_info<sycl::info::platform::name>();
140+
std::string FirstVer =
141+
Platforms.at(0).get_info<sycl::info::platform::version>();
142+
for (const auto &P : Platforms) {
143+
if (P.get_info<sycl::info::platform::name>() != FirstName ||
144+
P.get_info<sycl::info::platform::version>() != FirstVer) {
145+
throw std::runtime_error("Allowlist matched multiple platform types");
146+
}
147+
}
139148

140149
return 0;
141150
}

0 commit comments

Comments
 (0)