openpilot is an open source driver assistance system. openpilot performs the functions of Automated Lane Centering and Adaptive Cruise Control for over 200 supported car makes and models.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

44 lines
989 B

5 years ago
#pragma once
6 years ago
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
5 years ago
#define CL_USE_DEPRECATED_OPENCL_1_2_APIS
6 years ago
#ifdef __APPLE__
#include <OpenCL/cl.h>
#else
#include <CL/cl.h>
#endif
#ifdef __cplusplus
extern "C" {
#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; \
})
5 years ago
typedef struct CLContext{
cl_context context;
cl_device_id device_id;
}CLContext;
CLContext cl_init_context(cl_device_type device_type);
cl_device_id cl_get_device_id(cl_device_type device_type);
5 years ago
void cl_free_context(CLContext *ctx);
cl_program cl_program_from_file(CLContext *ctx, const char* path, const char* args);
6 years ago
const char* cl_get_error_string(int err);
#ifdef __cplusplus
}
#endif