Calculating the fibonacci numbers on GPU
21 Jun, 2025
In this blogpost we will show how to perform very fast calculation of the Fibonacci sequence using GPU programming. In this blogpost we will employ Thrust an NVIDIA library which uses concepts from modern C++ to make GPU programming easy.
Introduction
Scan is one of the fundamental examples for parallelizable algorithms. If you are interested in the foundations of the algorithm I refer you to a previous blogpost where I implemented scan in CUDA.
The scan is the operation which transforms
x = [ x 1 , . . . , x N ]
to
y = [ y 1 , . . . , y N ]
We call the inclusive iff
... continue reading