@@ -294,10 +294,11 @@ ur_result_t urDeviceGetSelected(ur_platform_handle_t hPlatform,
294294 // with `std::queue<std::pair<key_type_t, value_type_t>>` or something similar.)
295295 auto maybeEnvVarMap = getenv_to_map (" ONEAPI_DEVICE_SELECTOR" , false );
296296 std::cout
297- << " DEBUG: " << (maybeEnvVarMap.has_value ()
298- ? " getenv_to_map parsed env var and produced a map"
299- : " getenv_to_map parsed env var and failed to produce a map" )
300- << std::endl;
297+ << " DEBUG: "
298+ << (maybeEnvVarMap.has_value ()
299+ ? " getenv_to_map parsed env var and produced a map"
300+ : " getenv_to_map parsed env var and failed to produce a map" )
301+ << std::endl;
301302
302303 // if the ODS env var is not set at all, then pretend it was set to the default
303304 using EnvVarMap = std::map<std::string, std::vector<std::string>>;
@@ -426,7 +427,8 @@ ur_result_t urDeviceGetSelected(ur_platform_handle_t hPlatform,
426427
427428 for (auto &termPair : mapODS) {
428429 std::string backend = termPair.first ;
429- if (backend.empty ()) { // FIXME: never true because getenv_to_map rejects this case
430+ if (backend
431+ .empty ()) { // FIXME: never true because getenv_to_map rejects this case
430432 // malformed term: missing backend -- output ERROR, then continue
431433 // TODO: replace std::cout with URT message output mechanism
432434 std::cout << " ERROR: missing backend, format of filter = "
@@ -452,13 +454,14 @@ ur_result_t urDeviceGetSelected(ur_platform_handle_t hPlatform,
452454 // Note the hPlatform -> platformBackend -> platformBackendName conversion above
453455 // guarantees minimal sanity for the comparison with backend from the ODS string
454456 if (backend.front () != ' *' &&
455- !std::equal (platformBackendName.cbegin (), platformBackendName.cend (),
456- backend.cbegin (), backend.cend (),
457- [](const auto &a, const auto &b) {
458- // case-insensitive comparison by converting both tolower
459- return std::tolower (static_cast <unsigned char >(a)) ==
460- std::tolower (static_cast <unsigned char >(b));
461- })) {
457+ !std::equal (platformBackendName.cbegin (),
458+ platformBackendName.cend (), backend.cbegin (),
459+ backend.cend (), [](const auto &a, const auto &b) {
460+ // case-insensitive comparison by converting both tolower
461+ return std::tolower (
462+ static_cast <unsigned char >(a)) ==
463+ std::tolower (static_cast <unsigned char >(b));
464+ })) {
462465 // irrelevant term for current request: different backend -- silently ignore
463466 // TODO: replace std::cout with URT message output mechanism
464467 std::cout << " WARNING: ignoring term with irrelevant backend"
@@ -475,7 +478,8 @@ ur_result_t urDeviceGetSelected(ur_platform_handle_t hPlatform,
475478 }
476479 if (std::find_if (termPair.second .cbegin (), termPair.second .cend (),
477480 [](const auto &s) { return s.empty (); }) !=
478- termPair.second .cend ()) { // FIXME: never true because getenv_to_map rejects this case
481+ termPair.second
482+ .cend ()) { // FIXME: never true because getenv_to_map rejects this case
479483 // malformed term: missing filterString -- output warning, then continue
480484 // TODO: replace std::cout with URT message output mechanism
481485 std::cout << " WARNING: empty filterString, format of filterStrings "
@@ -528,7 +532,7 @@ ur_result_t urDeviceGetSelected(ur_platform_handle_t hPlatform,
528532 const auto firstDeviceId = getDeviceId (firstPart);
529533 // first dot found, look for another
530534 std::string::size_type locationDot2 =
531- filterString.find (' .' , locationDot1+ 1 );
535+ filterString.find (' .' , locationDot1 + 1 );
532536 std::string secondPart = filterString.substr (
533537 locationDot1 + 1 , locationDot2 == std::string::npos
534538 ? std::string::npos
@@ -571,7 +575,7 @@ ur_result_t urDeviceGetSelected(ur_platform_handle_t hPlatform,
571575 acceptDeviceList.push_back (DeviceSpec{
572576 DevicePartLevel::ROOT, ::UR_DEVICE_TYPE_ALL, DeviceIdTypeALL});
573577 }
574-
578+
575579 std::cout << " DEBUG: size of acceptDeviceList = " << acceptDeviceList.size ()
576580 << std::endl
577581 << " DEBUG: size of discardDeviceList = "
@@ -816,8 +820,7 @@ ur_result_t urDeviceGetSelected(ur_platform_handle_t hPlatform,
816820 std::cout << " WARNING: an accept term was ignored because it "
817821 " does not select any additional devices"
818822 " selectedDevices.size() = "
819- << selectedDevices.size ()
820- << std::endl;
823+ << selectedDevices.size () << std::endl;
821824 }
822825 }
823826
0 commit comments