[Mesa-dev] [PATCH 0/2] clover: add clCompileProgram

EdB edb+mesa at sigluy.net
Mon Aug 4 08:03:22 PDT 2014


I'm done with the clCompile part of OpenCL 1.2.

As you can see I use char* data to transfert data from core to llvm.

At first I was thinking of using std class but we need to be binary safe
when data are transfert beetween c++98/c++11 compiled code.

Then I try to use compat class, but it add unexpected behavior.
It's looks like they are acting like std, but they don't.
For exemple vector.reserve is actually making the vector size grown,
not like std::vector. Also std::string.c_str is always null terminated.
compat::string is not.

At the end I decide to use const char* as it also avoid some memory copy,
but I can rewrite the patch if it's needed.
And I think compat need to be fixed.

EdB (2):
  clover: std::pair is not c++98/c++11 safe
  clover: add clCompileProgram

 src/gallium/state_trackers/clover/api/dispatch.cpp |  2 +-
 src/gallium/state_trackers/clover/api/program.cpp  | 41 ++++++++++++++++++++--
 .../state_trackers/clover/core/compiler.hpp        | 11 +++---
 src/gallium/state_trackers/clover/core/program.cpp | 14 ++++++--
 src/gallium/state_trackers/clover/core/program.hpp |  5 ++-
 .../state_trackers/clover/llvm/invocation.cpp      | 33 +++++++++++++----
 src/gallium/state_trackers/clover/util/compat.hpp  |  6 ++++
 7 files changed, 95 insertions(+), 17 deletions(-)


More information about the mesa-dev mailing list