Skip to content

Instantly share code, notes, and snippets.

@jrprice
jrprice / OCLPlatform.h
Last active September 14, 2016 21:19
Simple OpenCL backend for StreamExecutor for testing purposes
#ifdef __APPLE__
#include <OpenCL/cl.h>
#else
#include <CL/cl.h>
#endif
#include <streamexecutor/StreamExecutor.h>
#include <vector>
#define CHECK_OCL(Op, Err) \
#define __CL_ENABLE_EXCEPTIONS
#include <CL/cl.hpp>
#include <iostream>
using namespace std;
const char *SOURCE = R"RAW(
#define local_barrier() barrier(CLK_LOCAL_MEM_FENCE);
#define WITHIN_KERNEL /* empty */
#define KERNEL __kernel