https://hgpu.org/?p=7415
Dynamic Programming with CUDA - Part II