1 #ifndef EXECUTIONDEVICE_HPP_
2 #define EXECUTIONDEVICE_HPP_
11 typedef std::shared_ptr<ExecutionDevice>
pointer;
15 return "ExecutionDevice";
19 std::weak_ptr<ExecutionDevice>
mPtr;
39 ptr->setPtr(smartPtr);
71 cl::CommandQueue getCommandQueue();
72 cl::Device getDevice();
74 int createProgramFromSource(std::string filename, std::string buildOptions =
"",
bool caching =
true);
75 int createProgramFromSource(std::vector<std::string> filenames, std::string buildOptions =
"");
76 int createProgramFromString(std::string code, std::string buildOptions =
"");
77 int createProgramFromSourceWithName(std::string programName, std::string filename, std::string buildOptions =
"");
78 int createProgramFromSourceWithName(std::string programName, std::vector<std::string> filenames, std::string buildOptions =
"");
79 int createProgramFromStringWithName(std::string programName, std::string code, std::string buildOptions =
"");
80 cl::Program getProgram(
unsigned int i);
81 cl::Program getProgram(std::string name);
82 bool hasProgram(std::string name);
84 bool isImageFormatSupported(cl_channel_order order, cl_channel_type type, cl_mem_object_type imageType);
85 bool isOpenGLInteropSupported();
90 cl::CommandQueue getQueue(
unsigned int i);
91 cl::Device getDevice(
unsigned int i);
92 cl::Device getDevice(cl::CommandQueue queue);
93 cl::Context getContext();
94 cl::Platform getPlatform();
96 OpenCLDevice(std::vector<cl::Device> devices,
unsigned long* glContext = NULL);
99 return getDevice().getInfo<CL_DEVICE_NAME>();
101 bool isWritingTo3DTexturesSupported();
106 unsigned long * mGLContext;
107 cl::Program writeBinary(std::string filename, std::string buildOptions);
108 cl::Program readBinary(std::string filename);
109 cl::Program buildProgramFromBinary(std::string filename, std::string buildOptions);
110 cl::Program buildSources(cl::Program::Sources source, std::string buildOptions);
113 std::vector<cl::CommandQueue> queues;
114 std::map<std::string, int> programNames;
115 std::vector<cl::Program> programs;
116 std::vector<cl::Device> devices;
117 cl::Platform platform;
119 bool profilingEnabled;