I can’t spot anything wrong with the code, other than that I don’t see a call to initialize CUBLAS. Make sure you check the status of every CUDA and CUBLAS API call. cublasZdotu() may have failed to execute due to prior errors. BTW, it is usually a bit more robust to use the following idiom for memory copies, should you ever chose to change the type of the array elements: