File tree Expand file tree Collapse file tree 1 file changed +11
-2
lines changed
Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Original file line number Diff line number Diff 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 }
You can’t perform that action at this time.
0 commit comments