Deep Learning, Machine Learning, Gpu, Cuda, AI.
cudaMemcpy(C, d_C, N * sizeof(float), cudaMemcpyDeviceToHost); // Free device memory cudaFree(d_A); cudaFree(d_B); cudaFree(d_C); } Also, we need to add cudaDeviceSynchronize(); after we call the kernel. This is a function used to synchronize the host thread with the device. When this function is