ocl.h 683 B

1234567891011121314151617181920212223242526272829
  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. cl_device_id *devices;
  21. } _clState;
  22. extern char *file_contents(const char *filename, int *length);
  23. extern int clDevicesNum();
  24. extern _clState *initCQ(_clState *clState, unsigned int gpu);
  25. extern _clState *initCl(unsigned int gpu, char *name, size_t nameSize);
  26. #endif /* HAVE_OPENCL */
  27. #endif /* __OCL_H__ */