source: CIVL/examples/translation/openclversion2.1/openSimp.cvl@ 764d472

1.23 2.0 main test-branch
Last change on this file since 764d472 was e1b39409, checked in by Jacob Trieu <fuufusuu@…>, 12 years ago

git-svn-id: svn://vsl.cis.udel.edu/civl/trunk@1235 fb995dde-84ed-4084-dfe6-e5aef3e2452c

  • Property mode set to 100644
File size: 427 bytes
Line 
1#include <civlc.h>
2void square(int global_id, int input[], int output[], int count)
3{
4 int i = global_id;
5 if (i < count)
6 {
7 output[i] = input[i] * input[i];
8 }
9}
10int main(int argc, char** argv)
11{
12 int global = 4;
13
14 int input[global];
15 int output[global];
16
17 for(int i = 0; i < global; i++)
18 {
19 input[i] = i;
20 }
21
22 for(int i = 0; i < global; i++)
23 {
24 square(i, input, output, global);
25 }
26 return 0;
27}
Note: See TracBrowser for help on using the repository browser.