From ccade8e6ed96fb48b329d22aaa4c8d0826b3c8d1 Mon Sep 17 00:00:00 2001 From: tomsmeding Date: Sat, 20 Apr 2019 19:41:16 +0200 Subject: Move some code out of main.cpp --- aberth/kernel.h | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 aberth/kernel.h (limited to 'aberth/kernel.h') 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 +#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::value); + + Kernel(); + ~Kernel(); + + void run_job( + vector &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 &dest, + int32_t width, int32_t height, + Com bottomLeft, Com topRight, + int32_t seed); + + void run_chunked( + vector &dest, + int32_t width, int32_t height, + Com bottomLeft, Com topRight, + int32_t seed, + int32_t chunk_size); +}; -- cgit v1.2.3-70-g09d2