diff --git a/mlir/integration_test/Sparse/CPU/matrix-market-example.mlir b/mlir/integration_test/Sparse/CPU/matrix-market-example.mlir --- a/mlir/integration_test/Sparse/CPU/matrix-market-example.mlir +++ b/mlir/integration_test/Sparse/CPU/matrix-market-example.mlir @@ -1,7 +1,7 @@ // RUN: mlir-opt %s \ // RUN: -convert-scf-to-std -convert-vector-to-scf \ // RUN: -convert-linalg-to-llvm -convert-vector-to-llvm | \ -// RUN: SPARSE_MATRIX0="%mlir_integration_test_dir/data/test.mtx" \ +// RUN: MATRIX0="%mlir_integration_test_dir/data/test.mtx" \ // RUN: mlir-cpu-runner \ // RUN: -e entry -entry-point-result=void \ // RUN: -shared-libs=%mlir_integration_test_dir/libmlir_c_runner_utils%shlibext | \ @@ -11,7 +11,7 @@ func @openMatrix(!llvm.ptr, memref, memref, memref) -> () func @readMatrixItem(memref, memref, memref) -> () func @closeMatrix() -> () - func @getSparseMatrix(index) -> (!llvm.ptr) + func @getMatrix(index) -> (!llvm.ptr) func @entry() { %d0 = constant 0.0 : f64 @@ -29,7 +29,7 @@ // Read the header of a sparse matrix. This yields the // size (m x n) and number of nonzero elements (nnz). // - %file = call @getSparseMatrix(%c0) : (index) -> (!llvm.ptr) + %file = call @getMatrix(%c0) : (index) -> (!llvm.ptr) call @openMatrix(%file, %m, %n, %nnz) : (!llvm.ptr, memref, memref, memref) -> () diff --git a/mlir/lib/ExecutionEngine/SparseUtils.cpp b/mlir/lib/ExecutionEngine/SparseUtils.cpp --- a/mlir/lib/ExecutionEngine/SparseUtils.cpp +++ b/mlir/lib/ExecutionEngine/SparseUtils.cpp @@ -162,11 +162,11 @@ sparseFilename = nullptr; } -// Helper method to read sparse matrix filenames from the environment, defined -// with the naming convention ${SPARSE_MATRIX0}, ${SPARSE_MATRIX1}, etc. -extern "C" char *getSparseMatrix(uint64_t id) { +// Helper method to read matrix filenames from the environment, defined +// with the naming convention ${MATRIX0}, ${MATRIX1}, etc. +extern "C" char *getMatrix(uint64_t id) { char var[80]; - sprintf(var, "SPARSE_MATRIX%lu", id); + sprintf(var, "MATRIX%" PRIu64, id); char *env = getenv(var); return env; }