Skip to content
Kyle Lutz edited this page May 5, 2013 · 1 revision

Getting Started

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.

Coding Style

  • 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

Commit Messages

  • 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).

Submitting Patches

  • 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.

CMake Flags

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
  • OPENCL_LIBRARIES
    • Example for NVIDIA on Linux: /usr/lib/nvidia-current/libOpenCL.so

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 the perf/ directory
  • BOOST_COMPUTE_BUILD_EXAMPLES: enables the examples in the example/ directory
  • BOOST_COMPUTE_BUILD_TESTS: enables the tests in the test/ directory

Building and Running Tests

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.

Environment Variables

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")