cl.hpp 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  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_CL_HPP
  11. #define BOOST_COMPUTE_CL_HPP
  12. #if defined(BOOST_COMPUTE_MAX_CL_VERSION)
  13. # if !defined(CL_USE_DEPRECATED_OPENCL_2_1_APIS) && BOOST_COMPUTE_MAX_CL_VERSION < 202
  14. # define CL_USE_DEPRECATED_OPENCL_2_1_APIS
  15. # endif
  16. # if !defined(CL_USE_DEPRECATED_OPENCL_2_0_APIS) && BOOST_COMPUTE_MAX_CL_VERSION < 201
  17. # define CL_USE_DEPRECATED_OPENCL_2_0_APIS
  18. # endif
  19. # if !defined(CL_USE_DEPRECATED_OPENCL_1_2_APIS) && BOOST_COMPUTE_MAX_CL_VERSION < 200
  20. # define CL_USE_DEPRECATED_OPENCL_1_2_APIS
  21. # endif
  22. # if !defined(CL_USE_DEPRECATED_OPENCL_1_1_APIS) && BOOST_COMPUTE_MAX_CL_VERSION < 102
  23. # define CL_USE_DEPRECATED_OPENCL_1_1_APIS
  24. # endif
  25. # if !defined(CL_USE_DEPRECATED_OPENCL_1_0_APIS) && BOOST_COMPUTE_MAX_CL_VERSION < 101
  26. # define CL_USE_DEPRECATED_OPENCL_1_0_APIS
  27. # endif
  28. #endif
  29. #if defined(__APPLE__)
  30. #include <OpenCL/cl.h>
  31. #else
  32. #include <CL/cl.h>
  33. #endif
  34. // select what OpenCL core API versions to use
  35. #if defined(CL_VERSION_1_0)
  36. # define BOOST_COMPUTE_CL_VERSION_1_0
  37. #endif
  38. #if defined(CL_VERSION_1_1)
  39. # if !defined(BOOST_COMPUTE_MAX_CL_VERSION) || BOOST_COMPUTE_MAX_CL_VERSION >= 101
  40. # define BOOST_COMPUTE_CL_VERSION_1_1
  41. # endif
  42. #endif
  43. #if defined(CL_VERSION_1_2)
  44. # if !defined(BOOST_COMPUTE_MAX_CL_VERSION) || BOOST_COMPUTE_MAX_CL_VERSION >= 102
  45. # define BOOST_COMPUTE_CL_VERSION_1_2
  46. # endif
  47. #endif
  48. #if defined(CL_VERSION_2_0)
  49. # if !defined(BOOST_COMPUTE_MAX_CL_VERSION) || BOOST_COMPUTE_MAX_CL_VERSION >= 200
  50. # define BOOST_COMPUTE_CL_VERSION_2_0
  51. # endif
  52. #endif
  53. #if defined(CL_VERSION_2_1)
  54. # if !defined(BOOST_COMPUTE_MAX_CL_VERSION) || BOOST_COMPUTE_MAX_CL_VERSION >= 201
  55. # define BOOST_COMPUTE_CL_VERSION_2_1
  56. # endif
  57. #endif
  58. #if defined(CL_VERSION_2_2)
  59. # if !defined(BOOST_COMPUTE_MAX_CL_VERSION) || BOOST_COMPUTE_MAX_CL_VERSION >= 202
  60. # define BOOST_COMPUTE_CL_VERSION_2_2
  61. # endif
  62. #endif
  63. #endif // BOOST_COMPUTE_CL_HPP