assertOpenCL
September 19, 2018
|
assert() are not available in OpenCL. Here an implementation similar to the classic C implementation. A difference is that instead to exit when an assertion failed a message is printed (if at least OpenCL 1.2) and the first assertion (or the last) is transmitted to the host program (see examples of use with C/C++, Java, Scala and Python).
There are also some PRINT() macros to use printf() function when it is available and that do nothing if not.
Main absolute links:
assertOpenCL library files:
Example of use:
examples/kernel/example.cl
Examples of host program:
examples/C/example.c
examples/Cpp/example.cpp
examples/Java/Example.java
Example.scala
(generated with Scaladoc) examples/Python/example.py
Additional tools:
tools/opencl_infos.py
cl.h
to extract list of error codes and names: tools/opencl_parse_error_codes.py
cl.h
: examples/C/opencl_errors_map.h