ocl.h 676 B

1234567891011121314151617181920212223242526272829303132
  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. bool hasOpenCL11plus;
  19. cl_uint preferred_vwidth;
  20. size_t max_work_size;
  21. size_t work_size;
  22. } _clState;
  23. extern char *file_contents(const char *filename, int *length);
  24. extern int clDevicesNum(void);
  25. extern _clState *initCl(unsigned int gpu, char *name, size_t nameSize);
  26. extern int opt_platform_id;
  27. #endif /* HAVE_OPENCL */
  28. #endif /* __OCL_H__ */