Reputation: 31
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
Upvotes: 3
Views: 5669
Reputation: 261
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/
Upvotes: 0
Reputation: 21108
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.
Upvotes: 0
Reputation: 46882
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.
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_e/tesla6_e.html
Upvotes: 3