getting_started.qbk 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. [/===========================================================================
  2. Copyright (c) 2013-2015 Kyle Lutz <kyle.r.lutz@gmail.com>
  3. Distributed under the Boost Software License, Version 1.0
  4. See accompanying file LICENSE_1_0.txt or copy at
  5. http://www.boost.org/LICENSE_1_0.txt
  6. =============================================================================/]
  7. [section:getting_started Getting Started]
  8. [section Installation]
  9. Boost.Compute is available in Boost starting with version 1.61. Visit
  10. [@http://www.boost.org/users/download/] for download instructions.
  11. [endsect]
  12. [section Compilation and Usage]
  13. Boost.Compute is a header-only library, so no linking is required. To use the
  14. library just add the include directory to the compilation flags and link with
  15. the system's OpenCL library. For example, with GCC:
  16. ``
  17. g++ -I/path/to/compute/include main.cpp -lOpenCL
  18. ``
  19. All of the Boost.Compute headers can be included with the following directive:
  20. ``
  21. #include <boost/compute.hpp>
  22. ``
  23. If you only want to include the core OpenCL wrapper headers (which have minimal
  24. dependencies on the rest of Boost), use the following directive:
  25. ``
  26. #include <boost/compute/core.hpp>
  27. ``
  28. All of the classes and functions in Boost.Compute live in the `boost::compute`
  29. namespace and can be brought into global scope with:
  30. ``
  31. using namespace boost::compute;
  32. ``
  33. [endsect]
  34. [section Configuration Macros]
  35. Boost.Compute provides a number of optional features which can be configured
  36. with the following macros.
  37. [table
  38. [[Macro] [Description]]
  39. [
  40. [[^BOOST_COMPUTE_DEBUG_KERNEL_COMPILATION]][
  41. When defined, if program::build() fails, the program source and
  42. build log will be written to stdout.
  43. ]
  44. ]
  45. [
  46. [[^BOOST_COMPUTE_HAVE_THREAD_LOCAL]][
  47. Enables the use of C++11 [^thread_local] storage specifier.
  48. ]
  49. ]
  50. [
  51. [[^BOOST_COMPUTE_THREAD_SAFE]][
  52. Builds Boost.Compute in a thread-safe mode. This requires either
  53. support for C++11 thread-local storage (via defining the
  54. [^BOOST_COMPUTE_HAVE_THREAD_LOCAL] macro) or linking with
  55. Boost.Thread.
  56. ]
  57. ]
  58. [
  59. [[^BOOST_COMPUTE_USE_OFFLINE_CACHE]][
  60. Enables the offline-cache which stores compiled binaries on disk.
  61. This option requires linking with Boost.Filesystem and
  62. Boost.System.
  63. ]
  64. ]
  65. ]
  66. [endsect]
  67. [section Support]
  68. Bugs and issues can be reported to the
  69. [@https://github.com/boostorg/compute/issues?state=open issue tracker].
  70. There is also a mailing list for users and developers at
  71. [@https://groups.google.com/forum/#!forum/boost-compute].
  72. Look through the [link boost_compute.faq FAQ] to see if you're encountering a
  73. known or common issue.
  74. [endsect] [/ support]
  75. [endsect]