Skip to content

Commit 4896238

Browse files
authored
[mlir][sparse] tiny cleanup making local 'using' explicit (#69740)
1 parent 9399094 commit 4896238

File tree

2 files changed

+7
-8
lines changed

2 files changed

+7
-8
lines changed

mlir/include/mlir/ExecutionEngine/SparseTensorRuntime.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,6 @@
2424

2525
using namespace mlir::sparse_tensor;
2626

27-
using SparseTensorWriter = std::ostream;
28-
2927
extern "C" {
3028

3129
//===----------------------------------------------------------------------===//
@@ -47,6 +45,7 @@ extern "C" {
4745
/// kEmpty - STS, empty
4846
/// kEmptyForward - STS, empty, with forwarding COO
4947
/// kFromCOO COO STS, copied from the COO source
48+
/// kFromReader reader STS, input from reader
5049
/// kToCOO STS COO, copied from the STS source
5150
/// kPack buffers STS, from level buffers
5251
/// kSortCOOInPlace STS STS, sorted in place

mlir/lib/ExecutionEngine/SparseTensorRuntime.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -449,9 +449,9 @@ void _mlir_ciface_outSparseTensorWriterMetaData(
449449
ASSERT_NO_STRIDE(dimSizesRef);
450450
assert(dimRank != 0);
451451
index_type *dimSizes = MEMREF_GET_PAYLOAD(dimSizesRef);
452-
SparseTensorWriter &file = *static_cast<SparseTensorWriter *>(p);
452+
std::ostream &file = *static_cast<std::ostream *>(p);
453453
file << dimRank << " " << nse << std::endl;
454-
for (index_type d = 0; d < dimRank - 1; ++d)
454+
for (index_type d = 0; d < dimRank - 1; d++)
455455
file << dimSizes[d] << " ";
456456
file << dimSizes[dimRank - 1] << std::endl;
457457
}
@@ -464,8 +464,8 @@ void _mlir_ciface_outSparseTensorWriterMetaData(
464464
assert(p &&vref); \
465465
ASSERT_NO_STRIDE(dimCoordsRef); \
466466
const index_type *dimCoords = MEMREF_GET_PAYLOAD(dimCoordsRef); \
467-
SparseTensorWriter &file = *static_cast<SparseTensorWriter *>(p); \
468-
for (index_type d = 0; d < dimRank; ++d) \
467+
std::ostream &file = *static_cast<std::ostream *>(p); \
468+
for (index_type d = 0; d < dimRank; d++) \
469469
file << (dimCoords[d] + 1) << " "; \
470470
V *value = MEMREF_GET_PAYLOAD(vref); \
471471
file << *value << std::endl; \
@@ -537,14 +537,14 @@ void delSparseTensorReader(void *p) {
537537
}
538538

539539
void *createSparseTensorWriter(char *filename) {
540-
SparseTensorWriter *file =
540+
std::ostream *file =
541541
(filename[0] == 0) ? &std::cout : new std::ofstream(filename);
542542
*file << "# extended FROSTT format\n";
543543
return static_cast<void *>(file);
544544
}
545545

546546
void delSparseTensorWriter(void *p) {
547-
SparseTensorWriter *file = static_cast<SparseTensorWriter *>(p);
547+
std::ostream *file = static_cast<std::ostream *>(p);
548548
file->flush();
549549
assert(file->good());
550550
if (file != &std::cout)

0 commit comments

Comments
 (0)