devices.c 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299
  1. /* StarPU --- Runtime system for heterogeneous multicore architectures.
  2. *
  3. * Copyright (C) 2010-2012 University of Bordeaux
  4. * Copyright (C) 2012 CNRS
  5. * Copyright (C) 2012 Vincent Danjean <Vincent.Danjean@ens-lyon.org>
  6. *
  7. * StarPU is free software; you can redistribute it and/or modify
  8. * it under the terms of the GNU Lesser General Public License as published by
  9. * the Free Software Foundation; either version 2.1 of the License, or (at
  10. * your option) any later version.
  11. *
  12. * StarPU is distributed in the hope that it will be useful, but
  13. * WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  15. *
  16. * See the GNU Lesser General Public License in COPYING.LGPL for more details.
  17. */
  18. #include "socl.h"
  19. #include "devices.h"
  20. // OpenCL 1.0 : Mandatory format: major_number.minor_number
  21. const char * __attribute__ ((aligned (16))) SOCL_DRIVER_VERSION = "0.1";
  22. const cl_uint __attribute__ ((aligned (16))) SOCL_DEVICE_VENDOR_ID = 666;
  23. const struct _cl_device_id socl_devices[] = {
  24. {
  25. .dispatch = &socl_master_dispatch,
  26. .type = CL_DEVICE_TYPE_CPU,
  27. .max_compute_units = 1,
  28. .max_work_item_dimensions = 3,
  29. .max_work_item_sizes = {1,1,1},
  30. .max_work_group_size = 1,
  31. .preferred_vector_widths = {16,8,4,2,4,2},
  32. .max_clock_frequency = 3000,
  33. .address_bits = 64,
  34. .max_mem_alloc_size = 1024*1024*1024,
  35. .image_support = CL_FALSE,
  36. .max_parameter_size = 256,
  37. .mem_base_addr_align = 0,
  38. .min_data_type_align_size = 0,
  39. .single_fp_config = CL_FP_ROUND_TO_NEAREST | CL_FP_INF_NAN,
  40. .global_mem_cache_type = CL_READ_WRITE_CACHE,
  41. .global_mem_cacheline_size = 128,
  42. .global_mem_cache_size = 16*1024,
  43. .global_mem_size = (cl_ulong)4*1024*1024*1024,
  44. .max_constant_args = 8,
  45. .local_mem_type = CL_GLOBAL,
  46. .local_mem_size = 16*1024,
  47. .error_correction_support = CL_FALSE,
  48. .profiling_timer_resolution = 100,
  49. .endian_little = CL_TRUE,
  50. .available = CL_TRUE,
  51. .compiler_available = CL_TRUE,
  52. .execution_capabilities = CL_EXEC_KERNEL,
  53. .queue_properties = CL_QUEUE_OUT_OF_ORDER_EXEC_MODE_ENABLE | CL_QUEUE_PROFILING_ENABLE,
  54. .name = "StarPU virtual CPU 1",
  55. .extensions = ""
  56. },
  57. {
  58. .dispatch = &socl_master_dispatch,
  59. .type = CL_DEVICE_TYPE_GPU,
  60. .max_compute_units = 12,
  61. .max_work_item_dimensions = 3,
  62. .max_work_item_sizes = {512,512,64},
  63. .max_work_group_size = 512,
  64. .preferred_vector_widths = {16,8,4,2,4,2},
  65. .max_clock_frequency = 1600,
  66. .address_bits = 32,
  67. .max_mem_alloc_size = 100*1024*1024,
  68. .image_support = CL_FALSE,
  69. .max_parameter_size = 256,
  70. .mem_base_addr_align = 0,
  71. .min_data_type_align_size = 0,
  72. .single_fp_config = CL_FP_ROUND_TO_NEAREST | CL_FP_INF_NAN,
  73. .global_mem_cache_type = CL_NONE,
  74. .global_mem_cacheline_size = 0,
  75. .global_mem_cache_size = 0,
  76. .global_mem_size = (cl_ulong)500*1024*1024,
  77. .max_constant_args = 8,
  78. .local_mem_type = CL_LOCAL,
  79. .local_mem_size = 16*1024,
  80. .error_correction_support = CL_FALSE,
  81. .profiling_timer_resolution = 10,
  82. .endian_little = CL_TRUE,
  83. .available = CL_TRUE,
  84. .compiler_available = CL_TRUE,
  85. .execution_capabilities = CL_EXEC_KERNEL,
  86. .queue_properties = CL_QUEUE_OUT_OF_ORDER_EXEC_MODE_ENABLE | CL_QUEUE_PROFILING_ENABLE,
  87. .name = "StarPU virtual GPU 1",
  88. .extensions = ""
  89. },
  90. {
  91. .dispatch = &socl_master_dispatch,
  92. .type = CL_DEVICE_TYPE_GPU,
  93. .max_compute_units = 12,
  94. .max_work_item_dimensions = 3,
  95. .max_work_item_sizes = {512,512,64},
  96. .max_work_group_size = 512,
  97. .preferred_vector_widths = {16,8,4,2,4,2},
  98. .max_clock_frequency = 1600,
  99. .address_bits = 32,
  100. .max_mem_alloc_size = 100*1024*1024,
  101. .image_support = CL_FALSE,
  102. .max_parameter_size = 256,
  103. .mem_base_addr_align = 0,
  104. .min_data_type_align_size = 0,
  105. .single_fp_config = CL_FP_ROUND_TO_NEAREST | CL_FP_INF_NAN,
  106. .global_mem_cache_type = CL_NONE,
  107. .global_mem_cacheline_size = 0,
  108. .global_mem_cache_size = 0,
  109. .global_mem_size = (cl_ulong)500*1024*1024,
  110. .max_constant_args = 8,
  111. .local_mem_type = CL_LOCAL,
  112. .local_mem_size = 16*1024,
  113. .error_correction_support = CL_FALSE,
  114. .profiling_timer_resolution = 10,
  115. .endian_little = CL_TRUE,
  116. .available = CL_TRUE,
  117. .compiler_available = CL_TRUE,
  118. .execution_capabilities = CL_EXEC_KERNEL,
  119. .queue_properties = CL_QUEUE_OUT_OF_ORDER_EXEC_MODE_ENABLE | CL_QUEUE_PROFILING_ENABLE,
  120. .name = "StarPU virtual GPU 2",
  121. .extensions = ""
  122. },
  123. {
  124. .dispatch = &socl_master_dispatch,
  125. .type = CL_DEVICE_TYPE_GPU,
  126. .max_compute_units = 12,
  127. .max_work_item_dimensions = 3,
  128. .max_work_item_sizes = {512,512,64},
  129. .max_work_group_size = 512,
  130. .preferred_vector_widths = {16,8,4,2,4,2},
  131. .max_clock_frequency = 1600,
  132. .address_bits = 32,
  133. .max_mem_alloc_size = 100*1024*1024,
  134. .image_support = CL_FALSE,
  135. .max_parameter_size = 256,
  136. .mem_base_addr_align = 0,
  137. .min_data_type_align_size = 0,
  138. .single_fp_config = CL_FP_ROUND_TO_NEAREST | CL_FP_INF_NAN,
  139. .global_mem_cache_type = CL_NONE,
  140. .global_mem_cacheline_size = 0,
  141. .global_mem_cache_size = 0,
  142. .global_mem_size = (cl_ulong)500*1024*1024,
  143. .max_constant_args = 8,
  144. .local_mem_type = CL_LOCAL,
  145. .local_mem_size = 16*1024,
  146. .error_correction_support = CL_FALSE,
  147. .profiling_timer_resolution = 10,
  148. .endian_little = CL_TRUE,
  149. .available = CL_TRUE,
  150. .compiler_available = CL_TRUE,
  151. .execution_capabilities = CL_EXEC_KERNEL,
  152. .queue_properties = CL_QUEUE_OUT_OF_ORDER_EXEC_MODE_ENABLE | CL_QUEUE_PROFILING_ENABLE,
  153. .name = "StarPU virtual GPU 3",
  154. .extensions = ""
  155. },
  156. {
  157. .dispatch = &socl_master_dispatch,
  158. .type = CL_DEVICE_TYPE_GPU,
  159. .max_compute_units = 12,
  160. .max_work_item_dimensions = 3,
  161. .max_work_item_sizes = {512,512,64},
  162. .max_work_group_size = 512,
  163. .preferred_vector_widths = {16,8,4,2,4,2},
  164. .max_clock_frequency = 1600,
  165. .address_bits = 32,
  166. .max_mem_alloc_size = 100*1024*1024,
  167. .image_support = CL_FALSE,
  168. .max_parameter_size = 256,
  169. .mem_base_addr_align = 0,
  170. .min_data_type_align_size = 0,
  171. .single_fp_config = CL_FP_ROUND_TO_NEAREST | CL_FP_INF_NAN,
  172. .global_mem_cache_type = CL_NONE,
  173. .global_mem_cacheline_size = 0,
  174. .global_mem_cache_size = 0,
  175. .global_mem_size = (cl_ulong)500*1024*1024,
  176. .max_constant_args = 8,
  177. .local_mem_type = CL_LOCAL,
  178. .local_mem_size = 16*1024,
  179. .error_correction_support = CL_FALSE,
  180. .profiling_timer_resolution = 10,
  181. .endian_little = CL_TRUE,
  182. .available = CL_TRUE,
  183. .compiler_available = CL_TRUE,
  184. .execution_capabilities = CL_EXEC_KERNEL,
  185. .queue_properties = CL_QUEUE_OUT_OF_ORDER_EXEC_MODE_ENABLE | CL_QUEUE_PROFILING_ENABLE,
  186. .name = "StarPU virtual GPU 4",
  187. .extensions = ""
  188. },
  189. {
  190. .dispatch = &socl_master_dispatch,
  191. .type = CL_DEVICE_TYPE_GPU,
  192. .max_compute_units = 12,
  193. .max_work_item_dimensions = 3,
  194. .max_work_item_sizes = {512,512,64},
  195. .max_work_group_size = 512,
  196. .preferred_vector_widths = {16,8,4,2,4,2},
  197. .max_clock_frequency = 1600,
  198. .address_bits = 32,
  199. .max_mem_alloc_size = 100*1024*1024,
  200. .image_support = CL_FALSE,
  201. .max_parameter_size = 256,
  202. .mem_base_addr_align = 0,
  203. .min_data_type_align_size = 0,
  204. .single_fp_config = CL_FP_ROUND_TO_NEAREST | CL_FP_INF_NAN,
  205. .global_mem_cache_type = CL_NONE,
  206. .global_mem_cacheline_size = 0,
  207. .global_mem_cache_size = 0,
  208. .global_mem_size = (cl_ulong)500*1024*1024,
  209. .max_constant_args = 8,
  210. .local_mem_type = CL_LOCAL,
  211. .local_mem_size = 16*1024,
  212. .error_correction_support = CL_FALSE,
  213. .profiling_timer_resolution = 10,
  214. .endian_little = CL_TRUE,
  215. .available = CL_TRUE,
  216. .compiler_available = CL_TRUE,
  217. .execution_capabilities = CL_EXEC_KERNEL,
  218. .queue_properties = CL_QUEUE_OUT_OF_ORDER_EXEC_MODE_ENABLE | CL_QUEUE_PROFILING_ENABLE,
  219. .name = "StarPU virtual GPU 5",
  220. .extensions = ""
  221. },
  222. {
  223. .dispatch = &socl_master_dispatch,
  224. .type = CL_DEVICE_TYPE_GPU,
  225. .max_compute_units = 12,
  226. .max_work_item_dimensions = 3,
  227. .max_work_item_sizes = {512,512,64},
  228. .max_work_group_size = 512,
  229. .preferred_vector_widths = {16,8,4,2,4,2},
  230. .max_clock_frequency = 1600,
  231. .address_bits = 32,
  232. .max_mem_alloc_size = 100*1024*1024,
  233. .image_support = CL_FALSE,
  234. .max_parameter_size = 256,
  235. .mem_base_addr_align = 0,
  236. .min_data_type_align_size = 0,
  237. .single_fp_config = CL_FP_ROUND_TO_NEAREST | CL_FP_INF_NAN,
  238. .global_mem_cache_type = CL_NONE,
  239. .global_mem_cacheline_size = 0,
  240. .global_mem_cache_size = 0,
  241. .global_mem_size = (cl_ulong)500*1024*1024,
  242. .max_constant_args = 8,
  243. .local_mem_type = CL_LOCAL,
  244. .local_mem_size = 16*1024,
  245. .error_correction_support = CL_FALSE,
  246. .profiling_timer_resolution = 10,
  247. .endian_little = CL_TRUE,
  248. .available = CL_TRUE,
  249. .compiler_available = CL_TRUE,
  250. .execution_capabilities = CL_EXEC_KERNEL,
  251. .queue_properties = CL_QUEUE_OUT_OF_ORDER_EXEC_MODE_ENABLE | CL_QUEUE_PROFILING_ENABLE,
  252. .name = "StarPU virtual GPU 6",
  253. .extensions = ""
  254. },
  255. {
  256. .dispatch = &socl_master_dispatch,
  257. .type = CL_DEVICE_TYPE_GPU,
  258. .max_compute_units = 12,
  259. .max_work_item_dimensions = 3,
  260. .max_work_item_sizes = {512,512,64},
  261. .max_work_group_size = 512,
  262. .preferred_vector_widths = {16,8,4,2,4,2},
  263. .max_clock_frequency = 1600,
  264. .address_bits = 32,
  265. .max_mem_alloc_size = 100*1024*1024,
  266. .image_support = CL_FALSE,
  267. .max_parameter_size = 256,
  268. .mem_base_addr_align = 0,
  269. .min_data_type_align_size = 0,
  270. .single_fp_config = CL_FP_ROUND_TO_NEAREST | CL_FP_INF_NAN,
  271. .global_mem_cache_type = CL_NONE,
  272. .global_mem_cacheline_size = 0,
  273. .global_mem_cache_size = 0,
  274. .global_mem_size = (cl_ulong)500*1024*1024,
  275. .max_constant_args = 8,
  276. .local_mem_type = CL_LOCAL,
  277. .local_mem_size = 16*1024,
  278. .error_correction_support = CL_FALSE,
  279. .profiling_timer_resolution = 10,
  280. .endian_little = CL_TRUE,
  281. .available = CL_TRUE,
  282. .compiler_available = CL_TRUE,
  283. .execution_capabilities = CL_EXEC_KERNEL,
  284. .queue_properties = CL_QUEUE_OUT_OF_ORDER_EXEC_MODE_ENABLE | CL_QUEUE_PROFILING_ENABLE,
  285. .name = "StarPU virtual GPU 7",
  286. .extensions = ""
  287. }
  288. };
  289. const int socl_device_count = sizeof(socl_devices) / sizeof(struct _cl_device_id);