My current work includes the evaluation of a parametric motion field which is based on cubic B-splines. Already some time ago I ported the straight forward B-spline evaluation on the graphic card using CUDA. However, it required the evaluation of multiple nested for loops and took even on the graphic card some time.
So the quest of today was: Find a fast way for cubic B-spline evaluation using CUDA!
Of course Google helped me out and pointed meto the following papers:
Daniel Ruijters, Bart M. ter Haar Romeny, and Paul Suetens, “ Accuracy of GPU-based B-Spline Evaluation,” In Proc. Tenth IASTED International Conference on Computer Graphics and Imaging (CGIM), Innsbruck, Austria, pp. 117-122, February 13-15, 2008.
Christian Sigg and Markus Hadwiger, “ Fast Third-Order Texture Filtering,” In GPU Gems 2: Programming Techniques for High-Performance Graphics and General-Purpose Computation, Matt Pharr (ed.), Addison-Wesley; chapter 20, pp. 313-329, 2005.
They showed that a fast and accurate evaluation of B-splines is possible by replacing the nearest neighbor lookups during the B-spline evaulation by linear interpolation which is hard-wired on the GPU.
Finally the best of all: Daniel Ruijters provides some clean CUDA code for download on a website. It helped me out very well. In overall I gained a speed-up factor of 7 in comparison to my first naive implementation!
Recent Comments