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.
- data/CHANGELOG +62 -0
- data/README.rdoc +14 -3
- data/Rakefile +13 -12
- data/VERSION +1 -1
- data/examples/applications/ffos.c +24 -8
- data/examples/benchmarks/PolyBench/2mm.c +0 -0
- data/examples/benchmarks/PolyBench/3mm.c +0 -0
- data/examples/benchmarks/PolyBench/adi.c +0 -0
- data/examples/benchmarks/PolyBench/atax.c +0 -0
- data/examples/benchmarks/PolyBench/bicg.c +0 -0
- data/examples/benchmarks/PolyBench/cholesky.c +0 -0
- data/examples/benchmarks/PolyBench/common.h +0 -0
- data/examples/benchmarks/PolyBench/correlation.c +0 -0
- data/examples/benchmarks/PolyBench/covariance.c +0 -0
- data/examples/benchmarks/PolyBench/doitgen.c +0 -0
- data/examples/benchmarks/PolyBench/durbin.c +0 -0
- data/examples/benchmarks/PolyBench/dynprog.c +0 -0
- data/examples/benchmarks/PolyBench/fdtd-2d-apml.c +0 -0
- data/examples/benchmarks/PolyBench/fdtd-2d.c +0 -0
- data/examples/benchmarks/PolyBench/floyd-warshall.c +0 -0
- data/examples/benchmarks/PolyBench/gemm.c +0 -0
- data/examples/benchmarks/PolyBench/gemver.c +0 -0
- data/examples/benchmarks/PolyBench/gesummv.c +0 -0
- data/examples/benchmarks/PolyBench/gramschmidt.c +0 -0
- data/examples/benchmarks/PolyBench/jacobi-1d-imper.c +4 -2
- data/examples/benchmarks/PolyBench/jacobi-2d-imper.c +1 -1
- data/examples/benchmarks/PolyBench/lu.c +0 -0
- data/examples/benchmarks/PolyBench/ludcmp.c +0 -0
- data/examples/benchmarks/PolyBench/mvt.c +0 -0
- data/examples/benchmarks/PolyBench/reg_detect.c +0 -0
- data/examples/benchmarks/PolyBench/seidel-2d.c +0 -0
- data/examples/benchmarks/PolyBench/symm.c +0 -0
- data/examples/benchmarks/PolyBench/syr2k.c +0 -0
- data/examples/benchmarks/PolyBench/syrk.c +0 -0
- data/examples/benchmarks/PolyBench/trisolv.c +0 -0
- data/examples/benchmarks/PolyBench/trmm.c +0 -0
- data/examples/benchmarks/Rodinia/bfs.c +143 -0
- data/examples/benchmarks/Rodinia/common.h +78 -0
- data/examples/benchmarks/Rodinia/hotspot.c +106 -126
- data/examples/benchmarks/Rodinia/kmeans.c +157 -164
- data/examples/benchmarks/Rodinia/nw.c +151 -0
- data/examples/benchmarks/Rodinia/pathfinder.c +88 -0
- data/examples/benchmarks/Rodinia/srad.c +50 -59
- data/examples/benchmarks/other/common.h +0 -0
- data/examples/benchmarks/other/dct.c +0 -0
- data/examples/benchmarks/other/mm.c +0 -0
- data/examples/benchmarks/other/saxpy.c +0 -0
- data/examples/chunk/example01.c +6 -4
- data/examples/chunk/example02.c +6 -4
- data/examples/chunk/example03.c +6 -4
- data/examples/chunk/example04.c +8 -5
- data/examples/chunk/example05.c +6 -4
- data/examples/chunk/example06.c +3 -1
- data/examples/chunk/example07.c +5 -2
- data/examples/dependences/example01.c +3 -1
- data/examples/dependences/example02.c +3 -1
- data/examples/dependences/example03.c +3 -1
- data/examples/dependences/example04.c +3 -1
- data/examples/dependences/example05.c +3 -1
- data/examples/element/example01.c +6 -4
- data/examples/element/example02.c +6 -4
- data/examples/element/example03.c +10 -8
- data/examples/element/example04.c +6 -4
- data/examples/element/example05.c +8 -5
- data/examples/element/example06.c +6 -4
- data/examples/element/example07.c +6 -4
- data/examples/element/example08.c +6 -4
- data/examples/element/example09.c +6 -4
- data/examples/element/example10.c +4 -2
- data/examples/element/example11.c +4 -2
- data/examples/element/example12.c +4 -2
- data/examples/element/example13.c +3 -1
- data/examples/fusion/example01.c +3 -12
- data/examples/fusion/example02.c +3 -16
- data/examples/fusion/example03.c +3 -1
- data/examples/fusion/example04.c +5 -3
- data/examples/fusion/example05.c +3 -1
- data/examples/neighbourhood/example01.c +6 -4
- data/examples/neighbourhood/example02.c +6 -4
- data/examples/neighbourhood/example03.c +6 -4
- data/examples/neighbourhood/example04.c +5 -3
- data/examples/neighbourhood/example05.c +3 -1
- data/examples/shared/example01.c +6 -4
- data/examples/shared/example02.c +6 -4
- data/examples/shared/example03.c +6 -4
- data/examples/shared/example04.c +6 -4
- data/examples/shared/example05.c +6 -4
- data/lib/adarwin/engine.rb +16 -5
- data/lib/adarwin/memorycopies.rb +21 -9
- data/lib/adarwin/nest.rb +18 -1
- data/lib/adarwin/preprocessor.rb +5 -2
- data/lib/adarwin/reference.rb +71 -6
- data/lib/bones/algorithm.rb +20 -5
- data/lib/bones/copy.rb +3 -2
- data/lib/bones/engine.rb +12 -9
- data/lib/bones/preprocessor.rb +170 -120
- data/lib/bones/variablelist.rb +1 -1
- data/lib/cast.rb +11 -0
- data/lib/castaddon.rb +23 -6
- data/lib/castaddon/node_adarwin.rb +17 -0
- data/lib/castaddon/node_common.rb +6 -0
- data/lib/castaddon/transformations.rb +13 -9
- data/skeletons/CPU-C/common/epilogue.c +0 -0
- data/skeletons/CPU-C/common/globals.c +0 -0
- data/skeletons/CPU-C/common/globals_kernel.c +0 -0
- data/skeletons/CPU-C/common/header.c +0 -0
- data/skeletons/CPU-C/common/mem_copy_D2H.c +0 -0
- data/skeletons/CPU-C/common/mem_copy_H2D.c +0 -0
- data/skeletons/CPU-C/common/mem_epilogue.c +0 -0
- data/skeletons/CPU-C/common/mem_global.c +0 -0
- data/skeletons/CPU-C/common/mem_prologue.c +0 -0
- data/skeletons/CPU-C/common/prologue.c +0 -0
- data/skeletons/CPU-C/common/timer_1_start.c +0 -0
- data/skeletons/CPU-C/common/timer_1_stop.c +0 -0
- data/skeletons/CPU-C/common/timer_2_start.c +0 -0
- data/skeletons/CPU-C/common/timer_2_stop.c +0 -0
- data/skeletons/CPU-C/common/timer_globals.c +5 -0
- data/skeletons/CPU-C/kernel/default.host.c +0 -0
- data/skeletons/CPU-C/kernel/default.kernel.c +0 -0
- data/skeletons/CPU-C/skeletons.txt +0 -0
- data/skeletons/CPU-OPENCL-AMD/common/epilogue.c +0 -0
- data/skeletons/CPU-OPENCL-AMD/common/globals.c +0 -0
- data/skeletons/CPU-OPENCL-AMD/common/globals_kernel.c +0 -0
- data/skeletons/CPU-OPENCL-AMD/common/header.c +0 -0
- data/skeletons/CPU-OPENCL-AMD/common/mem_copy_D2H.c +0 -0
- data/skeletons/CPU-OPENCL-AMD/common/mem_copy_H2D.c +0 -0
- data/skeletons/CPU-OPENCL-AMD/common/mem_epilogue.c +0 -0
- data/skeletons/CPU-OPENCL-AMD/common/mem_prologue.c +0 -0
- data/skeletons/CPU-OPENCL-AMD/common/prologue.c +0 -0
- data/skeletons/CPU-OPENCL-AMD/common/timer_1_start.c +0 -0
- data/skeletons/CPU-OPENCL-AMD/common/timer_1_stop.c +0 -0
- data/skeletons/CPU-OPENCL-AMD/common/timer_2_start.c +0 -0
- data/skeletons/CPU-OPENCL-AMD/common/timer_2_stop.c +0 -0
- data/skeletons/CPU-OPENCL-AMD/kernel/D-element-to-1-shared.host.c +0 -0
- data/skeletons/CPU-OPENCL-AMD/kernel/D-element-to-1-shared.kernel.cl +0 -0
- data/skeletons/CPU-OPENCL-AMD/kernel/default.host.c +0 -0
- data/skeletons/CPU-OPENCL-AMD/kernel/default.kernel.cl +0 -0
- data/skeletons/CPU-OPENCL-AMD/skeletons.txt +0 -0
- data/skeletons/CPU-OPENCL-INTEL/common/epilogue.c +0 -0
- data/skeletons/CPU-OPENCL-INTEL/common/globals.c +0 -0
- data/skeletons/CPU-OPENCL-INTEL/common/globals_kernel.c +0 -0
- data/skeletons/CPU-OPENCL-INTEL/common/header.c +0 -0
- data/skeletons/CPU-OPENCL-INTEL/common/mem_copy_D2H.c +0 -0
- data/skeletons/CPU-OPENCL-INTEL/common/mem_copy_H2D.c +0 -0
- data/skeletons/CPU-OPENCL-INTEL/common/mem_epilogue.c +0 -0
- data/skeletons/CPU-OPENCL-INTEL/common/mem_global.c +0 -0
- data/skeletons/CPU-OPENCL-INTEL/common/mem_prologue.c +0 -0
- data/skeletons/CPU-OPENCL-INTEL/common/prologue.c +0 -0
- data/skeletons/CPU-OPENCL-INTEL/common/timer_1_start.c +0 -0
- data/skeletons/CPU-OPENCL-INTEL/common/timer_1_stop.c +0 -0
- data/skeletons/CPU-OPENCL-INTEL/common/timer_2_start.c +0 -0
- data/skeletons/CPU-OPENCL-INTEL/common/timer_2_stop.c +0 -0
- data/skeletons/CPU-OPENCL-INTEL/common/timer_globals.c +5 -0
- data/skeletons/CPU-OPENCL-INTEL/kernel/D-element-to-1-shared.host.c +0 -0
- data/skeletons/CPU-OPENCL-INTEL/kernel/D-element-to-1-shared.kernel.cl +0 -0
- data/skeletons/CPU-OPENCL-INTEL/kernel/default.host.c +0 -0
- data/skeletons/CPU-OPENCL-INTEL/kernel/default.kernel.cl +0 -0
- data/skeletons/CPU-OPENCL-INTEL/skeletons.txt +0 -0
- data/skeletons/CPU-OPENMP/common/epilogue.c +0 -0
- data/skeletons/CPU-OPENMP/common/globals.c +0 -0
- data/skeletons/CPU-OPENMP/common/globals_kernel.c +0 -0
- data/skeletons/CPU-OPENMP/common/header.c +0 -0
- data/skeletons/CPU-OPENMP/common/mem_copy_D2H.c +0 -0
- data/skeletons/CPU-OPENMP/common/mem_copy_H2D.c +0 -0
- data/skeletons/CPU-OPENMP/common/mem_epilogue.c +0 -0
- data/skeletons/CPU-OPENMP/common/mem_global.c +0 -0
- data/skeletons/CPU-OPENMP/common/mem_prologue.c +0 -0
- data/skeletons/CPU-OPENMP/common/prologue.c +0 -0
- data/skeletons/CPU-OPENMP/common/timer_1_start.c +0 -0
- data/skeletons/CPU-OPENMP/common/timer_1_stop.c +0 -0
- data/skeletons/CPU-OPENMP/common/timer_2_start.c +0 -0
- data/skeletons/CPU-OPENMP/common/timer_2_stop.c +0 -0
- data/skeletons/CPU-OPENMP/common/timer_globals.c +2 -0
- data/skeletons/CPU-OPENMP/kernel/D-element-to-1-shared.host.c +0 -0
- data/skeletons/CPU-OPENMP/kernel/D-element-to-1-shared.kernel.c +3 -3
- data/skeletons/CPU-OPENMP/kernel/default.host.c +0 -0
- data/skeletons/CPU-OPENMP/kernel/default.kernel.c +0 -0
- data/skeletons/CPU-OPENMP/skeletons.txt +0 -0
- data/skeletons/GPU-CUDA/common/epilogue.c +0 -0
- data/skeletons/GPU-CUDA/common/globals.c +0 -0
- data/skeletons/GPU-CUDA/common/globals_kernel.c +0 -0
- data/skeletons/GPU-CUDA/common/header.c +0 -0
- data/skeletons/GPU-CUDA/common/mem_async_alloc.c +0 -0
- data/skeletons/GPU-CUDA/common/mem_async_copyin.c +0 -0
- data/skeletons/GPU-CUDA/common/mem_async_copyout.c +0 -0
- data/skeletons/GPU-CUDA/common/mem_async_free.c +0 -0
- data/skeletons/GPU-CUDA/common/mem_copy_D2H.c +0 -0
- data/skeletons/GPU-CUDA/common/mem_copy_H2D.c +0 -0
- data/skeletons/GPU-CUDA/common/mem_epilogue.c +0 -0
- data/skeletons/GPU-CUDA/common/mem_global.c +0 -0
- data/skeletons/GPU-CUDA/common/mem_prologue.c +0 -0
- data/skeletons/GPU-CUDA/common/prologue.c +0 -0
- data/skeletons/GPU-CUDA/common/scheduler.c +2 -2
- data/skeletons/GPU-CUDA/common/timer_1_start.c +0 -0
- data/skeletons/GPU-CUDA/common/timer_1_stop.c +0 -0
- data/skeletons/GPU-CUDA/common/timer_2_start.c +0 -0
- data/skeletons/GPU-CUDA/common/timer_2_stop.c +0 -0
- data/skeletons/GPU-CUDA/common/timer_globals.c +0 -0
- data/skeletons/GPU-CUDA/kernel/2xN-N-chunk-1-N-to-D-element.host.c +0 -0
- data/skeletons/GPU-CUDA/kernel/2xN-N-chunk-1-N-to-D-element.kernel.cu +0 -0
- data/skeletons/GPU-CUDA/kernel/D-element-to-1-shared.host.c +0 -0
- data/skeletons/GPU-CUDA/kernel/D-element-to-1-shared.kernel.cu +0 -0
- data/skeletons/GPU-CUDA/kernel/D-element-to-N-shared.host.c +0 -0
- data/skeletons/GPU-CUDA/kernel/D-element-to-N-shared.kernel.cu +0 -0
- data/skeletons/GPU-CUDA/kernel/N-N-chunk-1-N-to-D-element.host.c +0 -0
- data/skeletons/GPU-CUDA/kernel/N-N-chunk-1-N-to-D-element.kernel.cu +0 -0
- data/skeletons/GPU-CUDA/kernel/N-neighbourhood-N-to-N-element.host.c +0 -0
- data/skeletons/GPU-CUDA/kernel/N-neighbourhood-N-to-N-element.kernel.cu +0 -0
- data/skeletons/GPU-CUDA/kernel/default.host.c +0 -0
- data/skeletons/GPU-CUDA/kernel/default.kernel.cu +0 -0
- data/skeletons/GPU-CUDA/skeletons.txt +4 -2
- data/skeletons/GPU-OPENCL-AMD/common/epilogue.c +0 -0
- data/skeletons/GPU-OPENCL-AMD/common/globals.c +0 -0
- data/skeletons/GPU-OPENCL-AMD/common/globals_kernel.c +0 -0
- data/skeletons/GPU-OPENCL-AMD/common/header.c +0 -0
- data/skeletons/GPU-OPENCL-AMD/common/mem_copy_D2H.c +0 -0
- data/skeletons/GPU-OPENCL-AMD/common/mem_copy_H2D.c +0 -0
- data/skeletons/GPU-OPENCL-AMD/common/mem_epilogue.c +0 -0
- data/skeletons/GPU-OPENCL-AMD/common/mem_prologue.c +0 -0
- data/skeletons/GPU-OPENCL-AMD/common/prologue.c +0 -0
- data/skeletons/GPU-OPENCL-AMD/common/timer_1_start.c +0 -0
- data/skeletons/GPU-OPENCL-AMD/common/timer_1_stop.c +0 -0
- data/skeletons/GPU-OPENCL-AMD/common/timer_2_start.c +0 -0
- data/skeletons/GPU-OPENCL-AMD/common/timer_2_stop.c +0 -0
- data/skeletons/GPU-OPENCL-AMD/kernel/D-element-to-1-shared.host.c +0 -0
- data/skeletons/GPU-OPENCL-AMD/kernel/D-element-to-1-shared.kernel.cl +0 -0
- data/skeletons/GPU-OPENCL-AMD/kernel/default.host.c +0 -0
- data/skeletons/GPU-OPENCL-AMD/kernel/default.kernel.cl +0 -0
- data/skeletons/GPU-OPENCL-AMD/skeletons.txt +0 -0
- data/skeletons/verification/header.c +0 -0
- data/skeletons/verification/timer_start.c +0 -0
- data/skeletons/verification/timer_stop.c +0 -0
- data/skeletons/verification/verify_results.c +0 -0
- data/test/bones/test_algorithm.rb +0 -0
- data/test/bones/test_common.rb +0 -0
- data/test/bones/test_preprocessor.rb +0 -0
- data/test/bones/test_species.rb +0 -0
- data/test/bones/test_variable.rb +0 -0
- data/test/examples/benchmarks/PolyBench/2mm_species.c +1 -1
- data/test/examples/benchmarks/PolyBench/3mm_species.c +0 -0
- data/test/examples/benchmarks/PolyBench/adi_species.c +0 -0
- data/test/examples/benchmarks/PolyBench/atax_species.c +0 -0
- data/test/examples/benchmarks/PolyBench/bicg_species.c +0 -0
- data/test/examples/benchmarks/PolyBench/cholesky_species.c +0 -0
- data/test/examples/benchmarks/PolyBench/correlation_species.c +0 -0
- data/test/examples/benchmarks/PolyBench/covariance_species.c +0 -0
- data/test/examples/benchmarks/PolyBench/doitgen_species.c +0 -0
- data/test/examples/benchmarks/PolyBench/durbin_species.c +0 -0
- data/test/examples/benchmarks/PolyBench/dynprog_species.c +0 -0
- data/test/examples/benchmarks/PolyBench/fdtd-2d-apml_species.c +0 -0
- data/test/examples/benchmarks/PolyBench/fdtd-2d_species.c +0 -0
- data/test/examples/benchmarks/PolyBench/floyd-warshall_species.c +0 -0
- data/test/examples/benchmarks/PolyBench/gemm_species.c +0 -0
- data/test/examples/benchmarks/PolyBench/gemver_species.c +0 -0
- data/test/examples/benchmarks/PolyBench/gesummv_species.c +0 -0
- data/test/examples/benchmarks/PolyBench/gramschmidt_species.c +0 -0
- data/test/examples/benchmarks/PolyBench/jacobi-1d-imper_species.c +0 -0
- data/test/examples/benchmarks/PolyBench/jacobi-2d-imper_species.c +0 -0
- data/test/examples/benchmarks/PolyBench/lu_species.c +0 -0
- data/test/examples/benchmarks/PolyBench/ludcmp_species.c +0 -0
- data/test/examples/benchmarks/PolyBench/mvt_species.c +0 -0
- data/test/examples/benchmarks/PolyBench/reg_detect_species.c +0 -0
- data/test/examples/benchmarks/PolyBench/seidel-2d_species.c +0 -0
- data/test/examples/benchmarks/PolyBench/symm_species.c +0 -0
- data/test/examples/benchmarks/PolyBench/syr2k_species.c +0 -0
- data/test/examples/benchmarks/PolyBench/syrk_species.c +0 -0
- data/test/examples/benchmarks/PolyBench/trisolv_species.c +0 -0
- data/test/examples/benchmarks/PolyBench/trmm_species.c +0 -0
- data/test/examples/chunk/example01_species.c +3 -3
- data/test/examples/chunk/example02_species.c +3 -3
- data/test/examples/chunk/example03_species.c +3 -3
- data/test/examples/chunk/example04_species.c +3 -3
- data/test/examples/chunk/example05_species.c +3 -3
- data/test/examples/chunk/example06_species.c +1 -1
- data/test/examples/chunk/example07_species.c +3 -2
- data/test/examples/dependences/example01_species.c +1 -1
- data/test/examples/dependences/example02_species.c +1 -1
- data/test/examples/dependences/example03_species.c +1 -1
- data/test/examples/dependences/example04_species.c +1 -1
- data/test/examples/dependences/example05_species.c +1 -1
- data/test/examples/element/example01_species.c +3 -3
- data/test/examples/element/example02_species.c +3 -3
- data/test/examples/element/example03_species.c +7 -7
- data/test/examples/element/example04_species.c +3 -3
- data/test/examples/element/example05_species.c +3 -3
- data/test/examples/element/example06_species.c +3 -3
- data/test/examples/element/example07_species.c +3 -3
- data/test/examples/element/example08_species.c +3 -3
- data/test/examples/element/example09_species.c +3 -3
- data/test/examples/element/example10_species.c +1 -1
- data/test/examples/element/example11_species.c +1 -1
- data/test/examples/element/example12_species.c +1 -1
- data/test/examples/element/example13_species.c +1 -1
- data/test/examples/neighbourhood/example01_species.c +3 -3
- data/test/examples/neighbourhood/example02_species.c +3 -3
- data/test/examples/neighbourhood/example03_species.c +3 -3
- data/test/examples/neighbourhood/example04_species.c +3 -3
- data/test/examples/neighbourhood/example05_species.c +1 -1
- data/test/examples/shared/example01_species.c +3 -3
- data/test/examples/shared/example02_species.c +3 -3
- data/test/examples/shared/example03_species.c +3 -3
- data/test/examples/shared/example04_species.c +3 -3
- data/test/examples/shared/example05_species.c +3 -3
- data/test/test_helper.rb +2 -2
- metadata +266 -252
- checksums.yaml +0 -15
- data/examples/benchmarks/Rodinia/cfd.c +0 -180
|
@@ -8,15 +8,15 @@
|
|
|
8
8
|
// Web address........http://parse.ele.tue.nl/bones/
|
|
9
9
|
//
|
|
10
10
|
// == File information
|
|
11
|
-
// Filename...........element/
|
|
11
|
+
// Filename...........element/example05.c
|
|
12
12
|
// Author.............Cedric Nugteren
|
|
13
|
-
// Last modified on...
|
|
13
|
+
// Last modified on...10-October-2014
|
|
14
14
|
//
|
|
15
15
|
|
|
16
16
|
#include <stdio.h>
|
|
17
17
|
#define SIZE 2311
|
|
18
18
|
|
|
19
|
-
// This is '
|
|
19
|
+
// This is 'example05', demonstrating multiple inputs and outputs of different types
|
|
20
20
|
int main(void) {
|
|
21
21
|
int i;
|
|
22
22
|
float result = 0;
|
|
@@ -36,9 +36,11 @@ int main(void) {
|
|
|
36
36
|
}
|
|
37
37
|
|
|
38
38
|
// Perform the computation
|
|
39
|
-
#pragma
|
|
39
|
+
#pragma scop
|
|
40
|
+
#pragma species kernel in3[0:SIZE-1]|element ^ in2[0:SIZE-1]|element ^ in1[0:SIZE-1]|element -> out1[0:SIZE-1]|element ^ out2[0:SIZE-1]|element
|
|
40
41
|
for(i=0;i<SIZE;i++) {
|
|
41
|
-
|
|
42
|
+
float i3 = in3[i];
|
|
43
|
+
if (i3 > 50) {
|
|
42
44
|
result = in2[i] / in1[i];
|
|
43
45
|
}
|
|
44
46
|
else {
|
|
@@ -48,6 +50,7 @@ int main(void) {
|
|
|
48
50
|
out2[i] = in3[i]/255.0;
|
|
49
51
|
}
|
|
50
52
|
#pragma species endkernel example5
|
|
53
|
+
#pragma endscop
|
|
51
54
|
|
|
52
55
|
// Clean-up and exit the function
|
|
53
56
|
fflush(stdout);
|
|
@@ -8,15 +8,15 @@
|
|
|
8
8
|
// Web address........http://parse.ele.tue.nl/bones/
|
|
9
9
|
//
|
|
10
10
|
// == File information
|
|
11
|
-
// Filename...........element/
|
|
11
|
+
// Filename...........element/example06.c
|
|
12
12
|
// Author.............Cedric Nugteren
|
|
13
|
-
// Last modified on...
|
|
13
|
+
// Last modified on...10-October-2014
|
|
14
14
|
//
|
|
15
15
|
|
|
16
16
|
#include <stdio.h>
|
|
17
17
|
#include <stdlib.h>
|
|
18
18
|
|
|
19
|
-
// This is '
|
|
19
|
+
// This is 'example06', demonstrating dynamically sized arrays, a dynamically sized kernel, and a classification including variables
|
|
20
20
|
int main(void) {
|
|
21
21
|
int i;
|
|
22
22
|
int N = 2048*2048;
|
|
@@ -31,11 +31,13 @@ int main(void) {
|
|
|
31
31
|
}
|
|
32
32
|
|
|
33
33
|
// Perform the computation
|
|
34
|
-
#pragma
|
|
34
|
+
#pragma scop
|
|
35
|
+
#pragma species kernel A[0:N-1]|element -> B[0:N-1]|element
|
|
35
36
|
for(i=0;i<N;i++) {
|
|
36
37
|
B[i] = A[i] + 3;
|
|
37
38
|
}
|
|
38
39
|
#pragma species endkernel example6
|
|
40
|
+
#pragma endscop
|
|
39
41
|
|
|
40
42
|
// Clean-up and exit the function
|
|
41
43
|
free(A);
|
|
@@ -8,14 +8,14 @@
|
|
|
8
8
|
// Web address........http://parse.ele.tue.nl/bones/
|
|
9
9
|
//
|
|
10
10
|
// == File information
|
|
11
|
-
// Filename...........element/
|
|
11
|
+
// Filename...........element/example07.c
|
|
12
12
|
// Author.............Cedric Nugteren
|
|
13
|
-
// Last modified on...
|
|
13
|
+
// Last modified on...10-October-2014
|
|
14
14
|
|
|
15
15
|
#include <stdio.h>
|
|
16
16
|
#include <stdlib.h>
|
|
17
17
|
|
|
18
|
-
// This is '
|
|
18
|
+
// This is 'example07', demonstrating variable length arrays (C99 VLAs)
|
|
19
19
|
int main(void) {
|
|
20
20
|
int a,b,c;
|
|
21
21
|
int dim_1A = 50;
|
|
@@ -37,7 +37,8 @@ int main(void) {
|
|
|
37
37
|
}
|
|
38
38
|
|
|
39
39
|
// Perform the computation
|
|
40
|
-
#pragma
|
|
40
|
+
#pragma scop
|
|
41
|
+
#pragma species kernel in1[0:dim_1A-1,0:dim_1B-1,0:29]|element ^ in2[0:dim_1A-1,0:dim_1B-1,0:29]|element -> out[0:dim_1A-1,0:dim_1B-1,0:29]|element
|
|
41
42
|
for(a=0;a<dim_1A;a++) {
|
|
42
43
|
for(b=0;b<dim_1B;b++) {
|
|
43
44
|
for(c=0;c<30;c++) {
|
|
@@ -46,6 +47,7 @@ int main(void) {
|
|
|
46
47
|
}
|
|
47
48
|
}
|
|
48
49
|
#pragma species endkernel example7
|
|
50
|
+
#pragma endscop
|
|
49
51
|
|
|
50
52
|
// Clean-up and exit the function
|
|
51
53
|
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/
|
|
11
|
+
// Filename...........element/example08.c
|
|
12
12
|
// Author.............Cedric Nugteren
|
|
13
|
-
// Last modified on...
|
|
13
|
+
// Last modified on...10-October-2014
|
|
14
14
|
//
|
|
15
15
|
|
|
16
16
|
#include <stdio.h>
|
|
17
17
|
|
|
18
|
-
// This is '
|
|
18
|
+
// This is 'example08', demonstrating a reading and writing from the same array
|
|
19
19
|
int main(void) {
|
|
20
20
|
int i,j;
|
|
21
21
|
|
|
@@ -30,13 +30,15 @@ int main(void) {
|
|
|
30
30
|
}
|
|
31
31
|
|
|
32
32
|
// Perform the computation
|
|
33
|
-
#pragma
|
|
33
|
+
#pragma scop
|
|
34
|
+
#pragma species kernel A[0:99,0:15]|element -> A[0:99,0:15]|element
|
|
34
35
|
for(i=0;i<100;i++) {
|
|
35
36
|
for(j=0;j<16;j++) {
|
|
36
37
|
A[i][j] = 2*A[i][j];
|
|
37
38
|
}
|
|
38
39
|
}
|
|
39
40
|
#pragma species endkernel example8
|
|
41
|
+
#pragma endscop
|
|
40
42
|
|
|
41
43
|
// Clean-up and exit the function
|
|
42
44
|
fflush(stdout);
|
|
@@ -8,15 +8,15 @@
|
|
|
8
8
|
// Web address........http://parse.ele.tue.nl/bones/
|
|
9
9
|
//
|
|
10
10
|
// == File information
|
|
11
|
-
// Filename...........element/
|
|
11
|
+
// Filename...........element/example09.c
|
|
12
12
|
// Author.............Cedric Nugteren
|
|
13
|
-
// Last modified on...
|
|
13
|
+
// Last modified on...10-October-2014
|
|
14
14
|
//
|
|
15
15
|
|
|
16
16
|
#include <stdio.h>
|
|
17
17
|
#include <stdlib.h>
|
|
18
18
|
|
|
19
|
-
// This is '
|
|
19
|
+
// This is 'example09', demonstrating a for-loop that does not start at zero
|
|
20
20
|
int main(void) {
|
|
21
21
|
int i;
|
|
22
22
|
int result;
|
|
@@ -32,12 +32,14 @@ int main(void) {
|
|
|
32
32
|
}
|
|
33
33
|
|
|
34
34
|
// Perform the computation
|
|
35
|
-
#pragma
|
|
35
|
+
#pragma scop
|
|
36
|
+
#pragma species kernel A[2:N-1]|element -> B[2:N-1]|element
|
|
36
37
|
for(i=2;i<N;i++) {
|
|
37
38
|
result = A[i] + 3;
|
|
38
39
|
B[i] = result * 3;
|
|
39
40
|
}
|
|
40
41
|
#pragma species endkernel example9
|
|
42
|
+
#pragma endscop
|
|
41
43
|
|
|
42
44
|
// Clean-up and exit the function
|
|
43
45
|
free(A);
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
// == File information
|
|
11
11
|
// Filename...........element/example10.c
|
|
12
12
|
// Author.............Cedric Nugteren
|
|
13
|
-
// Last modified on...
|
|
13
|
+
// Last modified on...10-October-2014
|
|
14
14
|
//
|
|
15
15
|
|
|
16
16
|
#include <stdio.h>
|
|
@@ -35,13 +35,15 @@ int main(void) {
|
|
|
35
35
|
}
|
|
36
36
|
|
|
37
37
|
// Perform the computation
|
|
38
|
-
#pragma
|
|
38
|
+
#pragma scop
|
|
39
|
+
#pragma species kernel A[2:N-1,1:M-1]|element -> B[2:N-1,1:M-1]|element
|
|
39
40
|
for(i=2;i<N;i++) {
|
|
40
41
|
for(j=1;j<M;j++) {
|
|
41
42
|
B[i][j] = A[i][j];
|
|
42
43
|
}
|
|
43
44
|
}
|
|
44
45
|
#pragma species endkernel
|
|
46
|
+
#pragma endscop
|
|
45
47
|
|
|
46
48
|
// Clean-up and exit the function
|
|
47
49
|
fflush(stdout);
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
// == File information
|
|
11
11
|
// Filename...........element/example11.c
|
|
12
12
|
// Author.............Cedric Nugteren
|
|
13
|
-
// Last modified on...
|
|
13
|
+
// Last modified on...10-October-2014
|
|
14
14
|
//
|
|
15
15
|
|
|
16
16
|
#include <stdio.h>
|
|
@@ -32,13 +32,15 @@ int main(void) {
|
|
|
32
32
|
}
|
|
33
33
|
|
|
34
34
|
// Perform the computation
|
|
35
|
+
#pragma scop
|
|
35
36
|
for(i=0;i<128;i++) {
|
|
36
|
-
#pragma species kernel i:i,i:127|element -> i:i,i:127|element
|
|
37
|
+
#pragma species kernel A[i:i,i:127]|element -> B[i:i,i:127]|element
|
|
37
38
|
for(j=i;j<128;j++) {
|
|
38
39
|
B[i][j] = 2*A[i][j];
|
|
39
40
|
}
|
|
40
41
|
#pragma species endkernel example11
|
|
41
42
|
}
|
|
43
|
+
#pragma endscop
|
|
42
44
|
|
|
43
45
|
// Clean-up and exit the function
|
|
44
46
|
fflush(stdout);
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
// == File information
|
|
11
11
|
// Filename...........element/example12.c
|
|
12
12
|
// Author.............Cedric Nugteren
|
|
13
|
-
// Last modified on...
|
|
13
|
+
// Last modified on...10-October-2014
|
|
14
14
|
//
|
|
15
15
|
|
|
16
16
|
#include <stdio.h>
|
|
@@ -48,9 +48,11 @@ void computation(int* A, int* B, int constant) {
|
|
|
48
48
|
int i;
|
|
49
49
|
|
|
50
50
|
// Perform the computation
|
|
51
|
-
#pragma
|
|
51
|
+
#pragma scop
|
|
52
|
+
#pragma species kernel A[0:127]|element -> B[0:127]|element
|
|
52
53
|
for(i=0;i<128;i++) {
|
|
53
54
|
B[i] = 2*A[i] + constant;
|
|
54
55
|
}
|
|
55
56
|
#pragma species endkernel example12
|
|
57
|
+
#pragma endscop
|
|
56
58
|
}
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
// == File information
|
|
11
11
|
// Filename...........element/example13.c
|
|
12
12
|
// Author.............Cedric Nugteren
|
|
13
|
-
// Last modified on...
|
|
13
|
+
// Last modified on...10-October-2014
|
|
14
14
|
//
|
|
15
15
|
|
|
16
16
|
#include <stdio.h>
|
|
@@ -39,6 +39,7 @@ int main(void) {
|
|
|
39
39
|
}
|
|
40
40
|
|
|
41
41
|
// Perform the computation
|
|
42
|
+
#pragma scop
|
|
42
43
|
#pragma species kernel C[0:N-1]|element -> B[11:N-1]|element ^ A[0:5]|element
|
|
43
44
|
for (i=0; i<N; i++) {
|
|
44
45
|
if (i > 10) {
|
|
@@ -65,6 +66,7 @@ int main(void) {
|
|
|
65
66
|
}
|
|
66
67
|
}
|
|
67
68
|
#pragma species endkernel example13_k3
|
|
69
|
+
#pragma endscop
|
|
68
70
|
|
|
69
71
|
// Clean-up and exit the function
|
|
70
72
|
fflush(stdout);
|
data/examples/fusion/example01.c
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
// == File information
|
|
11
11
|
// Filename...........fusion/example01.c
|
|
12
12
|
// Author.............Cedric Nugteren
|
|
13
|
-
// Last modified on...
|
|
13
|
+
// Last modified on...11-October-2014
|
|
14
14
|
//
|
|
15
15
|
|
|
16
16
|
#include <stdio.h>
|
|
@@ -34,6 +34,7 @@ int main(void) {
|
|
|
34
34
|
}
|
|
35
35
|
|
|
36
36
|
// Perform the computation
|
|
37
|
+
#pragma scop
|
|
37
38
|
#pragma species kernel A[0:N-1,0:M-1]|element -> B[0:N-1,0:M-1]|element
|
|
38
39
|
for(i=0;i<N;i++) {
|
|
39
40
|
for(j=0;j<M;j++) {
|
|
@@ -48,17 +49,7 @@ int main(void) {
|
|
|
48
49
|
}
|
|
49
50
|
}
|
|
50
51
|
#pragma species endkernel example01-part2
|
|
51
|
-
|
|
52
|
-
/*
|
|
53
|
-
#pragma species kernel A[0:N-1,0:M-1]|element -> B[0:N-1,0:M-1]|element ^ C[0:N-1,0:M-1]|element
|
|
54
|
-
for(i=0;i<N;i++) {
|
|
55
|
-
for(j=0;j<M;j++) {
|
|
56
|
-
B[i][j] = 2*A[i][j];
|
|
57
|
-
C[i][j] = 8*B[i][j];
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
#pragma species endkernel example01-fused
|
|
61
|
-
*/
|
|
52
|
+
#pragma endscop
|
|
62
53
|
|
|
63
54
|
// Clean-up and exit the function
|
|
64
55
|
fflush(stdout);
|
data/examples/fusion/example02.c
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
// == File information
|
|
11
11
|
// Filename...........fusion/example02.c
|
|
12
12
|
// Author.............Cedric Nugteren
|
|
13
|
-
// Last modified on...
|
|
13
|
+
// Last modified on...11-October-2014
|
|
14
14
|
//
|
|
15
15
|
|
|
16
16
|
#include <stdio.h>
|
|
@@ -35,6 +35,7 @@ int main(void) {
|
|
|
35
35
|
}
|
|
36
36
|
|
|
37
37
|
// Perform the computation
|
|
38
|
+
#pragma scop
|
|
38
39
|
#pragma species kernel A[0:N-1,10:M-1]|element -> B[0:N-1,10:M-1]|element
|
|
39
40
|
for(i=0;i<N;i++) {
|
|
40
41
|
for(j=10;j<M;j++) {
|
|
@@ -49,21 +50,7 @@ int main(void) {
|
|
|
49
50
|
}
|
|
50
51
|
}
|
|
51
52
|
#pragma species endkernel example02-part2
|
|
52
|
-
|
|
53
|
-
/*
|
|
54
|
-
#pragma species kernel A[0:N-1,0:M-1]|element -> B[0:N-1,0:M-1]|element ^ C[0:N-1,0:M-1]|element
|
|
55
|
-
for(i=0;i<MAX(N,M);i++) {
|
|
56
|
-
for(j=0;j<M;j++) {
|
|
57
|
-
if (j >= 10 && i < N) {
|
|
58
|
-
B[i][j] = A[i][j] + 3;
|
|
59
|
-
}
|
|
60
|
-
if (i < M) {
|
|
61
|
-
C[i][j] = -9*A[i][j];
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
#pragma species endkernel example02-fused
|
|
66
|
-
*/
|
|
53
|
+
#pragma endscop
|
|
67
54
|
|
|
68
55
|
// Clean-up and exit the function
|
|
69
56
|
fflush(stdout);
|
data/examples/fusion/example03.c
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
// == File information
|
|
11
11
|
// Filename...........fusion/example03.c
|
|
12
12
|
// Author.............Cedric Nugteren
|
|
13
|
-
// Last modified on...
|
|
13
|
+
// Last modified on...11-October-2014
|
|
14
14
|
//
|
|
15
15
|
|
|
16
16
|
#include <stdio.h>
|
|
@@ -37,6 +37,7 @@ int main(void) {
|
|
|
37
37
|
for (i=0; i<2048; i++) { for (j=0; j<2048; j++) { D[i][j] = ((float) i*(j+2)) / 2048; } }
|
|
38
38
|
|
|
39
39
|
// Perform the computation (E := alpha*A*B*C + beta*D)
|
|
40
|
+
#pragma scop
|
|
40
41
|
#pragma species copyin A[0:2047,0:2047]|0 ^ B[0:2047,0:2047]|0 ^ D[0:2047,0:2047]|1 ^ C[0:2047,0:2047]|1
|
|
41
42
|
#pragma species sync 0
|
|
42
43
|
#pragma species kernel A[0:2047,0:2047]|chunk(0:0,0:2047) ^ B[0:2047,0:2047]|chunk(0:2047,0:0) -> tmp[0:2047,0:2047]|element
|
|
@@ -63,6 +64,7 @@ int main(void) {
|
|
|
63
64
|
#pragma species endkernel example03-part2
|
|
64
65
|
#pragma species copyout D[0:2047,0:2047]|2
|
|
65
66
|
#pragma species sync 2
|
|
67
|
+
#pragma endscop
|
|
66
68
|
|
|
67
69
|
// Clean-up and exit the function
|
|
68
70
|
fflush(stdout);
|
data/examples/fusion/example04.c
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
// == File information
|
|
11
11
|
// Filename...........fusion/example04.c
|
|
12
12
|
// Author.............Cedric Nugteren
|
|
13
|
-
// Last modified on...
|
|
13
|
+
// Last modified on...11-October-2014
|
|
14
14
|
//
|
|
15
15
|
|
|
16
16
|
#include <stdio.h>
|
|
@@ -36,7 +36,8 @@ int main(void) {
|
|
|
36
36
|
}
|
|
37
37
|
|
|
38
38
|
// Perform the computation (y := A'Ax)
|
|
39
|
-
#pragma
|
|
39
|
+
#pragma scop
|
|
40
|
+
#pragma species kernel A[0:4095,0:4095]|chunk(0:0,0:4095) ^ x[0:4095]|full -> tmp[0:4095]|element
|
|
40
41
|
for (i=0; i<4096; i++) {
|
|
41
42
|
tmp[i] = 0;
|
|
42
43
|
for (j=0; j<4096; j++) {
|
|
@@ -44,7 +45,7 @@ int main(void) {
|
|
|
44
45
|
}
|
|
45
46
|
}
|
|
46
47
|
#pragma species endkernel atax-part1
|
|
47
|
-
#pragma species kernel 0:4095,0:4095|chunk(0:4095,0:0) ^ 0:4095|full -> 0:4095|element
|
|
48
|
+
#pragma species kernel A[0:4095,0:4095]|chunk(0:4095,0:0) ^ tmp[0:4095]|full -> y[0:4095]|element
|
|
48
49
|
for (j=0; j<4096; j++) {
|
|
49
50
|
y[j] = 0;
|
|
50
51
|
for (i=0; i<4096; i++) {
|
|
@@ -52,6 +53,7 @@ int main(void) {
|
|
|
52
53
|
}
|
|
53
54
|
}
|
|
54
55
|
#pragma species endkernel atax-part2
|
|
56
|
+
#pragma endscop
|
|
55
57
|
|
|
56
58
|
// Clean-up and exit the function
|
|
57
59
|
fflush(stdout);
|
data/examples/fusion/example05.c
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
// == File information
|
|
11
11
|
// Filename...........fusion/example05.c
|
|
12
12
|
// Author.............Cedric Nugteren
|
|
13
|
-
// Last modified on...
|
|
13
|
+
// Last modified on...11-October-2014
|
|
14
14
|
//
|
|
15
15
|
|
|
16
16
|
#include <stdio.h>
|
|
@@ -32,6 +32,7 @@ int main(void) {
|
|
|
32
32
|
}
|
|
33
33
|
|
|
34
34
|
// Perform the computation
|
|
35
|
+
#pragma scop
|
|
35
36
|
#pragma species kernel A[0:2047,0:1023]|element -> B[0:2047,0:1023]|element
|
|
36
37
|
for(i=0;i<2048;i++) {
|
|
37
38
|
for(j=0;j<1024;j++) {
|
|
@@ -46,6 +47,7 @@ int main(void) {
|
|
|
46
47
|
}
|
|
47
48
|
}
|
|
48
49
|
#pragma species endkernel example05-part2
|
|
50
|
+
#pragma endscop
|
|
49
51
|
|
|
50
52
|
// Clean-up and exit the function
|
|
51
53
|
fflush(stdout);
|
|
@@ -8,16 +8,16 @@
|
|
|
8
8
|
// Web address........http://parse.ele.tue.nl/bones/
|
|
9
9
|
//
|
|
10
10
|
// == File information
|
|
11
|
-
// Filename...........neighbourhood/
|
|
11
|
+
// Filename...........neighbourhood/example01.c
|
|
12
12
|
// Author.............Cedric Nugteren
|
|
13
|
-
// Last modified on...
|
|
13
|
+
// Last modified on...10-October-2014
|
|
14
14
|
//
|
|
15
15
|
|
|
16
16
|
#include <stdio.h>
|
|
17
17
|
#define SIZE 60000
|
|
18
18
|
#define NB 2
|
|
19
19
|
|
|
20
|
-
// This is '
|
|
20
|
+
// This is 'example01', demonstrating a basic 1D neighbourhood-based computation whose size is set by a define
|
|
21
21
|
int main(void) {
|
|
22
22
|
int i,n;
|
|
23
23
|
float result = 0;
|
|
@@ -32,7 +32,8 @@ int main(void) {
|
|
|
32
32
|
}
|
|
33
33
|
|
|
34
34
|
// Perform the computation
|
|
35
|
-
#pragma
|
|
35
|
+
#pragma scop
|
|
36
|
+
#pragma species kernel A[0:SIZE-1]|neighbourhood(-NB:NB) -> B[0:SIZE-1]|element
|
|
36
37
|
for(i=0;i<SIZE;i++) {
|
|
37
38
|
if (i >= NB && i < SIZE-NB) {
|
|
38
39
|
result = 0;
|
|
@@ -46,6 +47,7 @@ int main(void) {
|
|
|
46
47
|
}
|
|
47
48
|
}
|
|
48
49
|
#pragma species endkernel example1
|
|
50
|
+
#pragma endscop
|
|
49
51
|
|
|
50
52
|
// Clean-up and exit the function
|
|
51
53
|
fflush(stdout);
|