ocl.h 653 B

12345678910111213141516171819202122232425262728293031
  1. #ifndef __OCL_H__
  2. #define __OCL_H__
  3. #include "config.h"
  4. #include <stdbool.h>
  5. #ifdef HAVE_OPENCL
  6. #ifdef __APPLE_CC__
  7. #include <OpenCL/opencl.h>
  8. #else
  9. #include <CL/cl.h>
  10. #endif
  11. typedef struct {
  12. cl_context context;
  13. cl_kernel kernel;
  14. cl_command_queue commandQueue;
  15. cl_program program;
  16. cl_mem outputBuffer;
  17. bool hasBitAlign;
  18. cl_uint preferred_vwidth;
  19. size_t max_work_size;
  20. size_t work_size;
  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. extern int opt_platform_id;
  26. #endif /* HAVE_OPENCL */
  27. #endif /* __OCL_H__ */