Skip to content

Commit 483c8bc

Browse files
committed
Fix multiple plaftorm issue in Config/allowlist.cpp test
1 parent 75dab49 commit 483c8bc

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
@@ -131,8 +131,17 @@ int main() {
131131
auto Platforms = sycl::platform::get_platforms();
132132
if (Platforms.empty())
133133
throw std::runtime_error("No platform is found");
134-
else if (Platforms.size() != 1)
135-
throw std::runtime_error("Expected only one platform.");
134+
135+
std::string FirstName =
136+
Platforms.at(0).get_info<sycl::info::platform::name>();
137+
std::string FirstVer =
138+
Platforms.at(0).get_info<sycl::info::platform::version>();
139+
for (const auto &P : Platforms) {
140+
if (P.get_info<sycl::info::platform::name>() != FirstName ||
141+
P.get_info<sycl::info::platform::version>() != FirstVer) {
142+
throw std::runtime_error("Allowlist matched multiple platform types");
143+
}
144+
}
136145

137146
return 0;
138147
}

0 commit comments

Comments
 (0)