Skip to content

Commit ac8b53f

Browse files
committed
[mlir] Apply ClangTidy performance fix
- Use '\n' instead of std::endl; https://clang.llvm.org/extra/clang-tidy/checks/performance/avoid-endl.html
1 parent 734ee0e commit ac8b53f

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

mlir/lib/ExecutionEngine/AsyncRuntime.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -446,7 +446,7 @@ extern "C" int64_t mlirAsyncRuntimGetNumWorkerThreads() {
446446

447447
extern "C" void mlirAsyncRuntimePrintCurrentThreadId() {
448448
static thread_local std::thread::id thisId = std::this_thread::get_id();
449-
std::cout << "Current thread id: " << thisId << std::endl;
449+
std::cout << "Current thread id: " << thisId << '\n';
450450
}
451451

452452
//===----------------------------------------------------------------------===//

mlir/lib/ExecutionEngine/SparseTensorRuntime.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -450,10 +450,10 @@ void _mlir_ciface_outSparseTensorWriterMetaData(
450450
assert(dimRank != 0);
451451
index_type *dimSizes = MEMREF_GET_PAYLOAD(dimSizesRef);
452452
std::ostream &file = *static_cast<std::ostream *>(p);
453-
file << dimRank << " " << nse << std::endl;
453+
file << dimRank << " " << nse << '\n';
454454
for (index_type d = 0; d < dimRank - 1; d++)
455455
file << dimSizes[d] << " ";
456-
file << dimSizes[dimRank - 1] << std::endl;
456+
file << dimSizes[dimRank - 1] << '\n';
457457
}
458458

459459
#define IMPL_OUTNEXT(VNAME, V) \
@@ -468,7 +468,7 @@ void _mlir_ciface_outSparseTensorWriterMetaData(
468468
for (index_type d = 0; d < dimRank; d++) \
469469
file << (dimCoords[d] + 1) << " "; \
470470
V *value = MEMREF_GET_PAYLOAD(vref); \
471-
file << *value << std::endl; \
471+
file << *value << '\n'; \
472472
}
473473
MLIR_SPARSETENSOR_FOREVERY_V(IMPL_OUTNEXT)
474474
#undef IMPL_OUTNEXT

0 commit comments

Comments
 (0)