cl_versions.hpp 3.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. //---------------------------------------------------------------------------//
  2. // Copyright (c) 2018 Jakub Szuppe <j.szuppe@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_DETAIL_CL_VERSION_HPP
  11. #define BOOST_COMPUTE_DETAIL_CL_VERSION_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(BOOST_COMPUTE_MAX_CL_VERSION) && !defined(CL_TARGET_OPENCL_VERSION)
  30. # if BOOST_COMPUTE_MAX_CL_VERSION == 201
  31. # define CL_TARGET_OPENCL_VERSION 210
  32. # elif BOOST_COMPUTE_MAX_CL_VERSION == 200
  33. # define CL_TARGET_OPENCL_VERSION 200
  34. # elif BOOST_COMPUTE_MAX_CL_VERSION == 102
  35. # define CL_TARGET_OPENCL_VERSION 120
  36. # elif BOOST_COMPUTE_MAX_CL_VERSION == 101
  37. # define CL_TARGET_OPENCL_VERSION 110
  38. # elif BOOST_COMPUTE_MAX_CL_VERSION == 100
  39. # define CL_TARGET_OPENCL_VERSION 100
  40. # else
  41. # define CL_TARGET_OPENCL_VERSION 220
  42. # endif
  43. #endif
  44. #if defined(BOOST_COMPUTE_MAX_CL_VERSION) && defined(CL_TARGET_OPENCL_VERSION)
  45. # if BOOST_COMPUTE_MAX_CL_VERSION == 202 && CL_TARGET_OPENCL_VERSION != 220
  46. # error "Boost.Compute: CL_TARGET_OPENCL_VERSION definition does not match BOOST_COMPUTE_MAX_CL_VERSION"
  47. # elif BOOST_COMPUTE_MAX_CL_VERSION == 201 && CL_TARGET_OPENCL_VERSION != 210
  48. # error "Boost.Compute: CL_TARGET_OPENCL_VERSION definition does not match BOOST_COMPUTE_MAX_CL_VERSION"
  49. # elif BOOST_COMPUTE_MAX_CL_VERSION == 200 && CL_TARGET_OPENCL_VERSION != 200
  50. # error "Boost.Compute: CL_TARGET_OPENCL_VERSION definition does not match BOOST_COMPUTE_MAX_CL_VERSION"
  51. # elif BOOST_COMPUTE_MAX_CL_VERSION == 102 && CL_TARGET_OPENCL_VERSION != 120
  52. # error "Boost.Compute: CL_TARGET_OPENCL_VERSION definition does not match BOOST_COMPUTE_MAX_CL_VERSION"
  53. # elif BOOST_COMPUTE_MAX_CL_VERSION == 101 && CL_TARGET_OPENCL_VERSION != 110
  54. # error "Boost.Compute: CL_TARGET_OPENCL_VERSION definition does not match BOOST_COMPUTE_MAX_CL_VERSION"
  55. # elif BOOST_COMPUTE_MAX_CL_VERSION == 100 && CL_TARGET_OPENCL_VERSION != 100
  56. # error "Boost.Compute: CL_TARGET_OPENCL_VERSION definition does not match BOOST_COMPUTE_MAX_CL_VERSION"
  57. # endif
  58. #endif
  59. #endif // BOOST_COMPUTE_DETAIL_CL_VERSION_HPP