3#define CL_HPP_TARGET_OPENCL_VERSION 200
4#include "CL/opencl.hpp"
8#include <unordered_map>
23 ComputeKernel(std::function<
void(std::string)> errFunc, std::function<
void(std::string)> statusFunc);
25 void AddSoruce(std::string source);
27 void BuildProgram(std::string options);
29 void AddKernel(std::string name);
33 void ExecuteKernel(std::string name, cl::NDRange local, cl::NDRange global);
35 void SetKernelArg(std::string name,
int arg, std::string bufferName);
37 void ReadBuffer(std::string name,
bool blocking,
size_t size,
void *data);
39 void WriteBuffer(std::string name,
bool blocking,
size_t size,
void *data);
41 void CreateBuffer(std::string name,
int type,
size_t size);
43 std::function<void(std::string)> onError;
44 std::function<void(std::string)> onStatus;
45 cl::Platform platform;
48 cl::Program::Sources sources;
50 cl::CommandQueue queue;
52 std::unordered_map<std::string, OpenCLBuffer> buffers;
53 std::unordered_map<std::string, cl::Kernel> kernels;