summaryrefslogtreecommitdiff
path: root/cuda-global/include
diff options
context:
space:
mode:
authorSimponic <loganhunt@simponic.xyz>2021-12-04 13:34:49 -0700
committerSimponic <loganhunt@simponic.xyz>2021-12-04 13:34:49 -0700
commitaa1d7c6e284cc0818325614391619f3ff13d3e94 (patch)
tree8a59a6b3e5aacb7f682756d3c7751f1d72e1d940 /cuda-global/include
downloadgol-aa1d7c6e284cc0818325614391619f3ff13d3e94.tar.gz
gol-aa1d7c6e284cc0818325614391619f3ff13d3e94.zip
Initial commit
Diffstat (limited to 'cuda-global/include')
-rw-r--r--cuda-global/include/create_grid.cuh12
-rw-r--r--cuda-global/include/file.cuh11
-rw-r--r--cuda-global/include/game.cuh21
3 files changed, 44 insertions, 0 deletions
diff --git a/cuda-global/include/create_grid.cuh b/cuda-global/include/create_grid.cuh
new file mode 100644
index 0000000..3402468
--- /dev/null
+++ b/cuda-global/include/create_grid.cuh
@@ -0,0 +1,12 @@
+#include <stdio.h>
+#include <stdlib.h>
+#include "file.cuh"
+#include "game.cuh"
+
+#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/cuda-global/include/file.cuh b/cuda-global/include/file.cuh
new file mode 100644
index 0000000..594eb4b
--- /dev/null
+++ b/cuda-global/include/file.cuh
@@ -0,0 +1,11 @@
+#include "game.cuh"
+#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/cuda-global/include/game.cuh b/cuda-global/include/game.cuh
new file mode 100644
index 0000000..873a4cf
--- /dev/null
+++ b/cuda-global/include/game.cuh
@@ -0,0 +1,21 @@
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+#include <omp.h>
+
+#ifndef GAME_H
+#define GAME_H
+
+
+struct GAME {
+ unsigned char* grid;
+ int padding;
+ int width;
+ int height;
+};
+
+__device__ int neighbors(struct GAME game, int x, int y);
+__global__ void next(struct GAME game, unsigned char* newGrid);
+void randomize(struct GAME* game);
+
+#endif // GAME_H