Try adding '-m 64' to the nvcc compile line.
I had similar issues on MacOS (10.6.7+) because 'uname -a' returns i386 but gcc builds for x86_64 by default. nvcc tries to 'autodetect' but gets the wrong value.
I hope this helps.
I get the same result as Dung Chu when I use the .mexmaci file which is included with the download.
I believe that you are supposed to delete that file, and create a new one using make. (Go to that directory in terminal, type 'make')
However, when I do this I am getting architecture issues that I do not know how to deal with:
When compiling, I get the errors like this:
warning: in cudaconv.o, file was built for i386 which is not the architecture being linked (x86_64)
When using the resulting file I get this:
c = cudaconv(2,2)
??? Invalid MEX-file '/Applications/MATLAB74/work/cudaconv/cudaconv/cudaconv.mexmaci': dlopen(/Applications/MATLAB74/work/cudaconv/cudaconv/cudaconv.mexmaci, 1): no suitable image found. Did find:
/Applications/MATLAB74/work/cudaconv/cudaconv/cudaconv.mexmaci: mach-o, but wrong architecture.
It works. But the result is somehow weird. I run this
y = ones(5);
f = 1/5 * ones(3);
z = cudaconv(y, f)
z2 = conv2(y, f, 'same')
z =
1.0e-35 *
-0.1319 0.0000 -0.1319 0.0000 -0.1319
0.0000 0 0.0000 0 0
0 0 0.0000 0 -0.1320
-0.1319 0.0000 -0.1319 0.0000 -0.1941
0 0 0 0 0.0000
z2 =
0.8000 1.2000 1.2000 1.2000 0.8000
1.2000 1.8000 1.8000 1.8000 1.2000
1.2000 1.8000 1.8000 1.8000 1.2000
1.2000 1.8000 1.8000 1.8000 1.2000
0.8000 1.2000 1.2000 1.2000 0.8000
I'm using Fedora 10 with matlab2008. Does any one have any idea why?
Dear Alex, I compile this example as follow..
first of all, i insert a some code at cudaconv.cu
#pragma comment(lib,"C:\\CUDA\\lib64\\cufft.lib")
#pragma comment(lib,"C:\\CUDA\\lib64\\cudart.lib")
next, make a object file
>> system('c:\cuda\bin64\nvcc --compile "d:\cudaconv\cudaconv\cudaconv.cu" -ccbin "C:\Dev\msvs\VC\bin" -o cudaconv.o -IC:\Dev\MATLAB\R2009b\extern\include -IC:\Dev\Msvs\VC\include')
Finaly, compile & link it
>> mex ('cudaconv.o')
good luck to you & sorry to my poor english..
Comment only