commit | abe1273e251d9ae3ed01117e80bc5a48aaeb83bd | [log] [tgz] |
---|---|---|
author | Kévin Petit <[email protected]> | Fri Sep 20 15:18:53 2019 +0100 |
committer | Ben Ashbaugh <[email protected]> | Fri Sep 20 07:18:53 2019 -0700 |
tree | 305486f2d5a2000da40c047df70e05c96b49b2f1 | |
parent | 00c12d1e5933261bd3a2369cf1f70279b75d6dba [diff] |
Fix failing tests and enable testing in Travis (#67) Since we build with CL_HPP_MINIMUM_OPENCL_VERSION defined to 100, the bindings are querying the platform to decide whether to use clCreateCommandQueue or clCreateCommandQueueWithProperties. We thus need to make the stub function for clGetPlatformInfo report 2.0 when building with CL_HPP_TARGET_OPENCL_VERSION >= 200 to mirror the queue creation function check. Also allow calls to clCreateContextFromType with no properties on Apple platforms to mirror the logic in the bindings. Contributes to #62. Signed-off-by: Kevin Petit <[email protected]>
Doxgen documentation for the cl2.hpp header is available here:
http://khronosgroup.github.io/OpenCL-CLHPP/
Components:
input_cl.hpp
(DEPRECATED): Acts as the master source for the 1.x version of the header. The reason for doing it this way is to generate an appropriate set of functors with varying argument counts without assuming variadic template support in the header. This version of the C++ bindings is deprecated and is no longer maintained; it is strongly recommended to switch to cl2.hpp
if possible.
input_cl2.hpp
: Acts as the master source for the 2.x version of the header. Directly copied as cl2.hpp
gen_cl_hpp.py
: A generator script written in python to convert input_cl.hpp
into cl.hpp
, generating the functor expansions as necessary. cl2.hpp
does not require this as it uses variadic templates expanded in the compiler.
docs
: Doxygen file used to generate HTML documentation for cl2.hpp
.
examples
: A simple example application using the very basic features of the header and generating cl.hpp
dynamically through the build system.
tests
: A (very small, incomplete) set of regression tests. Building the tests requires Python, Ruby, Unity and CMock. For the last two we use Unity 2.1.0 and CMock top-of-tree from Github (the version 2.0.204 on Sourceforge does not work).
CMakeLists.txt
: A build system that both generates the example and drives generation of cl.hpp
.
To get external dependencies needed for testing, use --recursive
when cloning the repository, or run git submodule update --init
.
You may need to tell CMake where to find the OpenCL headers and libraries, using the variables OPENCL_INCLUDE_DIR
and OPENCL_LIB_DIR
.
These can be set either as environment variables, or on the cmake command line using the syntax -D<VAR>=<VALUE>
.
The following is an example set of commands to checkout and build the C++ bindings (adapt paths as required):
git clone --recursive https://github.com/KhronosGroup/OpenCL-CLHPP cd OpenCL-CLHPP mkdir build cd build cmake -DOPENCL_INCLUDE_DIR=/path/to/OpenCL/headers -DOPENCL_LIB_DIR=/path/to/OpenCL/library make make test
After building, the headers appear in build/include/CL/
.
If Doxygen is available, you can generate HTML documentation by typing make docs
.