ocl.h 741 B

12345678910111213141516171819202122232425262728293031323334353637
  1. #ifndef __OCL_H__
  2. #define __OCL_H__
  3. #include "config.h"
  4. #include <stdbool.h>
  5. #ifdef HAVE_OPENCL
  6. #include "CL/cl.h"
  7. #include "miner.h"
  8. typedef struct {
  9. cl_context context;
  10. cl_kernel kernel;
  11. cl_command_queue commandQueue;
  12. cl_program program;
  13. cl_mem outputBuffer;
  14. #ifdef USE_SCRYPT
  15. cl_mem CLbuffer0;
  16. cl_mem padbuffer8;
  17. size_t padbufsize;
  18. void * cldata;
  19. #endif
  20. bool hasBitAlign;
  21. bool hasOpenCL11plus;
  22. bool goffset;
  23. cl_uint vwidth;
  24. size_t max_work_size;
  25. size_t wsize;
  26. enum cl_kernels chosen_kernel;
  27. } _clState;
  28. extern char *file_contents(const char *filename, int *length);
  29. extern int clDevicesNum(void);
  30. extern _clState *initCl(unsigned int gpu, char *name, size_t nameSize);
  31. #endif /* HAVE_OPENCL */
  32. #endif /* __OCL_H__ */