Hello, I'm looking for some source code implementing 3d convolution. Ideally, I need C++ code or CUDA code. I'd appreciate if anybody can point me to a nice and fast implementation :-)
Cheers
Hello, I'm looking for some source code implementing 3d convolution. Ideally, I need C++ code or CUDA code. I'd appreciate if anybody can point me to a nice and fast implementation :-)
Cheers
you understand that convolution is normally done by using an fft? see, for example, http://en.wikipedia.org/wiki/Convolution
so you need an fft library.
http://stackoverflow.com/questions/1548809/fastest-method-to-compute-convolution suggests http://www.fftw.org/ (for a traditional cpu).
for cuda, use cufft - http://www.gsic.titech.ac.jp/~ccwww/tebiki/tesla%5Fe/tesla6%5Fe.html
Are you a registered developer? If so you should download the 3.0 SDK and check out the FDTD3d sample which shows a 3d convolution as applied for an explicit finite differences app. In the 2.3 SDK there was a sample called 3dfd which was similar (and has now been replaced).
It may be more efficient to use this approach rather than FFT if your impulse response is short.
Hello, Actually, I'm planning to use a kernel with a small support (3x3 and 7x7 later on probably) so convolving might be faster than using the FFT. Anyway, I can use the FFTW library or the CUDA library. Does any of you know what's the speed up gained with the CUDA code ?
I'm not a registered developer so I don't have access to the 3.0 SDK. Can you point me to the web page to register ?
Thanks
Intel has a very good example - using SSE + OpenMP and a serial version of it. The code is primarily meant to profile the serial and a parallel approach, but is done in a nice way. http://software.intel.com/en-us/articles/16bit-3d-convolution-sse4openmp-implementation-on-penryn-cpu/