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

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

ABC when

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

  • Property mode set to 100644
File size: 810 bytes
Line 
1
2#include "openCLshared.cvl"
3#include <stdio.h>
4#include <stdlib.h>
5#include <string.h>
6
7$input int ITERATIONS;
8$input int WIDTH;
9$input int HEIGHT;
10
11// The board
12static const size_t board_size = WIDTH * HEIGHT;
13static bool board[board_size];
14// Storage for the board.
15static cl_mem input;
16static cl_mem output;
17// OpenCL state
18static cl_command_queue queue;
19static cl_kernel kernel;
20static cl_device_id device_id;
21static cl_context context;
22
23//CIVL models scanf() differently, uses symbolic expressions and loops forever here
24//Always possible for iterations > 0
25int main(int argc, char** argv)
26{
27
28 for(unsigned int i=0 ; i<board_size; i++)
29 {
30 board[i] = (random() % 2);
31 }
32
33
34 for(int i = 0; i < ITERATIONS; i++)
35 {
36 printf("Running for how %d iterations\n", ITERATIONS);
37 }
38
39
40 return 0;
41}
Note: See TracBrowser for help on using the repository browser.