MATLAB OpenCL Toolbox – Update

I made a little update on Matlab OpenCL Toolbox so now it can support the binary file of opencl program, and also a little update to avoid the compilation error in Mac or Linux..

ocl = opencl();

the update is available here.
credit should go to the original author: Radford Juang

MATLAB OpenCL Toolbox on Mac Lion


1. download toolbox source from this link and unzip it.
2. edit make.m

opencl_include_dir = '/System/Library/Frameworks/OpenCL.framework/Headers';
mex('src/openclcmd.cpp', '-Iinclude', ['-I' opencl_include_dir]);

3. edit your ~/.matlab/R20XXa/ Check lines after “maci64” line and modify CLIBS and CXXLIBS so they become:

CLIBS="$MLIBS -framework OpenCL"
CXXLIBS="$MLIBS -lstdc++ -framework OpenCL"

4. open MATLAB and go to the opencl-toolbox directory
5. run make

>> make

6. add this directory as MATLAB path

>> addpath /replace/with/the/directory/path/