config.hpp 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. //---------------------------------------------------------------------------//
  2. // Copyright (c) 2013 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. // See http://boostorg.github.com/compute for more information.
  9. //---------------------------------------------------------------------------//
  10. #ifndef BOOST_COMPUTE_CONFIG_HPP
  11. #define BOOST_COMPUTE_CONFIG_HPP
  12. #include <boost/config.hpp>
  13. #include <boost/version.hpp>
  14. #include <boost/compute/cl.hpp>
  15. // check for minimum required boost version
  16. #if BOOST_VERSION < 105400
  17. #error Boost.Compute requires Boost version 1.54 or later
  18. #endif
  19. // the BOOST_COMPUTE_NO_VARIADIC_TEMPLATES macro is defined
  20. // if the compiler does not *fully* support variadic templates
  21. #if defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES) || \
  22. (defined(__GNUC__) && !defined(__clang__) && \
  23. __GNUC__ == 4 && __GNUC_MINOR__ <= 6)
  24. #define BOOST_COMPUTE_NO_VARIADIC_TEMPLATES
  25. #endif // BOOST_NO_CXX11_VARIADIC_TEMPLATES
  26. // the BOOST_COMPUTE_NO_STD_TUPLE macro is defined if the
  27. // compiler/stdlib does not support std::tuple
  28. #if defined(BOOST_NO_CXX11_HDR_TUPLE) || \
  29. defined(BOOST_COMPUTE_NO_VARIADIC_TEMPLATES)
  30. #define BOOST_COMPUTE_NO_STD_TUPLE
  31. #endif // BOOST_NO_CXX11_HDR_TUPLE
  32. // defines BOOST_COMPUTE_CL_CALLBACK to the value of CL_CALLBACK
  33. // if it is defined (it was added in OpenCL 1.1). this is used to
  34. // annotate certain callback functions registered with OpenCL
  35. #ifdef CL_CALLBACK
  36. # define BOOST_COMPUTE_CL_CALLBACK CL_CALLBACK
  37. #else
  38. # define BOOST_COMPUTE_CL_CALLBACK
  39. #endif
  40. // Maximum number of iterators acceptable for make_zip_iterator
  41. #ifndef BOOST_COMPUTE_MAX_ARITY
  42. // should be no more than max boost::tuple size (10 by default)
  43. # define BOOST_COMPUTE_MAX_ARITY 10
  44. #endif
  45. #if !defined(BOOST_COMPUTE_DOXYGEN_INVOKED) && \
  46. defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
  47. # define BOOST_COMPUTE_NO_RVALUE_REFERENCES
  48. #endif // BOOST_NO_CXX11_RVALUE_REFERENCES
  49. #if defined(BOOST_NO_CXX11_HDR_INITIALIZER_LIST)
  50. # define BOOST_COMPUTE_NO_HDR_INITIALIZER_LIST
  51. #endif // BOOST_NO_CXX11_HDR_INITIALIZER_LIST
  52. #if defined(BOOST_NO_CXX11_HDR_CHRONO)
  53. # define BOOST_COMPUTE_NO_HDR_CHRONO
  54. #endif // BOOST_NO_CXX11_HDR_CHRONO
  55. #endif // BOOST_COMPUTE_CONFIG_HPP