Fixed CUDA code issues with pointer arith & indexing