Monday, July 7, 2008

Example MATLAB code in GPULib

I recently had a question from a user looking for information on how to use GPULib with MATLAB; you can find examples of how to use GPULib in the

gpulib-0.3p7/MATLAB/ode_cell/

directory of the current distribution.

We're working on refining the MATLAB interface to the library, and hopefully we'll be able to share that work with you soon. In the meantime, if you have suggestions or comments about using GPULib with MATLAB, please let us know!

5 comments:

GpuGanesh said...

after extracting gpulib..cud u tell me step by step approach to run the xample in ode_cell in matlab under linux..I am new to linux.actaully i was developing cuda based application in windows.when i have extracted the library what i cud see is a set of cfiles and make file and two folders ode_cell.I have set the matlab path from the file-setpath-to matlab folder in gpu lib and after that when i type [reactTime, diffTime] = monodomain_driver(750, 201, 201,'gpu', [250, 500, 750], 1.0)
/////////////////////////////////
i got the following error...

??? Undefined function or method 'gpuZeros' for input arguments of type 'double'.

Error in ==> monodomain_driver at 140
gpu_cell_vars(i) = gpuZeros(ncells,1);

...............................
do i have to do something with MAke file...I dont understand how matlab can call c files wihtout having compiled mex fiels of all those c files...M very confused...and the documentation was not good enough...I am really looking for a great help from u...wud be grateful to u...Rakesh

GpuGanesh said...

Many of my freinds are in queue to experiment with GPULIB but everyone is suffering with the same problem of not enough documentation of how to compile and how to install this library..if u cud tell us..I am sure your library gonna be huge success in scientific community after all everybody is interested in accelrating their approaches...

Nathaniel said...

@gpuganesh -- documentation is something that's currently very high on the to-do list. I hope to have a decent draft included in the next release.

Nathaniel said...

@hifik -- looks like you didn't actually build the library.

In the main directory of gpulib, you must do the following:

config/cleanconf.sh

./configure --with-matlab-dir=YOUR_MATLAB_ROOT_DIR

make

This will compile (1) the vectorOp files and (2) the MATLAB .c files into mex files such as gpuZeros.mexglx necessary to run the example.

I'll be working on making the documentation clearer on how to build and install the library for the next release.

GpuGanesh said...

thanks to nathaniel.. i have solved the problem of installing and buidling the library.... and i have successfully run the first example...using GPUlib.. :D :D :D :) :) and i wil keep on posting the results in the future..