device.hpp 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584
  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_DEVICE_HPP
  11. #define BOOST_COMPUTE_DEVICE_HPP
  12. #include <algorithm>
  13. #include <string>
  14. #include <vector>
  15. #include <boost/algorithm/string/split.hpp>
  16. #include <boost/algorithm/string/classification.hpp>
  17. #include <boost/compute/config.hpp>
  18. #include <boost/compute/exception.hpp>
  19. #include <boost/compute/types/fundamental.hpp>
  20. #include <boost/compute/detail/get_object_info.hpp>
  21. #include <boost/compute/detail/assert_cl_success.hpp>
  22. namespace boost {
  23. namespace compute {
  24. class platform;
  25. /// \class device
  26. /// \brief A compute device.
  27. ///
  28. /// Typical compute devices include GPUs and multi-core CPUs. A list
  29. /// of all compute devices available on a platform can be obtained
  30. /// via the platform::devices() method.
  31. ///
  32. /// The default compute device for the system can be obtained with
  33. /// the system::default_device() method. For example:
  34. ///
  35. /// \snippet test/test_device.cpp default_gpu
  36. ///
  37. /// \see platform, context, command_queue
  38. class device
  39. {
  40. public:
  41. enum type {
  42. cpu = CL_DEVICE_TYPE_CPU,
  43. gpu = CL_DEVICE_TYPE_GPU,
  44. accelerator = CL_DEVICE_TYPE_ACCELERATOR
  45. };
  46. /// Creates a null device object.
  47. device()
  48. : m_id(0)
  49. {
  50. }
  51. /// Creates a new device object for \p id. If \p retain is \c true,
  52. /// the reference count for the device will be incremented.
  53. explicit device(cl_device_id id, bool retain = true)
  54. : m_id(id)
  55. {
  56. #ifdef CL_VERSION_1_2
  57. if(m_id && retain && is_subdevice()){
  58. clRetainDevice(m_id);
  59. }
  60. #else
  61. (void) retain;
  62. #endif
  63. }
  64. /// Creates a new device object as a copy of \p other.
  65. device(const device &other)
  66. : m_id(other.m_id)
  67. {
  68. #ifdef CL_VERSION_1_2
  69. if(m_id && is_subdevice()){
  70. clRetainDevice(m_id);
  71. }
  72. #endif
  73. }
  74. /// Copies the device from \p other to \c *this.
  75. device& operator=(const device &other)
  76. {
  77. if(this != &other){
  78. #ifdef CL_VERSION_1_2
  79. if(m_id && is_subdevice()){
  80. clReleaseDevice(m_id);
  81. }
  82. #endif
  83. m_id = other.m_id;
  84. #ifdef CL_VERSION_1_2
  85. if(m_id && is_subdevice()){
  86. clRetainDevice(m_id);
  87. }
  88. #endif
  89. }
  90. return *this;
  91. }
  92. #ifndef BOOST_COMPUTE_NO_RVALUE_REFERENCES
  93. /// Move-constructs a new device object from \p other.
  94. device(device&& other) BOOST_NOEXCEPT
  95. : m_id(other.m_id)
  96. {
  97. other.m_id = 0;
  98. }
  99. /// Move-assigns the device from \p other to \c *this.
  100. device& operator=(device&& other) BOOST_NOEXCEPT
  101. {
  102. #ifdef CL_VERSION_1_2
  103. if(m_id && is_subdevice()){
  104. clReleaseDevice(m_id);
  105. }
  106. #endif
  107. m_id = other.m_id;
  108. other.m_id = 0;
  109. return *this;
  110. }
  111. #endif // BOOST_COMPUTE_NO_RVALUE_REFERENCES
  112. /// Destroys the device object.
  113. ~device()
  114. {
  115. #ifdef CL_VERSION_1_2
  116. if(m_id && is_subdevice()){
  117. BOOST_COMPUTE_ASSERT_CL_SUCCESS(
  118. clReleaseDevice(m_id)
  119. );
  120. }
  121. #endif
  122. }
  123. /// Returns the ID of the device.
  124. cl_device_id id() const
  125. {
  126. return m_id;
  127. }
  128. /// Returns a reference to the underlying OpenCL device id.
  129. cl_device_id& get() const
  130. {
  131. return const_cast<cl_device_id&>(m_id);
  132. }
  133. /// Returns the type of the device.
  134. cl_device_type type() const
  135. {
  136. return get_info<cl_device_type>(CL_DEVICE_TYPE);
  137. }
  138. #ifdef BOOST_COMPUTE_DOXYGEN_INVOKED
  139. /// Returns the platform for the device.
  140. platform platform() const;
  141. #else
  142. boost::compute::platform platform() const;
  143. #endif
  144. /// Returns the name of the device.
  145. std::string name() const
  146. {
  147. return get_info<std::string>(CL_DEVICE_NAME);
  148. }
  149. /// Returns the name of the vendor for the device.
  150. std::string vendor() const
  151. {
  152. return get_info<std::string>(CL_DEVICE_VENDOR);
  153. }
  154. /// Returns the device profile string.
  155. std::string profile() const
  156. {
  157. return get_info<std::string>(CL_DEVICE_PROFILE);
  158. }
  159. /// Returns the device version string.
  160. std::string version() const
  161. {
  162. return get_info<std::string>(CL_DEVICE_VERSION);
  163. }
  164. /// Returns the driver version string.
  165. std::string driver_version() const
  166. {
  167. return get_info<std::string>(CL_DRIVER_VERSION);
  168. }
  169. /// Returns a list of extensions supported by the device.
  170. std::vector<std::string> extensions() const
  171. {
  172. std::string extensions_string =
  173. get_info<std::string>(CL_DEVICE_EXTENSIONS);
  174. std::vector<std::string> extensions_vector;
  175. boost::split(extensions_vector,
  176. extensions_string,
  177. boost::is_any_of("\t "),
  178. boost::token_compress_on);
  179. return extensions_vector;
  180. }
  181. /// Returns \c true if the device supports the extension with
  182. /// \p name.
  183. bool supports_extension(const std::string &name) const
  184. {
  185. const std::vector<std::string> extensions = this->extensions();
  186. return std::find(
  187. extensions.begin(), extensions.end(), name) != extensions.end();
  188. }
  189. /// Returns the number of address bits.
  190. uint_ address_bits() const
  191. {
  192. return get_info<uint_>(CL_DEVICE_ADDRESS_BITS);
  193. }
  194. /// Returns the global memory size in bytes.
  195. ulong_ global_memory_size() const
  196. {
  197. return get_info<ulong_>(CL_DEVICE_GLOBAL_MEM_SIZE);
  198. }
  199. /// Returns the local memory size in bytes.
  200. ulong_ local_memory_size() const
  201. {
  202. return get_info<ulong_>(CL_DEVICE_LOCAL_MEM_SIZE);
  203. }
  204. /// Returns the clock frequency for the device's compute units.
  205. uint_ clock_frequency() const
  206. {
  207. return get_info<uint_>(CL_DEVICE_MAX_CLOCK_FREQUENCY);
  208. }
  209. /// Returns the number of compute units in the device.
  210. uint_ compute_units() const
  211. {
  212. return get_info<uint_>(CL_DEVICE_MAX_COMPUTE_UNITS);
  213. }
  214. /// \internal_
  215. ulong_ max_memory_alloc_size() const
  216. {
  217. return get_info<ulong_>(CL_DEVICE_MAX_MEM_ALLOC_SIZE);
  218. }
  219. /// \internal_
  220. size_t max_work_group_size() const
  221. {
  222. return get_info<size_t>(CL_DEVICE_MAX_WORK_GROUP_SIZE);
  223. }
  224. /// \internal_
  225. uint_ max_work_item_dimensions() const
  226. {
  227. return get_info<uint_>(CL_DEVICE_MAX_WORK_ITEM_DIMENSIONS);
  228. }
  229. /// Returns the preferred vector width for type \c T.
  230. template<class T>
  231. uint_ preferred_vector_width() const
  232. {
  233. return 0;
  234. }
  235. /// Returns the profiling timer resolution in nanoseconds.
  236. size_t profiling_timer_resolution() const
  237. {
  238. return get_info<size_t>(CL_DEVICE_PROFILING_TIMER_RESOLUTION);
  239. }
  240. /// Returns \c true if the device is a sub-device.
  241. bool is_subdevice() const
  242. {
  243. #if defined(CL_VERSION_1_2)
  244. try {
  245. return get_info<cl_device_id>(CL_DEVICE_PARENT_DEVICE) != 0;
  246. }
  247. catch(opencl_error&){
  248. // the get_info() call above will throw if the device's opencl version
  249. // is less than 1.2 (in which case it can't be a sub-device).
  250. return false;
  251. }
  252. #else
  253. return false;
  254. #endif
  255. }
  256. /// Returns information about the device.
  257. ///
  258. /// For example, to get the number of compute units:
  259. /// \code
  260. /// device.get_info<cl_uint>(CL_DEVICE_MAX_COMPUTE_UNITS);
  261. /// \endcode
  262. ///
  263. /// Alternatively, the template-specialized version can be used which
  264. /// automatically determines the result type:
  265. /// \code
  266. /// device.get_info<CL_DEVICE_MAX_COMPUTE_UNITS>();
  267. /// \endcode
  268. ///
  269. /// \see_opencl_ref{clGetDeviceInfo}
  270. template<class T>
  271. T get_info(cl_device_info info) const
  272. {
  273. return detail::get_object_info<T>(clGetDeviceInfo, m_id, info);
  274. }
  275. /// \overload
  276. template<int Enum>
  277. typename detail::get_object_info_type<device, Enum>::type
  278. get_info() const;
  279. #if defined(CL_VERSION_1_2) || defined(BOOST_COMPUTE_DOXYGEN_INVOKED)
  280. /// Partitions the device into multiple sub-devices according to
  281. /// \p properties.
  282. ///
  283. /// \opencl_version_warning{1,2}
  284. std::vector<device>
  285. partition(const cl_device_partition_property *properties) const
  286. {
  287. // get sub-device count
  288. uint_ count = 0;
  289. int_ ret = clCreateSubDevices(m_id, properties, 0, 0, &count);
  290. if(ret != CL_SUCCESS){
  291. BOOST_THROW_EXCEPTION(opencl_error(ret));
  292. }
  293. // get sub-device ids
  294. std::vector<cl_device_id> ids(count);
  295. ret = clCreateSubDevices(m_id, properties, count, &ids[0], 0);
  296. if(ret != CL_SUCCESS){
  297. BOOST_THROW_EXCEPTION(opencl_error(ret));
  298. }
  299. // convert ids to device objects
  300. std::vector<device> devices(count);
  301. for(size_t i = 0; i < count; i++){
  302. devices[i] = device(ids[i], false);
  303. }
  304. return devices;
  305. }
  306. /// \opencl_version_warning{1,2}
  307. std::vector<device> partition_equally(size_t count) const
  308. {
  309. cl_device_partition_property properties[] = {
  310. CL_DEVICE_PARTITION_EQUALLY,
  311. static_cast<cl_device_partition_property>(count),
  312. 0
  313. };
  314. return partition(properties);
  315. }
  316. /// \opencl_version_warning{1,2}
  317. std::vector<device>
  318. partition_by_counts(const std::vector<size_t> &counts) const
  319. {
  320. std::vector<cl_device_partition_property> properties;
  321. properties.push_back(CL_DEVICE_PARTITION_BY_COUNTS);
  322. for(size_t i = 0; i < counts.size(); i++){
  323. properties.push_back(
  324. static_cast<cl_device_partition_property>(counts[i]));
  325. }
  326. properties.push_back(CL_DEVICE_PARTITION_BY_COUNTS_LIST_END);
  327. properties.push_back(0);
  328. return partition(&properties[0]);
  329. }
  330. /// \opencl_version_warning{1,2}
  331. std::vector<device>
  332. partition_by_affinity_domain(cl_device_affinity_domain domain) const
  333. {
  334. cl_device_partition_property properties[] = {
  335. CL_DEVICE_PARTITION_BY_AFFINITY_DOMAIN,
  336. static_cast<cl_device_partition_property>(domain),
  337. 0
  338. };
  339. return partition(properties);
  340. }
  341. #endif // CL_VERSION_1_2
  342. /// Returns \c true if the device is the same at \p other.
  343. bool operator==(const device &other) const
  344. {
  345. return m_id == other.m_id;
  346. }
  347. /// Returns \c true if the device is different from \p other.
  348. bool operator!=(const device &other) const
  349. {
  350. return m_id != other.m_id;
  351. }
  352. /// \internal_
  353. bool check_version(int major, int minor) const
  354. {
  355. std::stringstream stream;
  356. stream << version();
  357. int actual_major, actual_minor;
  358. stream.ignore(7); // 'OpenCL '
  359. stream >> actual_major;
  360. stream.ignore(1); // '.'
  361. stream >> actual_minor;
  362. return actual_major > major ||
  363. (actual_major == major && actual_minor >= minor);
  364. }
  365. private:
  366. cl_device_id m_id;
  367. };
  368. /// \internal_
  369. template<>
  370. inline uint_ device::preferred_vector_width<short_>() const
  371. {
  372. return get_info<uint_>(CL_DEVICE_PREFERRED_VECTOR_WIDTH_SHORT);
  373. }
  374. /// \internal_
  375. template<>
  376. inline uint_ device::preferred_vector_width<int_>() const
  377. {
  378. return get_info<uint_>(CL_DEVICE_PREFERRED_VECTOR_WIDTH_INT);
  379. }
  380. /// \internal_
  381. template<>
  382. inline uint_ device::preferred_vector_width<long_>() const
  383. {
  384. return get_info<uint_>(CL_DEVICE_PREFERRED_VECTOR_WIDTH_LONG);
  385. }
  386. /// \internal_
  387. template<>
  388. inline uint_ device::preferred_vector_width<float_>() const
  389. {
  390. return get_info<uint_>(CL_DEVICE_PREFERRED_VECTOR_WIDTH_FLOAT);
  391. }
  392. /// \internal_
  393. template<>
  394. inline uint_ device::preferred_vector_width<double_>() const
  395. {
  396. return get_info<uint_>(CL_DEVICE_PREFERRED_VECTOR_WIDTH_DOUBLE);
  397. }
  398. /// \internal_ define get_info() specializations for device
  399. BOOST_COMPUTE_DETAIL_DEFINE_GET_INFO_SPECIALIZATIONS(device,
  400. ((cl_uint, CL_DEVICE_ADDRESS_BITS))
  401. ((bool, CL_DEVICE_AVAILABLE))
  402. ((bool, CL_DEVICE_COMPILER_AVAILABLE))
  403. ((bool, CL_DEVICE_ENDIAN_LITTLE))
  404. ((bool, CL_DEVICE_ERROR_CORRECTION_SUPPORT))
  405. ((cl_device_exec_capabilities, CL_DEVICE_EXECUTION_CAPABILITIES))
  406. ((std::string, CL_DEVICE_EXTENSIONS))
  407. ((cl_ulong, CL_DEVICE_GLOBAL_MEM_CACHE_SIZE))
  408. ((cl_device_mem_cache_type, CL_DEVICE_GLOBAL_MEM_CACHE_TYPE))
  409. ((cl_ulong, CL_DEVICE_GLOBAL_MEM_CACHELINE_SIZE))
  410. ((cl_ulong, CL_DEVICE_GLOBAL_MEM_SIZE))
  411. ((bool, CL_DEVICE_IMAGE_SUPPORT))
  412. ((size_t, CL_DEVICE_IMAGE2D_MAX_HEIGHT))
  413. ((size_t, CL_DEVICE_IMAGE2D_MAX_WIDTH))
  414. ((size_t, CL_DEVICE_IMAGE3D_MAX_DEPTH))
  415. ((size_t, CL_DEVICE_IMAGE3D_MAX_HEIGHT))
  416. ((size_t, CL_DEVICE_IMAGE3D_MAX_WIDTH))
  417. ((cl_ulong, CL_DEVICE_LOCAL_MEM_SIZE))
  418. ((cl_device_local_mem_type, CL_DEVICE_LOCAL_MEM_TYPE))
  419. ((cl_uint, CL_DEVICE_MAX_CLOCK_FREQUENCY))
  420. ((cl_uint, CL_DEVICE_MAX_COMPUTE_UNITS))
  421. ((cl_uint, CL_DEVICE_MAX_CONSTANT_ARGS))
  422. ((cl_ulong, CL_DEVICE_MAX_CONSTANT_BUFFER_SIZE))
  423. ((cl_ulong, CL_DEVICE_MAX_MEM_ALLOC_SIZE))
  424. ((size_t, CL_DEVICE_MAX_PARAMETER_SIZE))
  425. ((cl_uint, CL_DEVICE_MAX_READ_IMAGE_ARGS))
  426. ((cl_uint, CL_DEVICE_MAX_SAMPLERS))
  427. ((size_t, CL_DEVICE_MAX_WORK_GROUP_SIZE))
  428. ((cl_uint, CL_DEVICE_MAX_WORK_ITEM_DIMENSIONS))
  429. ((std::vector<size_t>, CL_DEVICE_MAX_WORK_ITEM_SIZES))
  430. ((cl_uint, CL_DEVICE_MAX_WRITE_IMAGE_ARGS))
  431. ((cl_uint, CL_DEVICE_MEM_BASE_ADDR_ALIGN))
  432. ((cl_uint, CL_DEVICE_MIN_DATA_TYPE_ALIGN_SIZE))
  433. ((std::string, CL_DEVICE_NAME))
  434. ((cl_platform_id, CL_DEVICE_PLATFORM))
  435. ((cl_uint, CL_DEVICE_PREFERRED_VECTOR_WIDTH_CHAR))
  436. ((cl_uint, CL_DEVICE_PREFERRED_VECTOR_WIDTH_SHORT))
  437. ((cl_uint, CL_DEVICE_PREFERRED_VECTOR_WIDTH_INT))
  438. ((cl_uint, CL_DEVICE_PREFERRED_VECTOR_WIDTH_LONG))
  439. ((cl_uint, CL_DEVICE_PREFERRED_VECTOR_WIDTH_FLOAT))
  440. ((cl_uint, CL_DEVICE_PREFERRED_VECTOR_WIDTH_DOUBLE))
  441. ((std::string, CL_DEVICE_PROFILE))
  442. ((size_t, CL_DEVICE_PROFILING_TIMER_RESOLUTION))
  443. ((cl_command_queue_properties, CL_DEVICE_QUEUE_PROPERTIES))
  444. ((cl_device_fp_config, CL_DEVICE_SINGLE_FP_CONFIG))
  445. ((cl_device_type, CL_DEVICE_TYPE))
  446. ((std::string, CL_DEVICE_VENDOR))
  447. ((cl_uint, CL_DEVICE_VENDOR_ID))
  448. ((std::string, CL_DEVICE_VERSION))
  449. ((std::string, CL_DRIVER_VERSION))
  450. )
  451. #ifdef CL_DEVICE_DOUBLE_FP_CONFIG
  452. BOOST_COMPUTE_DETAIL_DEFINE_GET_INFO_SPECIALIZATIONS(device,
  453. ((cl_device_fp_config, CL_DEVICE_DOUBLE_FP_CONFIG))
  454. )
  455. #endif
  456. #ifdef CL_DEVICE_HALF_FP_CONFIG
  457. BOOST_COMPUTE_DETAIL_DEFINE_GET_INFO_SPECIALIZATIONS(device,
  458. ((cl_device_fp_config, CL_DEVICE_HALF_FP_CONFIG))
  459. )
  460. #endif
  461. #ifdef CL_VERSION_1_1
  462. BOOST_COMPUTE_DETAIL_DEFINE_GET_INFO_SPECIALIZATIONS(device,
  463. ((bool, CL_DEVICE_HOST_UNIFIED_MEMORY))
  464. ((cl_uint, CL_DEVICE_NATIVE_VECTOR_WIDTH_CHAR))
  465. ((cl_uint, CL_DEVICE_NATIVE_VECTOR_WIDTH_SHORT))
  466. ((cl_uint, CL_DEVICE_NATIVE_VECTOR_WIDTH_INT))
  467. ((cl_uint, CL_DEVICE_NATIVE_VECTOR_WIDTH_LONG))
  468. ((cl_uint, CL_DEVICE_NATIVE_VECTOR_WIDTH_FLOAT))
  469. ((cl_uint, CL_DEVICE_NATIVE_VECTOR_WIDTH_DOUBLE))
  470. ((std::string, CL_DEVICE_OPENCL_C_VERSION))
  471. )
  472. #endif // CL_VERSION_1_1
  473. #ifdef CL_VERSION_1_2
  474. BOOST_COMPUTE_DETAIL_DEFINE_GET_INFO_SPECIALIZATIONS(device,
  475. ((std::string, CL_DEVICE_BUILT_IN_KERNELS))
  476. ((bool, CL_DEVICE_LINKER_AVAILABLE))
  477. ((cl_device_id, CL_DEVICE_PARENT_DEVICE))
  478. ((cl_uint, CL_DEVICE_PARTITION_MAX_SUB_DEVICES))
  479. ((cl_device_partition_property, CL_DEVICE_PARTITION_PROPERTIES))
  480. ((cl_device_affinity_domain, CL_DEVICE_PARTITION_AFFINITY_DOMAIN))
  481. ((cl_device_partition_property, CL_DEVICE_PARTITION_TYPE))
  482. ((size_t, CL_DEVICE_PRINTF_BUFFER_SIZE))
  483. ((bool, CL_DEVICE_PREFERRED_INTEROP_USER_SYNC))
  484. ((cl_uint, CL_DEVICE_REFERENCE_COUNT))
  485. )
  486. #endif // CL_VERSION_1_2
  487. #ifdef CL_VERSION_2_0
  488. BOOST_COMPUTE_DETAIL_DEFINE_GET_INFO_SPECIALIZATIONS(device,
  489. ((size_t, CL_DEVICE_GLOBAL_VARIABLE_PREFERRED_TOTAL_SIZE))
  490. ((size_t, CL_DEVICE_MAX_GLOBAL_VARIABLE_SIZE))
  491. ((cl_uint, CL_DEVICE_MAX_ON_DEVICE_EVENTS))
  492. ((cl_uint, CL_DEVICE_MAX_ON_DEVICE_QUEUES))
  493. ((cl_uint, CL_DEVICE_MAX_PIPE_ARGS))
  494. ((cl_uint, CL_DEVICE_MAX_READ_WRITE_IMAGE_ARGS))
  495. ((cl_uint, CL_DEVICE_PIPE_MAX_ACTIVE_RESERVATIONS))
  496. ((cl_uint, CL_DEVICE_PIPE_MAX_PACKET_SIZE))
  497. ((cl_uint, CL_DEVICE_PREFERRED_GLOBAL_ATOMIC_ALIGNMENT))
  498. ((cl_uint, CL_DEVICE_PREFERRED_LOCAL_ATOMIC_ALIGNMENT))
  499. ((cl_uint, CL_DEVICE_PREFERRED_PLATFORM_ATOMIC_ALIGNMENT))
  500. ((cl_uint, CL_DEVICE_QUEUE_ON_DEVICE_MAX_SIZE))
  501. ((cl_uint, CL_DEVICE_QUEUE_ON_DEVICE_PREFERRED_SIZE))
  502. ((cl_command_queue_properties, CL_DEVICE_QUEUE_ON_DEVICE_PROPERTIES))
  503. ((cl_device_svm_capabilities, CL_DEVICE_SVM_CAPABILITIES))
  504. ((cl_uint, CL_DEVICE_IMAGE_BASE_ADDRESS_ALIGNMENT))
  505. ((cl_uint, CL_DEVICE_IMAGE_PITCH_ALIGNMENT))
  506. )
  507. #endif // CL_VERSION_2_0
  508. } // end compute namespace
  509. } // end boost namespace
  510. #endif // BOOST_COMPUTE_DEVICE_HPP