Well, I haven't tried it yet, but I'm sure it's possible. The included build tools are dedicated to MS Windows. Please leave a notice if you get it running.
Dear Darius,
you can find all build params described in nvmex.m
For adding additional include or library paths just use (similar to gcc) the params: -I<pathname> (for include path), -L<directory> (for lib dir) and -l<name> (for lib file).
Hi all!
I did something similar with some improvements.
I also included a test to compare my solution (bilininterp) with cudainterp2 and as you can see here
http://www.mathworks.co.uk/matlabcentral/fileexchange/23795 it is much faster than cudainterp2.
In "bilininterp_speed_test.m", cudainterp2 and matlab's interp2 generate a output matrix, however bilininterp only interpolate one point in each loop. That is why it gets faster when the matrix getting bigger.
The input to bilininterp should be same like interp2 to have the same output dimension. And if it is done correctly, bilininterp's speedup is ~5 compared to cudainterp2's speedup of ~8 on my GTX460.
I tried this on a XP64 machine with Matlab 64. I found one problem: If options are placed into an rsp file by the nvmex_helper script the nvmex compiler cannot parse them. So I added
if (grep /\.rsp$/i, @ARGV) { # arg is a rsp file
my $fn = substr($ARGV[0],1);
my $holdNewline = $/;
undef $/;
my $inf;
open $inf, "<" . $fn;
my $buf = <$inf>;
close $inf;
$/ = $holdNewline;
$_ = $buf;
s/"(.*)\s(.*)"/"\"$1_!_$2\""/eg; # avoid splitting at spaces with quotes,e.g,. "Program Files/"
s/\s+/" "/eg; # collapse multiple spaces
$buf = $_;
@items = split / /, $buf; #split the input string into individual words
grep(s/_!_/" "/eg, @items);
@ARGV = @items;
}
to nvmex.pl to allow that. Now I can pass -win32 as an option, and with some add'l tweaks (using win32 matlab and cuda libs, setting LINKER_OPTIONS to /MACHINE:X86 and esnuring that the 32-bit nvcc is called, I can now compile and run 32-bit mex executables from the 64-bit matlab command line.
Well, I haven't tried it yet, but I'm sure it's possible. The included build tools are dedicated to MS Windows. Please leave a notice if you get it running.