aboutsummaryrefslogtreecommitdiff
path: root/aberth/kernel.h
blob: 3ab277257853c3c5b4d2677e9795647b968443e0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#pragma once

#include <vector>
#include <type_traits>
#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);
};