I have fixed the problem. There was nothing wrong I was just printing the cellID array out incorrectly. The previous fix to the cudaCalloc function seems to have solved the problems I was having.
Added oxygen support for documentation.