Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions sycl/test-e2e/Config/allowlist.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -131,8 +131,17 @@ int main() {
auto Platforms = sycl::platform::get_platforms();
if (Platforms.empty())
throw std::runtime_error("No platform is found");
else if (Platforms.size() != 1)
throw std::runtime_error("Expected only one platform.");

std::string FirstName =
Platforms.at(0).get_info<sycl::info::platform::name>();
std::string FirstVer =
Platforms.at(0).get_info<sycl::info::platform::version>();
for (const auto &P : Platforms) {
if (P.get_info<sycl::info::platform::name>() != FirstName ||
P.get_info<sycl::info::platform::version>() != FirstVer) {
throw std::runtime_error("Allowlist matched multiple platform types");
}
}

return 0;
}
Expand Down