Switched names, thinking about how to do kernel args, and buffers.

Need to do a bit more reading on how to set up interop.
Also need to figure out the buffer thing for regular primative buffers, and also image buffers
This commit is contained in:
2016-08-28 22:40:29 -07:00
parent 5dea2494a0
commit 0c70c24a52
7 changed files with 193 additions and 40 deletions

View File

@@ -27,18 +27,20 @@ struct device {
cl_platform_id platform;
};
class Clapper {
class CL_Wrapper {
public:
enum PLATFORM_TYPE { GPU, CPU, ALL };
Clapper();
~Clapper();
CL_Wrapper();
~CL_Wrapper();
int acquire_platform_and_device();
int create_shared_context();
int create_command_queue();
int compile_kernel(std::string kernel_source, bool is_path, std::string kernel_name);
int set_kernel_arg(cl_kernel kernel, int index, int size, void* buffer, std::string kernel_name);
int store_buffer(cl_mem, std::string buffer_name);
int run_kernel(std::string kernel_name);
cl_device_id getDeviceID();
cl_platform_id getPlatformID();
@@ -53,7 +55,9 @@ private:
cl_platform_id platform_id;
cl_device_id device_id;
cl_context context;
cl_command_queue command_queue;
std::map<std::string, cl_kernel> kernel_map;
std::map<std::string, cl_mem> buffer_map;
};