diff options
Diffstat (limited to 'openmp/include')
-rw-r--r-- | openmp/include/create_grid.h | 12 | ||||
-rw-r--r-- | openmp/include/file.h | 11 | ||||
-rw-r--r-- | openmp/include/game.h | 23 |
3 files changed, 46 insertions, 0 deletions
diff --git a/openmp/include/create_grid.h b/openmp/include/create_grid.h new file mode 100644 index 0000000..45ac891 --- /dev/null +++ b/openmp/include/create_grid.h @@ -0,0 +1,12 @@ +#include <stdio.h> +#include <stdlib.h> +#include "file.h" +#include "game.h" + +#ifndef CREATE_GRID_H +#define CREATE_GRID_H + +void print_grid(struct GAME* game); +void create_grid(int argc, char** argv); + +#endif // CREATE_GRID_H diff --git a/openmp/include/file.h b/openmp/include/file.h new file mode 100644 index 0000000..b2db380 --- /dev/null +++ b/openmp/include/file.h @@ -0,0 +1,11 @@ +#include "game.h" +#include <stdlib.h> +#include <stdio.h> + +#ifndef FILE_H +#define FILE_H + +void read_in(char* filename, struct GAME* game); +void write_out(char* filename, struct GAME* game); + +#endif //FILE_H diff --git a/openmp/include/game.h b/openmp/include/game.h new file mode 100644 index 0000000..0f9ab46 --- /dev/null +++ b/openmp/include/game.h @@ -0,0 +1,23 @@ +#include <stdlib.h> +#include <stdio.h> +#include <string.h> +#include <omp.h> +#include <math.h> + +#ifndef GAME_H +#define GAME_H + + +struct GAME { + unsigned char** grid; + int padding; + int width; + int height; +}; + +int neighbors(struct GAME* game, int x, int y); +void next(struct GAME* game, int num_threads); +void update(struct GAME* game, int x1, int x2, int y1, int y2); +void randomize(struct GAME* game); + +#endif // GAME_H |