ocl.h 789 B

123456789101112131415161718192021222324252627282930313233343536373839
  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 lookup_gap;
  18. size_t thread_concurrency;
  19. size_t padbufsize;
  20. void * cldata;
  21. #endif
  22. bool hasBitAlign;
  23. bool hasOpenCL11plus;
  24. bool goffset;
  25. cl_uint vwidth;
  26. size_t max_work_size;
  27. size_t wsize;
  28. enum cl_kernels chosen_kernel;
  29. } _clState;
  30. extern char *file_contents(const char *filename, int *length);
  31. extern int clDevicesNum(void);
  32. extern _clState *initCl(unsigned int gpu, char *name, size_t nameSize);
  33. #endif /* HAVE_OPENCL */
  34. #endif /* __OCL_H__ */