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 @@ -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 }
You can’t perform that action at this time.
0 commit comments