]> git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/compute/doc/design.qbk
add subtree-ish sources for 12.0.3
[ceph.git] / ceph / src / boost / libs / compute / doc / design.qbk
1 [/===========================================================================
2 Copyright (c) 2013-2015 Kyle Lutz <kyle.r.lutz@gmail.com>
3
4 Distributed under the Boost Software License, Version 1.0
5 See accompanying file LICENSE_1_0.txt or copy at
6 http://www.boost.org/LICENSE_1_0.txt
7 =============================================================================/]
8
9 [section:design Design]
10
11 [section Library Architecture]
12
13 The Boost Compute library consists of several different components. The core
14 layer provides a "thin" C++ wrapper over the OpenCL API. This includes classes
15 to manage OpenCL objects such as
16 [classref boost::compute::device device]'s,
17 [classref boost::compute::device kernel]'s and
18 [classref boost::compute::device command_queue]'s.
19
20 On top of the core layer is a partial implementation of the C++ standard
21 library providing common containers (e.g.
22 [classref boost::compute::vector vector<T>],
23 [classref boost::compute::array array<T, N>]) along with common algorithms
24 (e.g. [funcref boost::compute::transform transform()] and
25 [funcref boost::compute::sort sort()]).
26
27 The library also provides a number of "fancy" iterators (e.g.
28 [classref boost::compute::transform_iterator transform_iterator] and
29 [classref boost::compute::permutation_iterator permutation_iterator]) which
30 enhance the functionality of the standard algorithms.
31
32 Boost.Compute also supplies a number of facilities for interoperation with
33 other C and C++ libraries. See the section on [link boost_compute.interop
34 interoperability] for more information.
35
36 See the [link boost_compute.reference.api_overview API Overview] section for
37 a full list of functions, classes, and macros provided by Boost.Compute.
38
39 [endsect] [/ library architecture]
40
41 [section Why OpenCL]
42
43 Boost.Compute uses [@http://en.wikipedia.org/wiki/OpenCL OpenCL] as its
44 interface for executing code on parallel devices such as GPUs and multi-core
45 CPUs.
46
47 OpenCL was chosen for a number of reasons:
48
49 * Vendor-neutral, standard C/C++, and doesn't require a special compiler,
50 non-standard pragmas, or compiler extensions.
51 * It is not just another parallel-library abstraction layer, it provides direct
52 access to the underlying hardware.
53 * Its runtime compilation model allows for kernels to be optimized and tuned
54 dynamically for the device present when the application is run rather that the
55 device that was present when the code was compiled (which is often a separate
56 machine).
57 * Using OpenCL allows Boost.Compute to directly interoperate with other OpenCL
58 libraries (such as VexCL and OpenCV), as well as existing code written with
59 OpenCL.
60 * The "thin" C++ wrapper provided by Boost.Compute allows the user to break-out
61 and write their own custom kernels when the provided APIs are not suitable.
62
63 [endsect] [/ why opencl]
64
65 [endsect]