summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorEdB <edb+mesa@sigluy.net>2014-08-05 19:09:38 +0200
committerFrancisco Jerez <currojerez@riseup.net>2014-08-17 23:34:11 +0300
commitce4d3f3104b01b6148ce7b1c7ecd354fd2f062c9 (patch)
treebab0454e9df2359f0966c16b438e3457a0cf042a /src
parentef130b6050fc91c12a220f19d8bdd659712f7fb9 (diff)
clover: clGetProgramInfo support for OpenCL 1.2.
[ Francisco Jerez: Rework using fold() for conciseness. ] Reviewed-by: Francisco Jerez <currojerez@riseup.net> Tested-by: EdB <edb+mesa@sigluy.net>
Diffstat (limited to 'src')
-rw-r--r--src/gallium/state_trackers/clover/api/program.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/gallium/state_trackers/clover/api/program.cpp b/src/gallium/state_trackers/clover/api/program.cpp
index b81ce69652f..8d9d3ac62d5 100644
--- a/src/gallium/state_trackers/clover/api/program.cpp
+++ b/src/gallium/state_trackers/clover/api/program.cpp
@@ -232,6 +232,17 @@ clGetProgramInfo(cl_program d_prog, cl_program_info param,
prog.devices());
break;
+ case CL_PROGRAM_NUM_KERNELS:
+ buf.as_scalar<cl_uint>() = prog.symbols().size();
+ break;
+
+ case CL_PROGRAM_KERNEL_NAMES:
+ buf.as_string() = fold([](const std::string &a, const module::symbol &s) {
+ return ((a.empty() ? "" : a + ";") +
+ std::string(s.name.begin(), s.name.size()));
+ }, std::string(), prog.symbols());
+ break;
+
default:
throw error(CL_INVALID_VALUE);
}