Skip to content

Commit

Permalink
Work around clGetDeviceIDs issue.
Browse files Browse the repository at this point in the history
  • Loading branch information
maleadt committed Sep 8, 2024
1 parent 9437911 commit 462556f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/platform.jl
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,9 @@ end
function default_device(p::Platform)
devs = devices(p, CL_DEVICE_TYPE_DEFAULT)
isempty(devs) && return nothing
return only(devs)
# XXX: clGetDeviceIDs documents CL_DEVICE_TYPE_DEFAULT should only return one device,
# but it's been observed to return multiple devices on some platforms...
return first(devs)
end

devices(p::Platform) = devices(p, CL_DEVICE_TYPE_ALL)
Expand Down

0 comments on commit 462556f

Please sign in to comment.