mirror of
https://github.com/sunnypilot/sunnypilot.git
synced 2026-06-26 22:42:06 +08:00
f70a79b838
* use cstring instead of string.h
* use cstdio instead of stdio.h
* remove inttypes.h
* use cstdlib instead of stdlib.h
* use cstdint instead of stdint.h
* #include <cstddef>
* cstdlib
* use cmath
* remove stddef.h
* use cassert
* use csignal
* use ctime
* use cerror
* rebase master
old-commit-hash: c53cb5d570
28 lines
702 B
C++
28 lines
702 B
C++
#pragma once
|
|
|
|
#include <cstdint>
|
|
#include <cstdlib>
|
|
|
|
#ifdef __APPLE__
|
|
#include <OpenCL/cl.h>
|
|
#else
|
|
#include <CL/cl.h>
|
|
#endif
|
|
|
|
#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; \
|
|
})
|
|
|
|
cl_device_id cl_get_device_id(cl_device_type device_type);
|
|
cl_program cl_program_from_file(cl_context ctx, cl_device_id device_id, const char* path, const char* args);
|
|
const char* cl_get_error_string(int err);
|