1.23
2.0
acw/focus-triggers
main
test-branch
| 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
|
|---|
| 12 | static const size_t board_size = WIDTH * HEIGHT;
|
|---|
| 13 | static bool board[board_size];
|
|---|
| 14 | // Storage for the board.
|
|---|
| 15 | static cl_mem input;
|
|---|
| 16 | static cl_mem output;
|
|---|
| 17 | // OpenCL state
|
|---|
| 18 | static cl_command_queue queue;
|
|---|
| 19 | static cl_kernel kernel;
|
|---|
| 20 | static cl_device_id device_id;
|
|---|
| 21 | static cl_context context;
|
|---|
| 22 |
|
|---|
| 23 | //CIVL models scanf() differently, uses symbolic expressions and loops forever here
|
|---|
| 24 | //Always possible for iterations > 0
|
|---|
| 25 | int 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.