CUDA initialization and error checking