ocl.h 641 B

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