design.html 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  1. <html>
  2. <head>
  3. <meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
  4. <title>Design</title>
  5. <link rel="stylesheet" href="../../../../../doc/src/boostbook.css" type="text/css">
  6. <meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
  7. <link rel="home" href="../index.html" title="Chapter&#160;1.&#160;Boost.Compute">
  8. <link rel="up" href="../index.html" title="Chapter&#160;1.&#160;Boost.Compute">
  9. <link rel="prev" href="getting_started.html" title="Getting Started">
  10. <link rel="next" href="tutorial.html" title="Tutorial">
  11. </head>
  12. <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
  13. <table cellpadding="2" width="100%"><tr>
  14. <td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../boost.png"></td>
  15. <td align="center"><a href="../../../../../index.html">Home</a></td>
  16. <td align="center"><a href="../../../../../libs/libraries.htm">Libraries</a></td>
  17. <td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
  18. <td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
  19. <td align="center"><a href="../../../../../more/index.htm">More</a></td>
  20. </tr></table>
  21. <hr>
  22. <div class="spirit-nav">
  23. <a accesskey="p" href="getting_started.html"><img src="../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.html"><img src="../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="tutorial.html"><img src="../../../../../doc/src/images/next.png" alt="Next"></a>
  24. </div>
  25. <div class="section">
  26. <div class="titlepage"><div><div><h2 class="title" style="clear: both">
  27. <a name="boost_compute.design"></a><a class="link" href="design.html" title="Design">Design</a>
  28. </h2></div></div></div>
  29. <div class="toc"><dl class="toc">
  30. <dt><span class="section"><a href="design.html#boost_compute.design.library_architecture">Library Architecture</a></span></dt>
  31. <dt><span class="section"><a href="design.html#boost_compute.design.why_opencl">Why OpenCL</a></span></dt>
  32. </dl></div>
  33. <div class="section">
  34. <div class="titlepage"><div><div><h3 class="title">
  35. <a name="boost_compute.design.library_architecture"></a><a class="link" href="design.html#boost_compute.design.library_architecture" title="Library Architecture">Library Architecture</a>
  36. </h3></div></div></div>
  37. <p>
  38. The Boost Compute library consists of several different components. The core
  39. layer provides a "thin" C++ wrapper over the OpenCL API. This includes
  40. classes to manage OpenCL objects such as <code class="computeroutput">device</code>'s,
  41. <code class="computeroutput">kernel</code>'s and <code class="computeroutput">command_queue</code>'s.
  42. </p>
  43. <p>
  44. On top of the core layer is a partial implementation of the C++ standard
  45. library providing common containers (e.g. <code class="computeroutput"><a class="link" href="../boost/compute/vector.html" title="Class template vector">vector&lt;T&gt;</a></code>,
  46. <code class="computeroutput"><a class="link" href="../boost/compute/array.html" title="Class template array">array&lt;T, N&gt;</a></code>) along
  47. with common algorithms (e.g. <code class="computeroutput"><a class="link" href="../boost/compute/transform.html" title="Function transform">transform()</a></code>
  48. and <code class="computeroutput"><a class="link" href="../boost/compute/sort.html" title="Function sort">sort()</a></code>).
  49. </p>
  50. <p>
  51. The library also provides a number of "fancy" iterators (e.g.
  52. <code class="computeroutput"><a class="link" href="../boost/compute/transform_iterator.html" title="Class template transform_iterator">transform_iterator</a></code>
  53. and <code class="computeroutput"><a class="link" href="../boost/compute/permutation_iterator.html" title="Class template permutation_iterator">permutation_iterator</a></code>)
  54. which enhance the functionality of the standard algorithms.
  55. </p>
  56. <p>
  57. Boost.Compute also supplies a number of facilities for interoperation with
  58. other C and C++ libraries. See the section on <a class="link" href="interop.html" title="Interoperability">interoperability</a>
  59. for more information.
  60. </p>
  61. <p>
  62. See the <a class="link" href="reference.html#boost_compute.reference.api_overview" title="API Overview">API Overview</a>
  63. section for a full list of functions, classes, and macros provided by Boost.Compute.
  64. </p>
  65. </div>
  66. <div class="section">
  67. <div class="titlepage"><div><div><h3 class="title">
  68. <a name="boost_compute.design.why_opencl"></a><a class="link" href="design.html#boost_compute.design.why_opencl" title="Why OpenCL">Why OpenCL</a>
  69. </h3></div></div></div>
  70. <p>
  71. Boost.Compute uses <a href="http://en.wikipedia.org/wiki/OpenCL" target="_top">OpenCL</a>
  72. as its interface for executing code on parallel devices such as GPUs and
  73. multi-core CPUs.
  74. </p>
  75. <p>
  76. OpenCL was chosen for a number of reasons:
  77. </p>
  78. <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
  79. <li class="listitem">
  80. Vendor-neutral, standard C/C++, and doesn't require a special compiler,
  81. non-standard pragmas, or compiler extensions.
  82. </li>
  83. <li class="listitem">
  84. It is not just another parallel-library abstraction layer, it provides
  85. direct access to the underlying hardware.
  86. </li>
  87. <li class="listitem">
  88. Its runtime compilation model allows for kernels to be optimized and
  89. tuned dynamically for the device present when the application is run
  90. rather that the device that was present when the code was compiled (which
  91. is often a separate machine).
  92. </li>
  93. <li class="listitem">
  94. Using OpenCL allows Boost.Compute to directly interoperate with other
  95. OpenCL libraries (such as VexCL and OpenCV), as well as existing code
  96. written with OpenCL.
  97. </li>
  98. <li class="listitem">
  99. The "thin" C++ wrapper provided by Boost.Compute allows the
  100. user to break-out and write their own custom kernels when the provided
  101. APIs are not suitable.
  102. </li>
  103. </ul></div>
  104. </div>
  105. </div>
  106. <table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
  107. <td align="left"></td>
  108. <td align="right"><div class="copyright-footer">Copyright &#169; 2013, 2014 Kyle Lutz<p>
  109. Distributed under the Boost Software License, Version 1.0. (See accompanying
  110. file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
  111. </p>
  112. </div></td>
  113. </tr></table>
  114. <hr>
  115. <div class="spirit-nav">
  116. <a accesskey="p" href="getting_started.html"><img src="../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.html"><img src="../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="tutorial.html"><img src="../../../../../doc/src/images/next.png" alt="Next"></a>
  117. </div>
  118. </body>
  119. </html>