From: EdB Date: Tue, 5 Aug 2014 17:09:38 +0000 (+0200) Subject: clover: clGetProgramInfo support for OpenCL 1.2. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=ce4d3f3104b01b6148ce7b1c7ecd354fd2f062c9;p=mesa.git clover: clGetProgramInfo support for OpenCL 1.2. [ Francisco Jerez: Rework using fold() for conciseness. ] Reviewed-by: Francisco Jerez Tested-by: EdB --- 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); }