Skip to content

Commit bd43069

Browse files
authored
Merge pull request #62 from CCob/master
Fix issue where platform can return no devices
2 parents e3b20e4 + 1d6b33b commit bd43069

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

worker/opencl_info.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@ func GetAvailableDevices() (shared.DeviceMap, error) {
2020
for _, platform := range platforms {
2121
devices, err := platform.GetDevices(opencl.DeviceTypeAll)
2222
if err != nil {
23+
if err == opencl.ErrDeviceNotFound {
24+
continue
25+
}
2326
return nil, err
2427
}
2528

@@ -39,5 +42,9 @@ func GetAvailableDevices() (shared.DeviceMap, error) {
3942
}
4043
}
4144

45+
if len(devs) == 0 {
46+
return nil, opencl.ErrDeviceNotFound
47+
}
48+
4249
return devs, nil
4350
}

0 commit comments

Comments
 (0)