This is a copy of the samples published along with the NVidia CUDA Toolkit.
My contribution is to rationalize the makefiles. This began primarily as a robotic substitution, but evolved into a rather extensive refactoring.
Ultimately, it might have been preferable to start from scratch with CMake (or other build or meta-build program)
YMMV