ocl.h 849 B

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