2014-04-03 16:12:35 +00:00
|
|
|
#ifndef OCL_H
|
|
|
|
#define OCL_H
|
2012-01-24 09:23:44 +00:00
|
|
|
|
2011-07-05 07:34:54 +00:00
|
|
|
#include "config.h"
|
2012-01-24 09:23:44 +00:00
|
|
|
|
|
|
|
#include <stdbool.h>
|
2011-06-14 00:32:54 +00:00
|
|
|
#ifdef __APPLE_CC__
|
|
|
|
#include <OpenCL/opencl.h>
|
|
|
|
#else
|
|
|
|
#include <CL/cl.h>
|
|
|
|
#endif
|
|
|
|
|
2012-02-10 02:18:16 +00:00
|
|
|
#include "miner.h"
|
|
|
|
|
2014-05-24 22:27:42 +00:00
|
|
|
typedef struct __clState {
|
2014-06-09 15:45:06 +00:00
|
|
|
cl_context context;
|
|
|
|
cl_kernel kernel;
|
|
|
|
cl_kernel *extra_kernels;
|
|
|
|
size_t n_extra_kernels;
|
|
|
|
cl_command_queue commandQueue;
|
|
|
|
cl_program program;
|
|
|
|
cl_mem outputBuffer;
|
|
|
|
cl_mem CLbuffer0;
|
|
|
|
cl_mem padbuffer8;
|
|
|
|
unsigned char cldata[80];
|
|
|
|
bool hasBitAlign;
|
|
|
|
bool goffset;
|
|
|
|
cl_uint vwidth;
|
|
|
|
size_t max_work_size;
|
|
|
|
size_t wsize;
|
|
|
|
size_t compute_shaders;
|
2011-06-14 00:32:54 +00:00
|
|
|
} _clState;
|
|
|
|
|
2012-02-04 03:47:23 +00:00
|
|
|
extern int clDevicesNum(void);
|
2014-03-23 06:25:55 +00:00
|
|
|
extern _clState *initCl(unsigned int gpu, char *name, size_t nameSize, algorithm_t *algorithm);
|
2014-04-03 16:12:35 +00:00
|
|
|
|
|
|
|
#endif /* OCL_H */
|