From 856d4db3fbdee6544d9aebd69b89832f569e68bb Mon Sep 17 00:00:00 2001 From: Haicheng Wu <57973641+hwu36@users.noreply.github.com> Date: Tue, 15 Jun 2021 09:08:36 -0400 Subject: [PATCH] Update basic_gemm.cu fix the matrix malloc size --- examples/00_basic_gemm/basic_gemm.cu | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/00_basic_gemm/basic_gemm.cu b/examples/00_basic_gemm/basic_gemm.cu index 70d632ea..98aea3d3 100644 --- a/examples/00_basic_gemm/basic_gemm.cu +++ b/examples/00_basic_gemm/basic_gemm.cu @@ -187,7 +187,7 @@ cudaError_t InitializeMatrix(float *matrix, int rows, int columns, int seed = 0) cudaError_t AllocateMatrix(float **matrix, int rows, int columns, int seed = 0) { cudaError_t result; - size_t sizeof_matrix = sizeof(float) * columns; + size_t sizeof_matrix = sizeof(float) * rows * columns; // Allocate device memory. result = cudaMalloc(reinterpret_cast(matrix), sizeof_matrix);