diff options
author | tomsmeding <tom.smeding@gmail.com> | 2019-04-20 19:41:16 +0200 |
---|---|---|
committer | tomsmeding <tom.smeding@gmail.com> | 2019-04-20 19:41:16 +0200 |
commit | ccade8e6ed96fb48b329d22aaa4c8d0826b3c8d1 (patch) | |
tree | b9389a557869a38d0cdb9de02247abf1446e5db3 /aberth/kernel.h | |
parent | dc6f869c48c267e2091d686a66209c4f741d62e4 (diff) |
Move some code out of main.cpp
Diffstat (limited to 'aberth/kernel.h')
-rw-r--r-- | aberth/kernel.h | 44 |
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); +}; |