OpenCL POCL + asan or valgrind

I am trying to debug my OpenCL kernel. I think, the error is in wrong memory allocation. So, I'am looking for a way to detect it.

Long story short, could I just run OpenCL kernel on POCL platform and check it with well-known instruments?

Upvotes: 0

Views: 217

Answers (2)

Yes, Oclgrind should give more helpful error messages, but also pocl's debug symbol support should again work in master. Thus, valgrind and gdb should now be able to identify OpenCL C line numbers better.

There's also a new env POCL_EXTRA_BUILD_FLAGS in pocl master:

"Adds the contents of the environment variable to all clBuildProgram() calls. E.g. POCL_EXTRA_BUILD_FLAGS="-g -cl-opt-disable" can be useful for force adding debug data all the built kernels to help debugging kernel issues with tools such as gdb or valgrind."

Upvotes: 1

maZZZu
maZZZu

Reputation: 3615

You can do that. However, there is also tool called Oclgrind designed just for that: https://github.com/jrprice/Oclgrind

Upvotes: 0

Related Questions