summaryrefslogtreecommitdiffstats
path: root/config.h
diff options
context:
space:
mode:
authorroot <root@ipepdvdev1.ipe.kit.edu>2016-05-25 06:35:59 +0200
committerroot <root@ipepdvdev1.ipe.kit.edu>2016-05-25 06:35:59 +0200
commita6f3e96f2cafc183ab29e53007a86bb968d654b8 (patch)
tree5248f06934289d65e366507890ebac3c7a4816ab /config.h
parentca1b1cea796bcfaeb86f201cf35065a606921cc1 (diff)
downloadgdrtest-a6f3e96f2cafc183ab29e53007a86bb968d654b8.tar.gz
gdrtest-a6f3e96f2cafc183ab29e53007a86bb968d654b8.tar.bz2
gdrtest-a6f3e96f2cafc183ab29e53007a86bb968d654b8.tar.xz
gdrtest-a6f3e96f2cafc183ab29e53007a86bb968d654b8.zip
Support bigger writes
Diffstat (limited to 'config.h')
-rw-r--r--config.h37
1 files changed, 30 insertions, 7 deletions
diff --git a/config.h b/config.h
index 7d95924..a0d29f3 100644
--- a/config.h
+++ b/config.h
@@ -1,13 +1,36 @@
-#define ITERS 100
-#define GPU_ITERS 100
+#define VERBOSE
+#define GPU_DESC
+#define USE_HW_CONTER
-#define TLP_SIZE 64
#define GPU_PAGE 65536
-#define PAGE_SIZE 4096
+#define MIN(a, b) (((a) > (b))?(b):(a))
+#define MAX(a, b) (((a) < (b))?(b):(a))
-#define VERBOSE
-#define GPU_DESC
+#ifdef SIZE
+# if SIZE >= 65536
+# define TLP_SIZE 64
+# define PAGE_SIZE 65536
+# define NUM_PAGES (SIZE / GPU_PAGE)
+# elif SIZE >= 256
+# define TLP_SIZE 64
+# define PAGE_SIZE SIZE
+# define NUM_PAGES 1
+# else
+# define TLP_SIZE (SIZE / 4)
+# define PAGE_SIZE SIZE
+# define NUM_PAGES 1
+# endif
-#define USE_HW_CONTER
+# define GPU_ITERS MIN(100, MAX(4, 4l * 1024 * 1024 * 1024 / SIZE))
+# define ITERS MIN(100, MAX(10, 4l * 1024 * 1024 * 1024 / SIZE))
+#else
+# define ITERS 100
+# define GPU_ITERS 100
+
+# define TLP_SIZE 64
+# define PAGE_SIZE 4096
+# define NUM_PAGES 4
+# define SIZE (NUM_PAGES * PAGE_SIZE)
+#endif