2011-06-14 00:32:54 +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-07-05 07:34:54 +00:00
|
|
|
#ifdef HAVE_OPENCL
|
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"
|
|
|
|
|
2011-06-14 00:32:54 +00:00
|
|
|
typedef struct {
|
|
|
|
cl_context context;
|
|
|
|
cl_kernel kernel;
|
|
|
|
cl_command_queue commandQueue;
|
|
|
|
cl_program program;
|
|
|
|
cl_mem outputBuffer;
|
2012-07-13 10:28:36 +00:00
|
|
|
#ifdef USE_SCRYPT
|
|
|
|
cl_mem CLbuffer0;
|
|
|
|
cl_mem padbuffer8;
|
2012-07-16 01:53:18 +00:00
|
|
|
size_t padbufsize;
|
|
|
|
void * cldata;
|
2012-07-13 10:28:36 +00:00
|
|
|
#endif
|
2012-01-24 09:23:44 +00:00
|
|
|
bool hasBitAlign;
|
2012-02-09 14:15:03 +00:00
|
|
|
bool hasOpenCL11plus;
|
2012-03-27 11:10:17 +00:00
|
|
|
bool goffset;
|
2012-02-22 05:54:06 +00:00
|
|
|
cl_uint vwidth;
|
2011-08-15 10:26:46 +00:00
|
|
|
size_t max_work_size;
|
2012-02-22 05:54:06 +00:00
|
|
|
size_t wsize;
|
2012-02-10 02:18:16 +00:00
|
|
|
enum cl_kernels chosen_kernel;
|
2011-06-14 00:32:54 +00:00
|
|
|
} _clState;
|
|
|
|
|
|
|
|
extern char *file_contents(const char *filename, int *length);
|
2012-02-04 03:47:23 +00:00
|
|
|
extern int clDevicesNum(void);
|
2011-08-15 10:26:46 +00:00
|
|
|
extern _clState *initCl(unsigned int gpu, char *name, size_t nameSize);
|
2011-07-05 07:34:54 +00:00
|
|
|
#endif /* HAVE_OPENCL */
|
2011-06-14 00:32:54 +00:00
|
|
|
#endif /* __OCL_H__ */
|