image thumbnail

OpenCL Toolbox v0.17

version 1.6.0.0 (45.9 KB) by Radford Juang
OpenCL Toolbox for MATLAB

3.6K Downloads

Updated 25 Jan 2011

View License

*****
UPDATE: v0.15
- various bug fixes
- support for CPU/GPGPU devices
- additional device information provided in routine to fetch device information
- documented source code
- added destroy_buffer command to free sources
******
This is the first release of the OpenCL Toolbox for MATLAB. It is a simple interface that encapsulates clBuffer and clKernel as MATLAB class objects. It allows one to easily create device buffers, set device memory, compile and call kernel functions, etc.

A future release will override Matlab primitives (plus, minus, times, rdivide, etc.) so that knowledge of OpenCL coding will not be required.

This current release simplifies integration of OpenCL (.cl) files with MATLAB.

For example, to call a kernel in an OpenCL file is done as follows:

ocl = opencl();
ocl.initialize(1,1);
ocl.addfile('simple_add.cl');
ocl.build();

global_workgroup_size = [128,0,0];
local_workgroup_size = [128,0,0];
addkernel = clkernel('add', global_workgroup_size, local_workgroup_size);

x = clobject(single(1:10));
y = clobject(single(11:20));
z = clobject(zeros(1,10, 'single'));

addkernel(x,y,z, uint32(10));

values = z.get();
disp(values);

Project homepage:
http://code.google.com/p/opencl-toolbox/

Cite As

Radford Juang (2021). OpenCL Toolbox v0.17 (https://www.mathworks.com/matlabcentral/fileexchange/30109-opencl-toolbox-v0-17), MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R2010b
Compatible with any release
Platform Compatibility
Windows macOS Linux

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!