ocl.h 597 B

123456789101112131415161718192021222324252627
  1. #ifndef __OCL_H__
  2. #define __OCL_H__
  3. #include "config.h"
  4. #ifdef HAVE_OPENCL
  5. #ifdef __APPLE_CC__
  6. #include <OpenCL/opencl.h>
  7. #else
  8. #include <CL/cl.h>
  9. #endif
  10. typedef struct {
  11. cl_context context;
  12. cl_kernel kernel;
  13. cl_command_queue commandQueue;
  14. cl_program program;
  15. cl_mem outputBuffer;
  16. int hasBitAlign;
  17. cl_uint preferred_vwidth;
  18. size_t max_work_size;
  19. size_t work_size;
  20. } _clState;
  21. extern char *file_contents(const char *filename, int *length);
  22. extern int clDevicesNum();
  23. extern _clState *initCl(unsigned int gpu, char *name, size_t nameSize);
  24. #endif /* HAVE_OPENCL */
  25. #endif /* __OCL_H__ */