aboutsummaryrefslogtreecommitdiff
path: root/src/render_opencl.h
blob: 51945d59b96f4da2264036f4fd38c5cdb5393eee (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
46
47
48
49
50
51
52
53
54
55
/*
 * render_opencl.h
 *
 *  Created on: 25.01.2018
 *      Author: Superleo1810
 */

#ifndef RENDER_OPENCL_H_
#define RENDER_OPENCL_H_

#include "defs.h"
#include <stdlib.h>
#include <GL/glut.h>
#include <CL/cl.h>
#include "sets.h"
#include <math.h>
#include "config.h"

#define OPENCL_FPU_32 0
#define OPENCL_FPU_64 1
#define OPENCL_FPU_128 2

#define MAX_SOURCE_SIZE 0xFFFF // 64 KiB
#define MAX_DEVICES 4

config_t *config_opencl;

cl_double x_min_cl, x_max_cl, y_min_cl, y_max_cl;
cl_double x_min_s_cl, x_max_s_cl, y_min_s_cl, y_max_s_cl;

float cl_ft;
cl_uint *output;
cl_device_id device_id;
cl_context context;
cl_int ret;
cl_kernel kernel_vector[MAX_DEVICES];
cl_uint num_devices;
cl_device_id *devices;
cl_command_queue commandQueue[MAX_DEVICES];
cl_mem outputBuffer[MAX_DEVICES];

cl_int width_cl;

int t_old_opencl;

d64 zoom_func(d64 ft, d64 s);

void init_opencl(config_t *cfg);
void render_opencl(void);
void idle_opencl(void);
void idle_opencl_dummy(void);
void keyboard_opencl(unsigned char key, int mouseX, int mouseY);
void mouse_opencl(int button, int state, int x, int y);

#endif /* RENDER_OPENCL_H_ */