9 #ifndef GlobeEngine_GPUProgram_h
10 #define GlobeEngine_GPUProgram_h
12 #include "OpenGL_Includes.h"
17 #include <OpenCL/cl.h>
44 std::string
readFile(std::string fileName);
54 cl_mem
createBuffer(cl_mem_flags _flags,
size_t _size,
void* _host_ptr, cl_int* _errcode_ret);
55 void setKernelArg(cl_kernel _kernel, cl_uint _arg_index,
size_t _arg_size,
const void* _arg_value);
56 void enqueueNDRangeKernel(cl_kernel _kernel,cl_uint _work_dim,
const size_t* _global_work_offset,
const size_t* _global_work_size,
const size_t* _local_work_size,cl_uint _num_events_in_wait_list,
const cl_event* _event_wait_list,cl_event* _event);
57 void enqueueReadBuffer(cl_mem _buffer, cl_bool _blocking_read,
size_t _offset,
size_t _cb,
void* _ptr, cl_uint _num_events_in_wait_list,
const cl_event* _event_wait_list, cl_event* _event);
70 cl_device_id* devices;
72 cl_command_queue command_queue;
std::string readFile(std::string fileName)
Definition: GPUProgramFactory.cpp:151
cl_command_queue getCommandQueue()
Definition: GPUProgramFactory.cpp:400
DeviceType
Definition: GPUProgramFactory.h:33
void finishCommands()
Definition: GPUProgramFactory.cpp:384
~GPUProgramFactory()
Definition: GPUProgramFactory.h:37
void enqueueReadBuffer(cl_mem _buffer, cl_bool _blocking_read, size_t _offset, size_t _cb, void *_ptr, cl_uint _num_events_in_wait_list, const cl_event *_event_wait_list, cl_event *_event)
Definition: GPUProgramFactory.cpp:293
Definition: GPUProgramFactory.h:24
void cleanup()
Definition: GPUProgramFactory.cpp:171
void displayDeviceInfo(cl_device_id _deviceID)
Definition: GPUProgramFactory.cpp:237
Definition: GPUProgramFactory.h:33
void enqueueNDRangeKernel(cl_kernel _kernel, cl_uint _work_dim, const size_t *_global_work_offset, const size_t *_global_work_size, const size_t *_local_work_size, cl_uint _num_events_in_wait_list, const cl_event *_event_wait_list, cl_event *_event)
Definition: GPUProgramFactory.cpp:323
void create()
Definition: GPUProgramFactory.cpp:19
GPUProgramFactory()
Definition: GPUProgramFactory.h:36
cl_program program
Definition: GPUProgramFactory.h:26
std::vector< cl_kernel > kernels
Definition: GPUProgramFactory.h:27
GPUProgram * load(std::string _inputPath)
Definition: GPUProgramFactory.cpp:94
void displayPlatformSpecificInfo(cl_platform_id firstPlatformID, cl_platform_info _info, std::string _comment)
Definition: GPUProgramFactory.cpp:227
void createKernel(GPUProgram *_inputProgram, std::string _kernelName)
Definition: GPUProgramFactory.cpp:129
cl_context getContext()
Definition: GPUProgramFactory.cpp:405
void cleanupProgram(GPUProgram *_input)
Definition: GPUProgramFactory.cpp:192
void clear()
Definition: GPUProgramFactory.cpp:9
void destroy()
Definition: GPUProgramFactory.cpp:14
cl_mem createBuffer(cl_mem_flags _flags, size_t _size, void *_host_ptr, cl_int *_errcode_ret)
Definition: GPUProgramFactory.cpp:283
void setKernelArg(cl_kernel _kernel, cl_uint _arg_index, size_t _arg_size, const void *_arg_value)
Definition: GPUProgramFactory.cpp:365
Definition: AvalancheTrainingSimulationEngine.h:28
void resetCommandQueue()
Definition: GPUProgramFactory.cpp:179
Definition: GPUProgramFactory.h:33
void getOpenGLError(std::string _input)
Definition: GPUProgramFactory.cpp:205
void displayPlatformInfo(cl_platform_id firstPlatformID)
Definition: GPUProgramFactory.cpp:218
Definition: GPUProgramFactory.h:30
void displayDeviceSpecificInfo(cl_device_id _deviceID, cl_device_info _info, std::string _comment, int _type)
Definition: GPUProgramFactory.cpp:257