ocl.h 844 B

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