[Mesa-dev] [PATCH] clover: clGetProgramInfo support for OpenCL 1.2
EdB
edb+mesa at sigluy.net
Tue Aug 5 10:09:38 PDT 2014
---
src/gallium/state_trackers/clover/api/program.cpp | 18 ++++++++++++++++++
1 file changed, 18 insertions(+)
diff --git a/src/gallium/state_trackers/clover/api/program.cpp b/src/gallium/state_trackers/clover/api/program.cpp
index b81ce69..05f3840 100644
--- a/src/gallium/state_trackers/clover/api/program.cpp
+++ b/src/gallium/state_trackers/clover/api/program.cpp
@@ -232,6 +232,24 @@ 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: {
+ std::string names;
+ for (auto &symbol : prog.symbols()) {
+ std::string name(symbol.name.begin(), symbol.name.size());
+ name += ";";
+ names += name;
+ }
+ if (!names.empty())
+ names.pop_back(); //remove ';'
+
+ buf.as_string() = names;
+ }
+ break;
+
default:
throw error(CL_INVALID_VALUE);
}
--
2.0.4
More information about the mesa-dev
mailing list