-
Notifications
You must be signed in to change notification settings - Fork 0
Developer's Guide
Before beginning development ensure you can build the library and run the test-suite. The following steps show how to download, configure, compile and test.
# clone the repository
git clone https://github.com/kylelutz/compute.git
# go to the compute directory
cd compute
# create a build directory
mkdir build
# go to the build directory
cd build
# run cmake, setup options for your system, enable BOOST_COMPUTE_BUILD_TESTS, and
# then click "Generate" (see below for more information on the cmake variables)
cmake-gui ..
# compile
make
# run the tests
ctest
Also be sure to read through the getting started guide and the tutorial.
Please send me an email ([email protected]) if you encounter any issues or have any questions.
- Indentation is four-spaces (not tabs)
- Try to keep line-length under 80 characters
- Follow the STL/Boost naming conventions (lower case with underscores)
- When in doubt, match the style of existing code
- Otherwise, do whatever you want
- First line is a subject (no period at the end)
- Second line is blank
- Follow with one more paragraphs describing the change
Please make special note if a change requires existing code to be updated (e.g. for non-backwards compatible changes).
- Patches can be submitted through the pull-request system on GitHub or through email.
- Please try to rebase your changes on the current master branch before submitting.
The following cmake flags are used to identify the OpenCL implementation on a system.
-
OPENCL_INCLUDE_DIRS
- Example for NVIDIA on Linux:
/usr/include/nvidia-current
- Example for NVIDIA on Linux:
-
OPENCL_LIBRARIES
- Example for NVIDIA on Linux:
/usr/lib/nvidia-current/libOpenCL.so
- Example for NVIDIA on Linux:
The following cmake flags control building the Boost.Compute benchmarks, examples, and tests. Enable them to build those components.
-
BOOST_COMPUTE_BUILD_BENCHMARKS
: enables the benchmarks in theperf/
directory -
BOOST_COMPUTE_BUILD_EXAMPLES
: enables the examples in theexample/
directory -
BOOST_COMPUTE_BUILD_TESTS
: enables the tests in thetest/
directory
To build the tests you must enable the BOOST_COMPUTE_BUILD_TESTS
option in cmake. The tests can be run by executing the ctest
command from the build directory.
Please report any tests failures to the issue tracker along with the test's output and information on your system and compute device.
There are a few environment variables which, when set, affect how Boost.Compute interacts with the system. The following variables will influence the default compute device returned from system::default_device()
.
-
BOOST_COMPUTE_DEFAULT_DEVICE
: name of a compute device (e.g. "GTX TITAN") -
BOOST_COMPUTE_DEFAULT_PLATFORM
: name of a platform (e.g. "NVIDIA CUDA") -
BOOST_COMPUTE_DEFAULT_VENDOR
: name of a device vendor (e.g. "NVIDIA")