ocl.h 769 B

1234567891011121314151617181920212223242526272829303132333435363738
  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. cl_uint max_compute_units;
  27. enum cl_kernels chosen_kernel;
  28. } _clState;
  29. extern char *file_contents(const char *filename, int *length);
  30. extern int clDevicesNum(void);
  31. extern _clState *initCl(unsigned int gpu, char *name, size_t nameSize);
  32. #endif /* HAVE_OPENCL */
  33. #endif /* __OCL_H__ */