aboutsummaryrefslogtreecommitdiff
path: root/aberth/kernel.h
diff options
context:
space:
mode:
Diffstat (limited to 'aberth/kernel.h')
-rw-r--r--aberth/kernel.h44
1 files changed, 44 insertions, 0 deletions
diff --git a/aberth/kernel.h b/aberth/kernel.h
new file mode 100644
index 0000000..bd8ea32
--- /dev/null
+++ b/aberth/kernel.h
@@ -0,0 +1,44 @@
+#pragma once
+
+#include <vector>
+#include "defs.h"
+
+extern "C" {
+#include "aberth_kernel.h"
+}
+
+using namespace std;
+
+
+class Kernel {
+ futhark_context *ctx;
+ int32_t N;
+
+ void check_ret(int ret);
+
+public:
+ static_assert(is_same<int32_t, int>::value);
+
+ Kernel();
+ ~Kernel();
+
+ void run_job(
+ vector<int32_t> &dest,
+ int32_t width, int32_t height,
+ Com bottomLeft, Com topRight,
+ int32_t seed,
+ int32_t start_index, int32_t poly_count);
+
+ void run_all(
+ vector<int32_t> &dest,
+ int32_t width, int32_t height,
+ Com bottomLeft, Com topRight,
+ int32_t seed);
+
+ void run_chunked(
+ vector<int32_t> &dest,
+ int32_t width, int32_t height,
+ Com bottomLeft, Com topRight,
+ int32_t seed,
+ int32_t chunk_size);
+};