[Mlir-commits] [mlir] 97678ce - [mlir][sparse][gpu] remove zero init memset
Aart Bik
llvmlistbot at llvm.org
Thu Jul 13 18:22:29 PDT 2023
Author: Aart Bik
Date: 2023-07-13T18:22:21-07:00
New Revision: 97678cec1b9de5023e1eb5c9804cb137351eb21e
URL: https://github.com/llvm/llvm-project/commit/97678cec1b9de5023e1eb5c9804cb137351eb21e
DIFF: https://github.com/llvm/llvm-project/commit/97678cec1b9de5023e1eb5c9804cb137351eb21e.diff
LOG: [mlir][sparse][gpu] remove zero init memset
avoids quite a big memory fill for each setup
Reviewed By: K-Wu
Differential Revision: https://reviews.llvm.org/D155251
Added:
Modified:
mlir/lib/ExecutionEngine/CudaRuntimeWrappers.cpp
Removed:
################################################################################
diff --git a/mlir/lib/ExecutionEngine/CudaRuntimeWrappers.cpp b/mlir/lib/ExecutionEngine/CudaRuntimeWrappers.cpp
index b5dbc5144ddd7a..ec822125eda456 100644
--- a/mlir/lib/ExecutionEngine/CudaRuntimeWrappers.cpp
+++ b/mlir/lib/ExecutionEngine/CudaRuntimeWrappers.cpp
@@ -528,8 +528,6 @@ mgpuCreateCuSparseLtDnMat(void *dh, intptr_t rows, intptr_t cols, void *values,
int32_t dtp, CUstream /*stream*/) {
assert(cusparseLt_initiated && "client did not call mgpuCreateSparseLtEnv()");
auto dnmat_handle = reinterpret_cast<cusparseLtDnMatHandleAndData *>(dh);
- // CusparseLt expects the descriptors to be zero-initialized.
- memset(dnmat_handle, 0, sizeof(cusparseLtDnMatHandleAndData));
dnmat_handle->values = values;
auto dTp = static_cast<cudaDataType_t>(dtp);
// Assume row-major when deciding lda.
@@ -550,8 +548,6 @@ mgpuCusparseLtCreate2To4SpMat(void *sh, intptr_t rows, intptr_t cols,
void *values, int32_t dtp, CUstream /*stream*/) {
assert(cusparseLt_initiated && "client did not call mgpuCreateSparseLtEnv()");
auto spmat_handle = reinterpret_cast<cusparseLtSpMatHandleAndData *>(sh);
- // CusparseLt expects the descriptors to be zero-initialized.
- memset(spmat_handle, 0, sizeof(cusparseLtSpMatHandleAndData));
spmat_handle->values = values;
auto dTp = static_cast<cudaDataType_t>(dtp);
// Assume row-major when deciding lda.
More information about the Mlir-commits
mailing list