-
Notifications
You must be signed in to change notification settings - Fork 333
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/boostorg/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 (kyle.r.lutz@gmail.com) 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.
- Base your commits on the stable
master
branch but submit pull-requests against thedevelop
branch (all commits are tested indevelop
before being merged tomaster
).
Also read through the "How to write the perfect pull request" guide for some general advice on submitting pull-requests through GitHub.
The following cmake flags are used to identify the OpenCL implementation on a system.
-
OPENCL_INCLUDE_DIRS
- Should be set to the include path in order for the compiler to find the
CL/cl.h
header. - Example for NVIDIA on Linux:
/usr/include/nvidia-current
- Should be set to the include path in order for the compiler to find the
-
OPENCL_LIBRARIES
- Should be set to the
libOpenCL.so
file for the OpenCL implementation. - Example for NVIDIA on Linux:
/usr/lib/nvidia-current/libOpenCL.so
- Example for AMD on Linux:
/usr/lib/fglrx/libOpenCL.so
- Should be set to the
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")
See the issues labeled task
for a list of good projects to get started on.
Also, more tests are always helpful and a good way to get familiar with the code and development work-flow.