Skip to content

Commit

Permalink
Merge pull request #62 from CCob/master
Browse files Browse the repository at this point in the history
Fix issue where platform can return no devices
  • Loading branch information
tankbusta authored Nov 4, 2020
2 parents e3b20e4 + 1d6b33b commit bd43069
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions worker/opencl_info.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ func GetAvailableDevices() (shared.DeviceMap, error) {
for _, platform := range platforms {
devices, err := platform.GetDevices(opencl.DeviceTypeAll)
if err != nil {
if err == opencl.ErrDeviceNotFound {
continue
}
return nil, err
}

Expand All @@ -39,5 +42,9 @@ func GetAvailableDevices() (shared.DeviceMap, error) {
}
}

if len(devs) == 0 {
return nil, opencl.ErrDeviceNotFound
}

return devs, nil
}

0 comments on commit bd43069

Please sign in to comment.