Working to make OpenCL recognize the limitations of the device its on, as well as reusing the OpenCL kernel/context for multiple runs.

Signed-off-by: gothictomato <gothictomato@pm.me>
This commit is contained in:
gothictomato
2022-08-27 09:11:29 -04:00
parent 84374e23fd
commit e2b633c802
5 changed files with 424 additions and 16 deletions

View File

@@ -1,4 +1,27 @@
#pragma once
#include "ncnf.h"
#include <CL/cl.h>
typedef struct {
cl_platform_id platformid;
cl_device_id deviceid;
cl_uint numdevices;
cl_uint numplatforms;
char* source_str;
size_t source_size;
cl_context ctx;
cl_command_queue commqueue;
cl_program program;
cl_kernel kernel;
u64 gpuMemoryMax;
u64 gpuLocalMax;
u64 gpuAllocMax;
u64 gpuCUs;
} gpusolver;
gpusolver* initSolver();
i32 gpusolve2(gpusolver* gs, cnf* c);
void freeSolver(gpusolver* gs);
i32 gpusolve(cnf* c);