ocl.h 705 B

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