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

Matt Arsenault arsenm2 at gmail.com
Mon Aug 4 11:52:14 PDT 2014


On Aug 4, 2014, at 8:03 AM, EdB <edb+mesa at sigluy.net> wrote:

> Hello
> 
> 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.

I’ve run into many memory corruption problems with the compat:: stuff that is fixed by replacing it all with the std::versions. The compat version differences, while still looking similar is also pretty bad. Can we just get rid of compat?

> 
> 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(-)
> 
> -- 
> 2.0.4
> 
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/mesa-dev



More information about the mesa-dev mailing list