Skip to content

Commit

Permalink
Fixed a couple of bugs in cublas_gemm_c.cu
Browse files Browse the repository at this point in the history
  • Loading branch information
Sam Hatfield committed Jun 25, 2019
1 parent c075e14 commit 63ad9e2
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion cublas_gemm_c.cu
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ extern "C" {
double *a_h, *b_h, *c_h;
a_h = (double *)a_p;
b_h = (double *)b_p;
c_h = (double *)c_p;

// =========================================================================
// Compute GEMM using Tensor Core
Expand Down Expand Up @@ -71,10 +72,15 @@ extern "C" {
// Copy results back from device to host
cudaErrCheck(cudaMemcpy(c_h, c_d, m*n*sizeof(double), cudaMemcpyDeviceToHost));
cudaDeviceSynchronize();

// Free memory on device
cudaErrCheck(cudaFree(a_d));
cudaErrCheck(cudaFree(b_d));
cudaErrCheck(cudaFree(c_d));

// =========================================================================

// Set incoming C array pointer
c_p = (void *)c_h;
//c_p = (void *)c_h;
}
}

0 comments on commit 63ad9e2

Please sign in to comment.