Sha256: 27c0edfe5e594b783c44d07508c6b01a652cf1fca59c2c86a33997caf5917d8f
Contents?: true
Size: 1.06 KB
Versions: 2
Compression:
Stored size: 1.06 KB
Contents
// // This file is part of the Bones source-to-source compiler examples. This C-code // example is meant to illustrate the use of Bones. For more information on Bones // use the contact information below. // // == More information on Bones // Contact............Cedric Nugteren <c.nugteren@tue.nl> // Web address........http://parse.ele.tue.nl/bones/ // // == File information // Filename...........chunk/example2.c // Author.............Cedric Nugteren // Last modified on...16-April-2012 // #include <stdio.h> #define SIZE 2048 #define HALFSIZE (SIZE/2) // This is 'example2', demonstrating a chunk-example without an inner-loop, everything is unrolled manually int main(void) { int i; // Declare input/output arrays float A[SIZE]; float B[HALFSIZE]; // Set the input data for(i=0;i<SIZE;i++) { A[i] = i%6+i; } // Perform the computation #pragma species kernel 0:SIZE-1|chunk(0:1) -> 0:HALFSIZE-1|element for(i=0;i<HALFSIZE;i++) { B[i] = A[i*2] + A[i*2+1]; } #pragma species endkernel example2 // Clean-up and exit the function fflush(stdout); return 0; }
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
bones-compiler-1.3.1 | examples/chunk/example02.c |
bones-compiler-1.1.0 | examples/chunk/example2.c |