From ce4d3f3104b01b6148ce7b1c7ecd354fd2f062c9 Mon Sep 17 00:00:00 2001 From: EdB Date: Tue, 5 Aug 2014 19:09:38 +0200 Subject: [PATCH] clover: clGetProgramInfo support for OpenCL 1.2. [ Francisco Jerez: Rework using fold() for conciseness. ] Reviewed-by: Francisco Jerez Tested-by: EdB --- src/gallium/state_trackers/clover/api/program.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) 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() = 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); } -- 2.30.2