bones-compiler 1.3.1 → 1.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (307) hide show
  1. data/CHANGELOG +62 -0
  2. data/README.rdoc +14 -3
  3. data/Rakefile +13 -12
  4. data/VERSION +1 -1
  5. data/examples/applications/ffos.c +24 -8
  6. data/examples/benchmarks/PolyBench/2mm.c +0 -0
  7. data/examples/benchmarks/PolyBench/3mm.c +0 -0
  8. data/examples/benchmarks/PolyBench/adi.c +0 -0
  9. data/examples/benchmarks/PolyBench/atax.c +0 -0
  10. data/examples/benchmarks/PolyBench/bicg.c +0 -0
  11. data/examples/benchmarks/PolyBench/cholesky.c +0 -0
  12. data/examples/benchmarks/PolyBench/common.h +0 -0
  13. data/examples/benchmarks/PolyBench/correlation.c +0 -0
  14. data/examples/benchmarks/PolyBench/covariance.c +0 -0
  15. data/examples/benchmarks/PolyBench/doitgen.c +0 -0
  16. data/examples/benchmarks/PolyBench/durbin.c +0 -0
  17. data/examples/benchmarks/PolyBench/dynprog.c +0 -0
  18. data/examples/benchmarks/PolyBench/fdtd-2d-apml.c +0 -0
  19. data/examples/benchmarks/PolyBench/fdtd-2d.c +0 -0
  20. data/examples/benchmarks/PolyBench/floyd-warshall.c +0 -0
  21. data/examples/benchmarks/PolyBench/gemm.c +0 -0
  22. data/examples/benchmarks/PolyBench/gemver.c +0 -0
  23. data/examples/benchmarks/PolyBench/gesummv.c +0 -0
  24. data/examples/benchmarks/PolyBench/gramschmidt.c +0 -0
  25. data/examples/benchmarks/PolyBench/jacobi-1d-imper.c +4 -2
  26. data/examples/benchmarks/PolyBench/jacobi-2d-imper.c +1 -1
  27. data/examples/benchmarks/PolyBench/lu.c +0 -0
  28. data/examples/benchmarks/PolyBench/ludcmp.c +0 -0
  29. data/examples/benchmarks/PolyBench/mvt.c +0 -0
  30. data/examples/benchmarks/PolyBench/reg_detect.c +0 -0
  31. data/examples/benchmarks/PolyBench/seidel-2d.c +0 -0
  32. data/examples/benchmarks/PolyBench/symm.c +0 -0
  33. data/examples/benchmarks/PolyBench/syr2k.c +0 -0
  34. data/examples/benchmarks/PolyBench/syrk.c +0 -0
  35. data/examples/benchmarks/PolyBench/trisolv.c +0 -0
  36. data/examples/benchmarks/PolyBench/trmm.c +0 -0
  37. data/examples/benchmarks/Rodinia/bfs.c +143 -0
  38. data/examples/benchmarks/Rodinia/common.h +78 -0
  39. data/examples/benchmarks/Rodinia/hotspot.c +106 -126
  40. data/examples/benchmarks/Rodinia/kmeans.c +157 -164
  41. data/examples/benchmarks/Rodinia/nw.c +151 -0
  42. data/examples/benchmarks/Rodinia/pathfinder.c +88 -0
  43. data/examples/benchmarks/Rodinia/srad.c +50 -59
  44. data/examples/benchmarks/other/common.h +0 -0
  45. data/examples/benchmarks/other/dct.c +0 -0
  46. data/examples/benchmarks/other/mm.c +0 -0
  47. data/examples/benchmarks/other/saxpy.c +0 -0
  48. data/examples/chunk/example01.c +6 -4
  49. data/examples/chunk/example02.c +6 -4
  50. data/examples/chunk/example03.c +6 -4
  51. data/examples/chunk/example04.c +8 -5
  52. data/examples/chunk/example05.c +6 -4
  53. data/examples/chunk/example06.c +3 -1
  54. data/examples/chunk/example07.c +5 -2
  55. data/examples/dependences/example01.c +3 -1
  56. data/examples/dependences/example02.c +3 -1
  57. data/examples/dependences/example03.c +3 -1
  58. data/examples/dependences/example04.c +3 -1
  59. data/examples/dependences/example05.c +3 -1
  60. data/examples/element/example01.c +6 -4
  61. data/examples/element/example02.c +6 -4
  62. data/examples/element/example03.c +10 -8
  63. data/examples/element/example04.c +6 -4
  64. data/examples/element/example05.c +8 -5
  65. data/examples/element/example06.c +6 -4
  66. data/examples/element/example07.c +6 -4
  67. data/examples/element/example08.c +6 -4
  68. data/examples/element/example09.c +6 -4
  69. data/examples/element/example10.c +4 -2
  70. data/examples/element/example11.c +4 -2
  71. data/examples/element/example12.c +4 -2
  72. data/examples/element/example13.c +3 -1
  73. data/examples/fusion/example01.c +3 -12
  74. data/examples/fusion/example02.c +3 -16
  75. data/examples/fusion/example03.c +3 -1
  76. data/examples/fusion/example04.c +5 -3
  77. data/examples/fusion/example05.c +3 -1
  78. data/examples/neighbourhood/example01.c +6 -4
  79. data/examples/neighbourhood/example02.c +6 -4
  80. data/examples/neighbourhood/example03.c +6 -4
  81. data/examples/neighbourhood/example04.c +5 -3
  82. data/examples/neighbourhood/example05.c +3 -1
  83. data/examples/shared/example01.c +6 -4
  84. data/examples/shared/example02.c +6 -4
  85. data/examples/shared/example03.c +6 -4
  86. data/examples/shared/example04.c +6 -4
  87. data/examples/shared/example05.c +6 -4
  88. data/lib/adarwin/engine.rb +16 -5
  89. data/lib/adarwin/memorycopies.rb +21 -9
  90. data/lib/adarwin/nest.rb +18 -1
  91. data/lib/adarwin/preprocessor.rb +5 -2
  92. data/lib/adarwin/reference.rb +71 -6
  93. data/lib/bones/algorithm.rb +20 -5
  94. data/lib/bones/copy.rb +3 -2
  95. data/lib/bones/engine.rb +12 -9
  96. data/lib/bones/preprocessor.rb +170 -120
  97. data/lib/bones/variablelist.rb +1 -1
  98. data/lib/cast.rb +11 -0
  99. data/lib/castaddon.rb +23 -6
  100. data/lib/castaddon/node_adarwin.rb +17 -0
  101. data/lib/castaddon/node_common.rb +6 -0
  102. data/lib/castaddon/transformations.rb +13 -9
  103. data/skeletons/CPU-C/common/epilogue.c +0 -0
  104. data/skeletons/CPU-C/common/globals.c +0 -0
  105. data/skeletons/CPU-C/common/globals_kernel.c +0 -0
  106. data/skeletons/CPU-C/common/header.c +0 -0
  107. data/skeletons/CPU-C/common/mem_copy_D2H.c +0 -0
  108. data/skeletons/CPU-C/common/mem_copy_H2D.c +0 -0
  109. data/skeletons/CPU-C/common/mem_epilogue.c +0 -0
  110. data/skeletons/CPU-C/common/mem_global.c +0 -0
  111. data/skeletons/CPU-C/common/mem_prologue.c +0 -0
  112. data/skeletons/CPU-C/common/prologue.c +0 -0
  113. data/skeletons/CPU-C/common/timer_1_start.c +0 -0
  114. data/skeletons/CPU-C/common/timer_1_stop.c +0 -0
  115. data/skeletons/CPU-C/common/timer_2_start.c +0 -0
  116. data/skeletons/CPU-C/common/timer_2_stop.c +0 -0
  117. data/skeletons/CPU-C/common/timer_globals.c +5 -0
  118. data/skeletons/CPU-C/kernel/default.host.c +0 -0
  119. data/skeletons/CPU-C/kernel/default.kernel.c +0 -0
  120. data/skeletons/CPU-C/skeletons.txt +0 -0
  121. data/skeletons/CPU-OPENCL-AMD/common/epilogue.c +0 -0
  122. data/skeletons/CPU-OPENCL-AMD/common/globals.c +0 -0
  123. data/skeletons/CPU-OPENCL-AMD/common/globals_kernel.c +0 -0
  124. data/skeletons/CPU-OPENCL-AMD/common/header.c +0 -0
  125. data/skeletons/CPU-OPENCL-AMD/common/mem_copy_D2H.c +0 -0
  126. data/skeletons/CPU-OPENCL-AMD/common/mem_copy_H2D.c +0 -0
  127. data/skeletons/CPU-OPENCL-AMD/common/mem_epilogue.c +0 -0
  128. data/skeletons/CPU-OPENCL-AMD/common/mem_prologue.c +0 -0
  129. data/skeletons/CPU-OPENCL-AMD/common/prologue.c +0 -0
  130. data/skeletons/CPU-OPENCL-AMD/common/timer_1_start.c +0 -0
  131. data/skeletons/CPU-OPENCL-AMD/common/timer_1_stop.c +0 -0
  132. data/skeletons/CPU-OPENCL-AMD/common/timer_2_start.c +0 -0
  133. data/skeletons/CPU-OPENCL-AMD/common/timer_2_stop.c +0 -0
  134. data/skeletons/CPU-OPENCL-AMD/kernel/D-element-to-1-shared.host.c +0 -0
  135. data/skeletons/CPU-OPENCL-AMD/kernel/D-element-to-1-shared.kernel.cl +0 -0
  136. data/skeletons/CPU-OPENCL-AMD/kernel/default.host.c +0 -0
  137. data/skeletons/CPU-OPENCL-AMD/kernel/default.kernel.cl +0 -0
  138. data/skeletons/CPU-OPENCL-AMD/skeletons.txt +0 -0
  139. data/skeletons/CPU-OPENCL-INTEL/common/epilogue.c +0 -0
  140. data/skeletons/CPU-OPENCL-INTEL/common/globals.c +0 -0
  141. data/skeletons/CPU-OPENCL-INTEL/common/globals_kernel.c +0 -0
  142. data/skeletons/CPU-OPENCL-INTEL/common/header.c +0 -0
  143. data/skeletons/CPU-OPENCL-INTEL/common/mem_copy_D2H.c +0 -0
  144. data/skeletons/CPU-OPENCL-INTEL/common/mem_copy_H2D.c +0 -0
  145. data/skeletons/CPU-OPENCL-INTEL/common/mem_epilogue.c +0 -0
  146. data/skeletons/CPU-OPENCL-INTEL/common/mem_global.c +0 -0
  147. data/skeletons/CPU-OPENCL-INTEL/common/mem_prologue.c +0 -0
  148. data/skeletons/CPU-OPENCL-INTEL/common/prologue.c +0 -0
  149. data/skeletons/CPU-OPENCL-INTEL/common/timer_1_start.c +0 -0
  150. data/skeletons/CPU-OPENCL-INTEL/common/timer_1_stop.c +0 -0
  151. data/skeletons/CPU-OPENCL-INTEL/common/timer_2_start.c +0 -0
  152. data/skeletons/CPU-OPENCL-INTEL/common/timer_2_stop.c +0 -0
  153. data/skeletons/CPU-OPENCL-INTEL/common/timer_globals.c +5 -0
  154. data/skeletons/CPU-OPENCL-INTEL/kernel/D-element-to-1-shared.host.c +0 -0
  155. data/skeletons/CPU-OPENCL-INTEL/kernel/D-element-to-1-shared.kernel.cl +0 -0
  156. data/skeletons/CPU-OPENCL-INTEL/kernel/default.host.c +0 -0
  157. data/skeletons/CPU-OPENCL-INTEL/kernel/default.kernel.cl +0 -0
  158. data/skeletons/CPU-OPENCL-INTEL/skeletons.txt +0 -0
  159. data/skeletons/CPU-OPENMP/common/epilogue.c +0 -0
  160. data/skeletons/CPU-OPENMP/common/globals.c +0 -0
  161. data/skeletons/CPU-OPENMP/common/globals_kernel.c +0 -0
  162. data/skeletons/CPU-OPENMP/common/header.c +0 -0
  163. data/skeletons/CPU-OPENMP/common/mem_copy_D2H.c +0 -0
  164. data/skeletons/CPU-OPENMP/common/mem_copy_H2D.c +0 -0
  165. data/skeletons/CPU-OPENMP/common/mem_epilogue.c +0 -0
  166. data/skeletons/CPU-OPENMP/common/mem_global.c +0 -0
  167. data/skeletons/CPU-OPENMP/common/mem_prologue.c +0 -0
  168. data/skeletons/CPU-OPENMP/common/prologue.c +0 -0
  169. data/skeletons/CPU-OPENMP/common/timer_1_start.c +0 -0
  170. data/skeletons/CPU-OPENMP/common/timer_1_stop.c +0 -0
  171. data/skeletons/CPU-OPENMP/common/timer_2_start.c +0 -0
  172. data/skeletons/CPU-OPENMP/common/timer_2_stop.c +0 -0
  173. data/skeletons/CPU-OPENMP/common/timer_globals.c +2 -0
  174. data/skeletons/CPU-OPENMP/kernel/D-element-to-1-shared.host.c +0 -0
  175. data/skeletons/CPU-OPENMP/kernel/D-element-to-1-shared.kernel.c +3 -3
  176. data/skeletons/CPU-OPENMP/kernel/default.host.c +0 -0
  177. data/skeletons/CPU-OPENMP/kernel/default.kernel.c +0 -0
  178. data/skeletons/CPU-OPENMP/skeletons.txt +0 -0
  179. data/skeletons/GPU-CUDA/common/epilogue.c +0 -0
  180. data/skeletons/GPU-CUDA/common/globals.c +0 -0
  181. data/skeletons/GPU-CUDA/common/globals_kernel.c +0 -0
  182. data/skeletons/GPU-CUDA/common/header.c +0 -0
  183. data/skeletons/GPU-CUDA/common/mem_async_alloc.c +0 -0
  184. data/skeletons/GPU-CUDA/common/mem_async_copyin.c +0 -0
  185. data/skeletons/GPU-CUDA/common/mem_async_copyout.c +0 -0
  186. data/skeletons/GPU-CUDA/common/mem_async_free.c +0 -0
  187. data/skeletons/GPU-CUDA/common/mem_copy_D2H.c +0 -0
  188. data/skeletons/GPU-CUDA/common/mem_copy_H2D.c +0 -0
  189. data/skeletons/GPU-CUDA/common/mem_epilogue.c +0 -0
  190. data/skeletons/GPU-CUDA/common/mem_global.c +0 -0
  191. data/skeletons/GPU-CUDA/common/mem_prologue.c +0 -0
  192. data/skeletons/GPU-CUDA/common/prologue.c +0 -0
  193. data/skeletons/GPU-CUDA/common/scheduler.c +2 -2
  194. data/skeletons/GPU-CUDA/common/timer_1_start.c +0 -0
  195. data/skeletons/GPU-CUDA/common/timer_1_stop.c +0 -0
  196. data/skeletons/GPU-CUDA/common/timer_2_start.c +0 -0
  197. data/skeletons/GPU-CUDA/common/timer_2_stop.c +0 -0
  198. data/skeletons/GPU-CUDA/common/timer_globals.c +0 -0
  199. data/skeletons/GPU-CUDA/kernel/2xN-N-chunk-1-N-to-D-element.host.c +0 -0
  200. data/skeletons/GPU-CUDA/kernel/2xN-N-chunk-1-N-to-D-element.kernel.cu +0 -0
  201. data/skeletons/GPU-CUDA/kernel/D-element-to-1-shared.host.c +0 -0
  202. data/skeletons/GPU-CUDA/kernel/D-element-to-1-shared.kernel.cu +0 -0
  203. data/skeletons/GPU-CUDA/kernel/D-element-to-N-shared.host.c +0 -0
  204. data/skeletons/GPU-CUDA/kernel/D-element-to-N-shared.kernel.cu +0 -0
  205. data/skeletons/GPU-CUDA/kernel/N-N-chunk-1-N-to-D-element.host.c +0 -0
  206. data/skeletons/GPU-CUDA/kernel/N-N-chunk-1-N-to-D-element.kernel.cu +0 -0
  207. data/skeletons/GPU-CUDA/kernel/N-neighbourhood-N-to-N-element.host.c +0 -0
  208. data/skeletons/GPU-CUDA/kernel/N-neighbourhood-N-to-N-element.kernel.cu +0 -0
  209. data/skeletons/GPU-CUDA/kernel/default.host.c +0 -0
  210. data/skeletons/GPU-CUDA/kernel/default.kernel.cu +0 -0
  211. data/skeletons/GPU-CUDA/skeletons.txt +4 -2
  212. data/skeletons/GPU-OPENCL-AMD/common/epilogue.c +0 -0
  213. data/skeletons/GPU-OPENCL-AMD/common/globals.c +0 -0
  214. data/skeletons/GPU-OPENCL-AMD/common/globals_kernel.c +0 -0
  215. data/skeletons/GPU-OPENCL-AMD/common/header.c +0 -0
  216. data/skeletons/GPU-OPENCL-AMD/common/mem_copy_D2H.c +0 -0
  217. data/skeletons/GPU-OPENCL-AMD/common/mem_copy_H2D.c +0 -0
  218. data/skeletons/GPU-OPENCL-AMD/common/mem_epilogue.c +0 -0
  219. data/skeletons/GPU-OPENCL-AMD/common/mem_prologue.c +0 -0
  220. data/skeletons/GPU-OPENCL-AMD/common/prologue.c +0 -0
  221. data/skeletons/GPU-OPENCL-AMD/common/timer_1_start.c +0 -0
  222. data/skeletons/GPU-OPENCL-AMD/common/timer_1_stop.c +0 -0
  223. data/skeletons/GPU-OPENCL-AMD/common/timer_2_start.c +0 -0
  224. data/skeletons/GPU-OPENCL-AMD/common/timer_2_stop.c +0 -0
  225. data/skeletons/GPU-OPENCL-AMD/kernel/D-element-to-1-shared.host.c +0 -0
  226. data/skeletons/GPU-OPENCL-AMD/kernel/D-element-to-1-shared.kernel.cl +0 -0
  227. data/skeletons/GPU-OPENCL-AMD/kernel/default.host.c +0 -0
  228. data/skeletons/GPU-OPENCL-AMD/kernel/default.kernel.cl +0 -0
  229. data/skeletons/GPU-OPENCL-AMD/skeletons.txt +0 -0
  230. data/skeletons/verification/header.c +0 -0
  231. data/skeletons/verification/timer_start.c +0 -0
  232. data/skeletons/verification/timer_stop.c +0 -0
  233. data/skeletons/verification/verify_results.c +0 -0
  234. data/test/bones/test_algorithm.rb +0 -0
  235. data/test/bones/test_common.rb +0 -0
  236. data/test/bones/test_preprocessor.rb +0 -0
  237. data/test/bones/test_species.rb +0 -0
  238. data/test/bones/test_variable.rb +0 -0
  239. data/test/examples/benchmarks/PolyBench/2mm_species.c +1 -1
  240. data/test/examples/benchmarks/PolyBench/3mm_species.c +0 -0
  241. data/test/examples/benchmarks/PolyBench/adi_species.c +0 -0
  242. data/test/examples/benchmarks/PolyBench/atax_species.c +0 -0
  243. data/test/examples/benchmarks/PolyBench/bicg_species.c +0 -0
  244. data/test/examples/benchmarks/PolyBench/cholesky_species.c +0 -0
  245. data/test/examples/benchmarks/PolyBench/correlation_species.c +0 -0
  246. data/test/examples/benchmarks/PolyBench/covariance_species.c +0 -0
  247. data/test/examples/benchmarks/PolyBench/doitgen_species.c +0 -0
  248. data/test/examples/benchmarks/PolyBench/durbin_species.c +0 -0
  249. data/test/examples/benchmarks/PolyBench/dynprog_species.c +0 -0
  250. data/test/examples/benchmarks/PolyBench/fdtd-2d-apml_species.c +0 -0
  251. data/test/examples/benchmarks/PolyBench/fdtd-2d_species.c +0 -0
  252. data/test/examples/benchmarks/PolyBench/floyd-warshall_species.c +0 -0
  253. data/test/examples/benchmarks/PolyBench/gemm_species.c +0 -0
  254. data/test/examples/benchmarks/PolyBench/gemver_species.c +0 -0
  255. data/test/examples/benchmarks/PolyBench/gesummv_species.c +0 -0
  256. data/test/examples/benchmarks/PolyBench/gramschmidt_species.c +0 -0
  257. data/test/examples/benchmarks/PolyBench/jacobi-1d-imper_species.c +0 -0
  258. data/test/examples/benchmarks/PolyBench/jacobi-2d-imper_species.c +0 -0
  259. data/test/examples/benchmarks/PolyBench/lu_species.c +0 -0
  260. data/test/examples/benchmarks/PolyBench/ludcmp_species.c +0 -0
  261. data/test/examples/benchmarks/PolyBench/mvt_species.c +0 -0
  262. data/test/examples/benchmarks/PolyBench/reg_detect_species.c +0 -0
  263. data/test/examples/benchmarks/PolyBench/seidel-2d_species.c +0 -0
  264. data/test/examples/benchmarks/PolyBench/symm_species.c +0 -0
  265. data/test/examples/benchmarks/PolyBench/syr2k_species.c +0 -0
  266. data/test/examples/benchmarks/PolyBench/syrk_species.c +0 -0
  267. data/test/examples/benchmarks/PolyBench/trisolv_species.c +0 -0
  268. data/test/examples/benchmarks/PolyBench/trmm_species.c +0 -0
  269. data/test/examples/chunk/example01_species.c +3 -3
  270. data/test/examples/chunk/example02_species.c +3 -3
  271. data/test/examples/chunk/example03_species.c +3 -3
  272. data/test/examples/chunk/example04_species.c +3 -3
  273. data/test/examples/chunk/example05_species.c +3 -3
  274. data/test/examples/chunk/example06_species.c +1 -1
  275. data/test/examples/chunk/example07_species.c +3 -2
  276. data/test/examples/dependences/example01_species.c +1 -1
  277. data/test/examples/dependences/example02_species.c +1 -1
  278. data/test/examples/dependences/example03_species.c +1 -1
  279. data/test/examples/dependences/example04_species.c +1 -1
  280. data/test/examples/dependences/example05_species.c +1 -1
  281. data/test/examples/element/example01_species.c +3 -3
  282. data/test/examples/element/example02_species.c +3 -3
  283. data/test/examples/element/example03_species.c +7 -7
  284. data/test/examples/element/example04_species.c +3 -3
  285. data/test/examples/element/example05_species.c +3 -3
  286. data/test/examples/element/example06_species.c +3 -3
  287. data/test/examples/element/example07_species.c +3 -3
  288. data/test/examples/element/example08_species.c +3 -3
  289. data/test/examples/element/example09_species.c +3 -3
  290. data/test/examples/element/example10_species.c +1 -1
  291. data/test/examples/element/example11_species.c +1 -1
  292. data/test/examples/element/example12_species.c +1 -1
  293. data/test/examples/element/example13_species.c +1 -1
  294. data/test/examples/neighbourhood/example01_species.c +3 -3
  295. data/test/examples/neighbourhood/example02_species.c +3 -3
  296. data/test/examples/neighbourhood/example03_species.c +3 -3
  297. data/test/examples/neighbourhood/example04_species.c +3 -3
  298. data/test/examples/neighbourhood/example05_species.c +1 -1
  299. data/test/examples/shared/example01_species.c +3 -3
  300. data/test/examples/shared/example02_species.c +3 -3
  301. data/test/examples/shared/example03_species.c +3 -3
  302. data/test/examples/shared/example04_species.c +3 -3
  303. data/test/examples/shared/example05_species.c +3 -3
  304. data/test/test_helper.rb +2 -2
  305. metadata +266 -252
  306. checksums.yaml +0 -15
  307. data/examples/benchmarks/Rodinia/cfd.c +0 -180
@@ -8,16 +8,16 @@
8
8
  // Web address........http://parse.ele.tue.nl/bones/
9
9
  //
10
10
  // == File information
11
- // Filename...........chunk/example2.c
11
+ // Filename...........chunk/example02.c
12
12
  // Author.............Cedric Nugteren
13
- // Last modified on...16-April-2012
13
+ // Last modified on...10-October-2014
14
14
  //
15
15
 
16
16
  #include <stdio.h>
17
17
  #define SIZE 2048
18
18
  #define HALFSIZE (SIZE/2)
19
19
 
20
- // This is 'example2', demonstrating a chunk-example without an inner-loop, everything is unrolled manually
20
+ // This is 'example02', demonstrating a chunk-example without an inner-loop, everything is unrolled manually
21
21
  int main(void) {
22
22
  int i;
23
23
 
@@ -31,11 +31,13 @@ int main(void) {
31
31
  }
32
32
 
33
33
  // Perform the computation
34
- #pragma species kernel 0:SIZE-1|chunk(0:1) -> 0:HALFSIZE-1|element
34
+ #pragma scop
35
+ #pragma species kernel A[0:SIZE-1]|chunk(0:1) -> B[0:HALFSIZE-1]|element
35
36
  for(i=0;i<HALFSIZE;i++) {
36
37
  B[i] = A[i*2] + A[i*2+1];
37
38
  }
38
39
  #pragma species endkernel example2
40
+ #pragma endscop
39
41
 
40
42
  // Clean-up and exit the function
41
43
  fflush(stdout);
@@ -8,9 +8,9 @@
8
8
  // Web address........http://parse.ele.tue.nl/bones/
9
9
  //
10
10
  // == File information
11
- // Filename...........chunk/example3.c
11
+ // Filename...........chunk/example03.c
12
12
  // Author.............Cedric Nugteren
13
- // Last modified on...16-April-2012
13
+ // Last modified on...10-October-2014
14
14
  //
15
15
 
16
16
  #include <stdio.h>
@@ -18,7 +18,7 @@
18
18
  #define TILE 64
19
19
  #define SIZE (BASE*TILE)
20
20
 
21
- // This is 'example3', demonstrating a chunked input and a chunked output, and showing the importance of ordering (array referenced first should be placed first)
21
+ // This is 'example03', demonstrating a chunked input and a chunked output, and showing the importance of ordering (array referenced first should be placed first)
22
22
  int main(void) {
23
23
  int i;
24
24
  int t = 0;
@@ -39,7 +39,8 @@ int main(void) {
39
39
  }
40
40
 
41
41
  // Perform the computation
42
- #pragma species kernel 0:BASE-1|element ^ 0:SIZE-1|chunk(0:TILE-1) -> 0:SIZE-1|chunk(0:TILE-1) ^ 0:SIZE-1|chunk(0:TILE-1)
42
+ #pragma scop
43
+ #pragma species kernel A[0:BASE-1]|element ^ B[0:SIZE-1]|chunk(0:TILE-1) -> out1[0:SIZE-1]|chunk(0:TILE-1) ^ out2[0:SIZE-1]|chunk(0:TILE-1)
43
44
  for(i=0;i<BASE;i++) {
44
45
  result = A[i];
45
46
  for(t=0;t<TILE;t++) {
@@ -51,6 +52,7 @@ int main(void) {
51
52
  }
52
53
  }
53
54
  #pragma species endkernel example3
55
+ #pragma endscop
54
56
 
55
57
  // Clean-up and exit the function
56
58
  fflush(stdout);
@@ -8,15 +8,15 @@
8
8
  // Web address........http://parse.ele.tue.nl/bones/
9
9
  //
10
10
  // == File information
11
- // Filename...........chunk/example4.c
11
+ // Filename...........chunk/example04.c
12
12
  // Author.............Cedric Nugteren
13
- // Last modified on...16-April-2012
13
+ // Last modified on...10-October-2014
14
14
  //
15
15
 
16
16
  #include <stdio.h>
17
17
  #define SIZE 1024
18
18
 
19
- // This is 'example4', a basic element to chunk example with an if-statement in the body
19
+ // This is 'example04', a basic element to chunk example with an if-statement in the body
20
20
  int main(void) {
21
21
  int i;
22
22
  int threshold = 19;
@@ -36,10 +36,12 @@ int main(void) {
36
36
  }
37
37
 
38
38
  // Perform the computation
39
- #pragma species kernel 0:SIZE-1|element -> 0:SIZE*2-1|chunk(0:1)
39
+ #pragma scop
40
+ #pragma species kernel A[0:SIZE-1]|element -> B[0:SIZE*2-1]|chunk(0:1)
40
41
  for(i=0;i<SIZE;i++) {
42
+ float a = A[i];
41
43
  B[i*2] = A[i];
42
- if (A[i] > threshold) {
44
+ if (a > threshold) {
43
45
  B[i*2+1] = A[i];
44
46
  }
45
47
  else {
@@ -47,6 +49,7 @@ int main(void) {
47
49
  }
48
50
  }
49
51
  #pragma species endkernel example4
52
+ #pragma endscop
50
53
 
51
54
  // Clean-up and exit the function
52
55
  fflush(stdout);
@@ -8,14 +8,14 @@
8
8
  // Web address........http://parse.ele.tue.nl/bones/
9
9
  //
10
10
  // == File information
11
- // Filename...........chunk/example5.c
11
+ // Filename...........chunk/example05.c
12
12
  // Author.............Cedric Nugteren
13
- // Last modified on...16-April-2012
13
+ // Last modified on...10-October-2014
14
14
  //
15
15
 
16
16
  #include <stdio.h>
17
17
 
18
- // This is 'example5', demonstrating a chunk to element example without a temporary variable but directly writing to the output
18
+ // This is 'example05', demonstrating a chunk to element example without a temporary variable but directly writing to the output
19
19
  int main(void) {
20
20
  int i,j;
21
21
  int i2,j2;
@@ -32,7 +32,8 @@ int main(void) {
32
32
  }
33
33
 
34
34
  // Perform the computation
35
- #pragma species kernel 0:559,0:31|chunk(0:9,0:1) -> 0:55,0:15|element
35
+ #pragma scop
36
+ #pragma species kernel A[0:559,0:31]|chunk(0:9,0:1) -> B[0:55,0:15]|element
36
37
  for(i=0;i<56;i++) {
37
38
  for(j=0;j<16;j++) {
38
39
  B[i][j] = 0;
@@ -44,6 +45,7 @@ int main(void) {
44
45
  }
45
46
  }
46
47
  #pragma species endkernel example5
48
+ #pragma endscop
47
49
 
48
50
  // Clean-up and exit the function
49
51
  fflush(stdout);
@@ -10,7 +10,7 @@
10
10
  // == File information
11
11
  // Filename...........chunk/example06.c
12
12
  // Author.............Cedric Nugteren
13
- // Last modified on...07-May-2013
13
+ // Last modified on...10-October-2014
14
14
  //
15
15
 
16
16
  #include <stdio.h>
@@ -31,12 +31,14 @@ int main(void) {
31
31
  }
32
32
 
33
33
  // Perform the computation
34
+ #pragma scop
34
35
  #pragma species kernel A[2:N-1]|chunk(0:1) -> B[2:N-1]|chunk(0:1)
35
36
  for (i=2; i<N-1; i=i+2) {
36
37
  B[i] = A[i];
37
38
  B[i+1] = A[i+1];
38
39
  }
39
40
  #pragma species endkernel example06
41
+ #pragma endscop
40
42
 
41
43
  // Clean-up and exit the function
42
44
  fflush(stdout);
@@ -10,15 +10,16 @@
10
10
  // == File information
11
11
  // Filename...........chunk/example07.c
12
12
  // Author.............Cedric Nugteren
13
- // Last modified on...07-May-2013
13
+ // Last modified on...10-October-2014
14
14
  //
15
15
 
16
16
  #include <stdio.h>
17
17
 
18
18
  // This is 'example07', a chunk/chunk with a step of 2
19
19
  int main(void) {
20
- int i;
20
+ int i, j;
21
21
  int N = 256;
22
+ int temp;
22
23
 
23
24
  // Declare input/output arrays
24
25
  int A[N];
@@ -31,6 +32,7 @@ int main(void) {
31
32
  }
32
33
 
33
34
  // Perform the computation
35
+ #pragma scop
34
36
  #pragma species kernel A[2:N-1]|chunk(0:1) -> B[2:N-1]|chunk(0:1)
35
37
  for (i=2; i<N-1; i=i+2) {
36
38
  temp = 0;
@@ -41,6 +43,7 @@ int main(void) {
41
43
  B[i+1] = temp;
42
44
  }
43
45
  #pragma species endkernel example07
46
+ #pragma endscop
44
47
 
45
48
  // Clean-up and exit the function
46
49
  fflush(stdout);
@@ -10,7 +10,7 @@
10
10
  // == File information
11
11
  // Filename...........dependences/example01.c
12
12
  // Author.............Cedric Nugteren
13
- // Last modified on...07-May-2013
13
+ // Last modified on...11-October-2014
14
14
  //
15
15
 
16
16
  #include <stdio.h>
@@ -29,11 +29,13 @@ int main(void) {
29
29
  }
30
30
 
31
31
  // Perform the computation
32
+ #pragma scop
32
33
  #pragma species kernel A[1:8*N-7]|element -> A[6:2*N+4]|element
33
34
  for (i=0; i<N; i++) { // No dependence
34
35
  A[2*i+6] = A[8*i+1];
35
36
  }
36
37
  #pragma species endkernel example01
38
+ #pragma endscop
37
39
 
38
40
  // Clean-up and exit the function
39
41
  fflush(stdout);
@@ -10,7 +10,7 @@
10
10
  // == File information
11
11
  // Filename...........dependences/example02.c
12
12
  // Author.............Cedric Nugteren
13
- // Last modified on...07-May-2013
13
+ // Last modified on...11-October-2014
14
14
  //
15
15
 
16
16
  #include <stdio.h>
@@ -29,9 +29,11 @@ int main(void) {
29
29
  }
30
30
 
31
31
  // Perform the computation
32
+ #pragma scop
32
33
  for (i=0; i<N; i++) { // Read-write dependence
33
34
  A[2*i+6] = A[3*i+1];
34
35
  }
36
+ #pragma endscop
35
37
 
36
38
  // Clean-up and exit the function
37
39
  fflush(stdout);
@@ -10,7 +10,7 @@
10
10
  // == File information
11
11
  // Filename...........dependences/example03.c
12
12
  // Author.............Cedric Nugteren
13
- // Last modified on...07-May-2013
13
+ // Last modified on...11-October-2014
14
14
  //
15
15
 
16
16
  #include <stdio.h>
@@ -31,10 +31,12 @@ int main(void) {
31
31
  }
32
32
 
33
33
  // Perform the computation
34
+ #pragma scop
34
35
  for (i=2; i<N; i++) { // Write-write dependence
35
36
  B[i] = A[i];
36
37
  B[i+1] = A[i+1];
37
38
  }
39
+ #pragma endscop
38
40
 
39
41
  // Clean-up and exit the function
40
42
  fflush(stdout);
@@ -10,7 +10,7 @@
10
10
  // == File information
11
11
  // Filename...........dependences/example04.c
12
12
  // Author.............Cedric Nugteren
13
- // Last modified on...07-May-2013
13
+ // Last modified on...11-October-2014
14
14
  //
15
15
 
16
16
  #include <stdio.h>
@@ -31,11 +31,13 @@ int main(void) {
31
31
  }
32
32
 
33
33
  // Perform the computation
34
+ #pragma scop
34
35
  #pragma species kernel D[1:8*N-7,1:8*N-7]|element -> D[6:2*N+4,6:2*N+4]|element
35
36
  for (i=0; i<N; i++) { // No dependence
36
37
  D[2*i+6][2*i+6] = D[8*i+1][8*i+1];
37
38
  }
38
39
  #pragma species endkernel example04
40
+ #pragma endscop
39
41
 
40
42
  // Clean-up and exit the function
41
43
  fflush(stdout);
@@ -10,7 +10,7 @@
10
10
  // == File information
11
11
  // Filename...........dependences/example05.c
12
12
  // Author.............Cedric Nugteren
13
- // Last modified on...07-May-2013
13
+ // Last modified on...11-October-2014
14
14
  //
15
15
 
16
16
  #include <stdio.h>
@@ -31,9 +31,11 @@ int main(void) {
31
31
  }
32
32
 
33
33
  // Perform the computation
34
+ #pragma scop
34
35
  for (i=0; i<N; i++) { // Read-write dependence
35
36
  D[2*i+6][2*i+6] = D[8*i+1][3*i+1];
36
37
  }
38
+ #pragma endscop
37
39
 
38
40
  // Clean-up and exit the function
39
41
  fflush(stdout);
@@ -8,14 +8,14 @@
8
8
  // Web address........http://parse.ele.tue.nl/bones/
9
9
  //
10
10
  // == File information
11
- // Filename...........element/example1.c
11
+ // Filename...........element/example01.c
12
12
  // Author.............Cedric Nugteren
13
- // Last modified on...16-April-2012
13
+ // Last modified on...10-October-2014
14
14
  //
15
15
 
16
16
  #include <stdio.h>
17
17
 
18
- // This is 'example1', a very basic element to element example using 2D arrays.
18
+ // This is 'example01', a very basic element to element example using 2D arrays.
19
19
  int main(void) {
20
20
  int i,j;
21
21
 
@@ -31,13 +31,15 @@ int main(void) {
31
31
  }
32
32
 
33
33
  // Perform the computation
34
- #pragma species kernel 0:99,0:15|element -> 0:99,0:15|element
34
+ #pragma scop
35
+ #pragma species kernel A[0:99,0:15]|element -> B[0:99,0:15]|element
35
36
  for(i=0;i<100;i++) {
36
37
  for(j=0;j<16;j++) {
37
38
  B[i][j] = 2*A[i][j];
38
39
  }
39
40
  }
40
41
  #pragma species endkernel example1
42
+ #pragma endscop
41
43
 
42
44
  // Clean-up and exit the function
43
45
  fflush(stdout);
@@ -8,14 +8,14 @@
8
8
  // Web address........http://parse.ele.tue.nl/bones/
9
9
  //
10
10
  // == File information
11
- // Filename...........element/example2.c
11
+ // Filename...........element/example02.c
12
12
  // Author.............Cedric Nugteren
13
- // Last modified on...06-May-2013
13
+ // Last modified on...10-October-2014
14
14
  //
15
15
 
16
16
  #include <stdio.h>
17
17
 
18
- // This is 'example2', demonstrating unordered element-wise computation
18
+ // This is 'example02', demonstrating unordered element-wise computation
19
19
  int main(void) {
20
20
  int i,j;
21
21
 
@@ -31,13 +31,15 @@ int main(void) {
31
31
  }
32
32
 
33
33
  // Perform the computation
34
- #pragma species kernel 0:3,0:7|element -> 0:3,0:7|element
34
+ #pragma scop
35
+ #pragma species kernel A[0:3,0:7]|element -> B[0:3,0:7]|element
35
36
  for(i=0;i<4;i++) {
36
37
  for(j=0;j<8;j++) {
37
38
  B[i][j] = A[i][7-j];
38
39
  }
39
40
  }
40
41
  #pragma species endkernel example2
42
+ #pragma endscop
41
43
 
42
44
  // Clean-up and exit the function
43
45
  fflush(stdout);
@@ -8,18 +8,18 @@
8
8
  // Web address........http://parse.ele.tue.nl/bones/
9
9
  //
10
10
  // == File information
11
- // Filename...........element/example3.c
11
+ // Filename...........element/example03.c
12
12
  // Author.............Cedric Nugteren
13
- // Last modified on...16-April-2012
13
+ // Last modified on...10-October-2014
14
14
  //
15
15
 
16
16
  #include <stdio.h>
17
- #define N1 2//8
18
- #define N2 4//16
19
- #define N3 8//32
20
- #define N4 16//64
17
+ #define N1 2
18
+ #define N2 4
19
+ #define N3 8
20
+ #define N4 16
21
21
 
22
- // This is 'example3', demonstrating a 4D array and defines for array sizes
22
+ // This is 'example03', demonstrating a 4D array and defines for array sizes
23
23
  int main(void) {
24
24
  int i,j,k,l;
25
25
 
@@ -39,7 +39,8 @@ int main(void) {
39
39
  }
40
40
 
41
41
  // Perform the computation
42
- #pragma species kernel 0:N1-1,0:N2-1,0:N3-1,0:N4-1|element -> 0:N1-1,0:N2-1,0:N3-1,0:N4-1|element
42
+ #pragma scop
43
+ #pragma species kernel A[0:N1-1,0:N2-1,0:N3-1,0:N4-1]|element -> B[0:N1-1,0:N2-1,0:N3-1,0:N4-1]|element
43
44
  for(i=0;i<N1;i++) {
44
45
  for(j=0;j<N2;j++) {
45
46
  for(k=0;k<N3;k++) {
@@ -50,6 +51,7 @@ int main(void) {
50
51
  }
51
52
  }
52
53
  #pragma species endkernel example3
54
+ #pragma endscop
53
55
 
54
56
  // Clean-up and exit the function
55
57
  fflush(stdout);
@@ -8,14 +8,14 @@
8
8
  // Web address........http://parse.ele.tue.nl/bones/
9
9
  //
10
10
  // == File information
11
- // Filename...........element/example4.c
11
+ // Filename...........element/example04.c
12
12
  // Author.............Cedric Nugteren
13
- // Last modified on...16-April-2012
13
+ // Last modified on...10-October-2014
14
14
  //
15
15
 
16
16
  #include <stdio.h>
17
17
 
18
- // This is 'example4', demonstrating two input arrays and an inner-loop as the computational body
18
+ // This is 'example04', demonstrating two input arrays and an inner-loop as the computational body
19
19
  int main(void) {
20
20
  int i,l;
21
21
  float factor = 0;
@@ -32,7 +32,8 @@ int main(void) {
32
32
  }
33
33
 
34
34
  // Perform the computation
35
- #pragma species kernel 0:699|element ^ 0:699|element -> 0:699|element
35
+ #pragma scop
36
+ #pragma species kernel A[0:699]|element ^ B[0:699]|element -> C[0:699]|element
36
37
  for(i=0;i<700;i++) {
37
38
  factor = 0.5;
38
39
  for (l=0;l<3;l++) {
@@ -41,6 +42,7 @@ int main(void) {
41
42
  C[i] = factor*A[i] + factor*B[i];
42
43
  }
43
44
  #pragma species endkernel example4
45
+ #pragma endscop
44
46
 
45
47
  // Clean-up and exit the function
46
48
  fflush(stdout);