addd CUDA_KERNEL_LOOP macro
fix kernel loop bugs, compiles and passes all tests
Merge pull request #239 from jeffdonahue/fix-kernel-loop-macro

Fix CUDA_KERNEL_LOOP from @blackball