@@ -454,7 +454,6 @@ ur_result_t urDeviceGetSelected(ur_platform_handle_t hPlatform,
454
454
std::vector<DeviceSpec> acceptDeviceList;
455
455
std::vector<DeviceSpec> discardDeviceList;
456
456
457
- bool deviceIdsInUse = false ;
458
457
for (auto &termPair : mapODS) {
459
458
std::string backend = termPair.first ;
460
459
// TODO: Figure out how to process all ODS errors rather than returning
@@ -579,10 +578,6 @@ ur_result_t urDeviceGetSelected(ur_platform_handle_t hPlatform,
579
578
deviceList.push_back (DeviceSpec{DevicePartLevel::ROOT, hardwareType,
580
579
firstDeviceId, 0 , 0 , nullptr });
581
580
}
582
-
583
- if (deviceList.back ().rootId != DeviceIdTypeALL) {
584
- deviceIdsInUse = true ;
585
- }
586
581
}
587
582
}
588
583
@@ -626,41 +621,7 @@ ur_result_t urDeviceGetSelected(ur_platform_handle_t hPlatform,
626
621
return UR_RESULT_ERROR_DEVICE_NOT_FOUND;
627
622
}
628
623
629
- uint32_t startIdCount = 0 ;
630
- if (deviceIdsInUse) {
631
- ur_adapter_handle_t adapter;
632
- if (UR_RESULT_SUCCESS !=
633
- urPlatformGetInfo (hPlatform, UR_PLATFORM_INFO_ADAPTER,
634
- sizeof (adapter), &adapter, nullptr )) {
635
- return UR_RESULT_ERROR_INVALID_PLATFORM;
636
- }
637
-
638
- uint32_t numPlatforms;
639
- if (UR_RESULT_SUCCESS !=
640
- urPlatformGet (adapter, 0 , nullptr , &numPlatforms)) {
641
- return UR_RESULT_ERROR_INVALID_PLATFORM;
642
- }
643
- std::vector<ur_platform_handle_t > platforms;
644
- platforms.resize (numPlatforms);
645
- if (UR_RESULT_SUCCESS !=
646
- urPlatformGet (adapter, numPlatforms, platforms.data (), nullptr )) {
647
- return UR_RESULT_ERROR_INVALID_PLATFORM;
648
- }
649
-
650
- for (auto p : platforms) {
651
- if (p == hPlatform) {
652
- break ;
653
- }
654
- uint32_t deviceCount;
655
- if (UR_RESULT_SUCCESS !=
656
- urDeviceGet (p, UR_DEVICE_TYPE_ALL, 0 , nullptr , &deviceCount)) {
657
- return UR_RESULT_ERROR_INVALID_PLATFORM;
658
- }
659
- startIdCount += deviceCount;
660
- }
661
- }
662
-
663
- DeviceIdType deviceCount = startIdCount;
624
+ DeviceIdType deviceCount = 0 ;
664
625
std::transform (rootDeviceHandles.cbegin (), rootDeviceHandles.cend (),
665
626
std::back_inserter (rootDevices),
666
627
[&](ur_device_handle_t urDeviceHandle) {
0 commit comments