This is C and CUDA code that I used in my masters thesis