ocl.h 516 B

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