summaryrefslogtreecommitdiffstats
path: root/src/gallium/state_trackers
diff options
context:
space:
mode:
Diffstat (limited to 'src/gallium/state_trackers')
-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: