mirror of
https://github.com/boostorg/compute.git
synced 2026-01-28 07:02:15 +00:00
This adds more documentation with information on how to download and how to compile programs with the boost compute library.
60 lines
1.6 KiB
Plaintext
60 lines
1.6 KiB
Plaintext
[section:gettingstarted Getting Started]
|
|
|
|
[section Downloading]
|
|
|
|
Boost.Compute is not yet an offical Boost library and therefore is not
|
|
packaged with the standard Boost distribution. To download the library use the
|
|
following command:
|
|
|
|
[endsect]
|
|
|
|
``
|
|
git clone git://github.com/kylelutz/compute.git
|
|
``
|
|
|
|
[section Compilation and Usage]
|
|
|
|
Boost.Compute is a header-only library, so no linking is required. To use the
|
|
library just add the include directory to the compilation flags and link with
|
|
the system's OpenCL library. For example, with GCC:
|
|
|
|
``
|
|
g++ -I/path/to/compute/include main.cpp -lOpenCL
|
|
``
|
|
|
|
All of the Boost.Compute headers can be included with the following directive:
|
|
|
|
``
|
|
#include <boost/compute.hpp>
|
|
``
|
|
|
|
All of the classes and functions in Boost.Compute live in the `boost::compute`
|
|
namespace and can be brought into global scope with:
|
|
|
|
``
|
|
using namespace boost::compute;
|
|
``
|
|
|
|
[endsect]
|
|
|
|
[section Architecture]
|
|
|
|
The Boost Compute library consists of several different components. The core
|
|
component provides a C++ wrapper over the OpenCL C API.
|
|
|
|
On top of the core layer is a partial implementation of the C++ standard
|
|
library providing common containers (e.g.
|
|
[classref boost::compute::vector vector<T>],
|
|
[classref boost::compute::array array<T, N>]) along with common algorithms
|
|
(e.g. [funcref boost::compute::transform transform()] and
|
|
[funcref boost::compute::sort sort()]).
|
|
|
|
The library also provides number of "fancy" iterators (e.g.
|
|
[classref boost::compute::transform_iterator transform_iterator] and
|
|
[classref boost::compute::permutation_iterator permutation_iterator]) which
|
|
enhance the functionality of the standard algorithms.
|
|
|
|
[endsect]
|
|
|
|
[endsect]
|