2020-12-11 05:05:32 -07:00
|
|
|
#pragma once
|
2020-01-17 12:01:02 -07:00
|
|
|
|
|
|
|
#include <stdint.h>
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <stdlib.h>
|
|
|
|
|
|
|
|
#ifdef __APPLE__
|
|
|
|
#include <OpenCL/cl.h>
|
|
|
|
#else
|
|
|
|
#include <CL/cl.h>
|
|
|
|
#endif
|
|
|
|
|
2020-11-30 04:04:49 -07:00
|
|
|
#define CL_CHECK(_expr) \
|
|
|
|
do { \
|
|
|
|
assert(CL_SUCCESS == _expr); \
|
|
|
|
} while (0)
|
|
|
|
|
|
|
|
#define CL_CHECK_ERR(_expr) \
|
|
|
|
({ \
|
|
|
|
cl_int err = CL_INVALID_VALUE; \
|
|
|
|
__typeof__(_expr) _ret = _expr; \
|
|
|
|
assert(_ret&& err == CL_SUCCESS); \
|
|
|
|
_ret; \
|
|
|
|
})
|
|
|
|
|
2020-08-17 03:24:39 -06:00
|
|
|
cl_device_id cl_get_device_id(cl_device_type device_type);
|
2020-12-11 05:05:32 -07:00
|
|
|
cl_program cl_program_from_file(cl_context ctx, cl_device_id device_id, const char* path, const char* args);
|
2020-01-17 12:01:02 -07:00
|
|
|
const char* cl_get_error_string(int err);
|