devices.c 10 KB

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