Illegal access in CUDA kernel