Commit a84dd239 authored by Tom Stellard's avatar Tom Stellard
Browse files

clover: Optionally return context's devices from clGetProgramInfo()

The spec allows clGetProgramInfo() to return information about either
the devices associated with the program or the devices associated
with the context.  If there are no devices associated with the program,
then we return devices associated with the context.

https://bugs.freedesktop.org/show_bug.cgi?id=52171

Reviewed-by: Francisco Jerez's avatarFrancisco Jerez <currojerez@riseup.net>

CC: "10.0" <mesa-stable@lists.freedesktop.org>
parent 7dfb4b2d
...@@ -173,11 +173,15 @@ clGetProgramInfo(cl_program d_prog, cl_program_info param, ...@@ -173,11 +173,15 @@ clGetProgramInfo(cl_program d_prog, cl_program_info param,
break; break;
case CL_PROGRAM_NUM_DEVICES: case CL_PROGRAM_NUM_DEVICES:
buf.as_scalar<cl_uint>() = prog.devices().size(); buf.as_scalar<cl_uint>() = prog.devices().size() ?
prog.devices().size() :
prog.ctx.devs().size();
break; break;
case CL_PROGRAM_DEVICES: case CL_PROGRAM_DEVICES:
buf.as_vector<cl_device_id>() = descs(prog.devices()); buf.as_vector<cl_device_id>() = prog.devices().size() ?
descs(prog.devices()) :
descs(prog.ctx.devs());
break; break;
case CL_PROGRAM_SOURCE: case CL_PROGRAM_SOURCE:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment