Allowing Powerful And Simple Interfacing with Matlab
OpenCL Matlab Wrapper was developed by MESC Labs. It was released on Matlab Central File Exchange under the the BSD License.
The wrapper provides an interface between MATLAB and OpenCL in a way similar to that of Mathematica's OpenCLLink. Where you can control everything in the environment, copy data back and forth and launch threads in an intuitive fashion.
All of that is organized inside of a class and excuted by simple function interface. Where it takes only two calls to compile a kernel, copy buffers, launch threads and read the data back.
The pack includes the following files:
class_handle.hpp
Compile.m
Makefile
OpenCLInterface.m
OpenCLMexWrapper.cpp
OpenCLWrapper.cpp
OpenCLWrapper.h
SampleRun.m
TestKernel.cl
obj = OpenCLInterfaceConstructor which queries all available devices.
obj.PrintDevicesPrint all available devices.
obj.GetGPUDevicesGet classs of all GPU devices.
obj.GetCPUDevicesGet classs of all CPU devices.
obj.CreateFunctionRead kernel code from file or string, compile it and cache it.
obj.RunLaunch the kernel with the specified local and global workloads, scalars and buffers with their memory flags. Buffers specified as Outputs will contain the result data after execution.
obj = OpenCLInterface;
obj.CreateFunction(deviceId,code,'KernelName');
obj.Run(globalWorkload,LocalWorkload,scalar,buffer1,MemoryFlagsOfBuffer1,buffer2,MemoryFlagsOfBuffer2);