summaryrefslogtreecommitdiff
path: root/src/gallium
diff options
context:
space:
mode:
authorTom Stellard <thomas.stellard@amd.com>2013-11-15 15:50:34 -0800
committerIan Romanick <ian.d.romanick@intel.com>2013-11-23 12:34:16 -0800
commiteafb9f675611ba40ca7ed8da95d90e3f87cc13c1 (patch)
treeb1573757e8107a0a815430345dc7469dc5213061 /src/gallium
parent5af1fb532451f41d7cd920497d468582711bac00 (diff)
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 <currojerez@riseup.net> CC: "10.0" <mesa-stable@lists.freedesktop.org> (cherry picked from commit a84dd2398f75c672293122408828ac66bb7052a0)
Diffstat (limited to 'src/gallium')
-rw-r--r--src/gallium/state_trackers/clover/api/program.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/gallium/state_trackers/clover/api/program.cpp b/src/gallium/state_trackers/clover/api/program.cpp
index 5ef1be60969..7d060c44aa1 100644
--- a/src/gallium/state_trackers/clover/api/program.cpp
+++ b/src/gallium/state_trackers/clover/api/program.cpp
@@ -173,11 +173,15 @@ clGetProgramInfo(cl_program d_prog, cl_program_info param,
break;
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;
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;
case CL_PROGRAM_SOURCE: