Fast Uniform Cubic B-Spline Evaluation
CUDA, Programming March 18th, 2009My 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!





January 18th, 2010 at 3:42 pm
Thanks for the great information, I am just studying this area.
May 27th, 2010 at 4:09 am
That is great news to me, it means there does exist an efficient way to run spline evals on GPUs!
I am starting a project that involves using splines as a morph function for optimising multi-parametric problems. So I want to implement an algorithm for evaluating splines with n-dimensional parameters on OpenCL (algorithm needs to work both on ATI and Nvidia).
Would you be willing to email your CUDA code for spline evaluation? I will need to convert it to OpenCL and make it multi-dimensional, but having a starting point would save me a lot of time. I am willing to share what comes out of it in return.
November 30th, 2010 at 1:32 am
Hello! Thank you for good info!
I think this paper is also very good for CUDA accelerate bspline registration:
J A Shackleford et al, “On developing B-spline registration algorithms for multi-core processors” in Phys. Med. Biol. Volume 55, Number 32, Oct 2010
link:
http://iopscience.iop.org/0031-9155/55/21/001