10 Commits

Author SHA1 Message Date
Kazu Hirata
cd5ee321e5 [mlir] Fix warnings
This patch fixes:

  mlir/lib/ExecutionEngine/SparseTensorRuntime.cpp:296:31: error:
  comparison of integers of different signs: 'int64_t' (aka 'long')
  and 'const uint64_t' (aka 'const unsigned long')
  [-Werror,-Wsign-compare]

  mlir/lib/ExecutionEngine/SparseTensorRuntime.cpp:297:67: error:
  comparison of integers of different signs: 'int64_t' (aka 'long')
  and 'const uint64_t' (aka 'const unsigned long')
  [-Werror,-Wsign-compare]

  mlir/lib/ExecutionEngine/SparseTensorRuntime.cpp:298:31: error:
 comparison of integers of different signs: 'int64_t' (aka 'long') and
 'const uint64_t' (aka 'const unsigned long') [-Werror,-Wsign-compare]

  mlir/lib/ExecutionEngine/SparseTensorRuntime.cpp:479:30: error:
  comparison of integers of different signs: 'int64_t' (aka 'long')
  and 'const uint64_t' (aka 'const unsigned long')
  [-Werror,-Wsign-compare]
2022-11-15 12:16:03 -08:00
Stella Stamenova
af5c307945 Revert "[mlir][sparse] Macros to clean up StridedMemRefType in the SparseTensorRuntime" and "[mlir][sparse] move SparseTensorReader functions into the _mlir_ciface_ section"
This reverts commits 6c22dad and 92bc3fb.

These broke the windows mlir buildbot.
2022-11-14 16:18:04 -08:00
wren romano
92bc3fb5b1 [mlir][sparse] move SparseTensorReader functions into the _mlir_ciface_ section
Depends On D137735

Reviewed By: aartbik

Differential Revision: https://reviews.llvm.org/D137737
2022-11-14 13:50:29 -08:00
wren romano
6c22dad9c2 [mlir][sparse] Macros to clean up StridedMemRefType in the SparseTensorRuntime
In particular, this silences warnings from [-Wsign-compare].

Depends On D137681

Reviewed By: aartbik

Differential Revision: https://reviews.llvm.org/D137735
2022-11-14 13:49:38 -08:00
wren romano
c518745bba [mlir][sparse] Making way for SparseTensorRuntime to support non-permutations
Systematically updates the SparseTensorRuntime to properly distinguish tensor-dimensions from storage-levels (and their associated ranks, shapes, sizes, indices, etc).  With a few exceptions which are noted in the code, this ensures the runtime has all the **semantic** changes necessary to support non-permutations.

(Whereas **operationally**, since we're still using `std::vector<uing64_t>` to represent the mappings, there's no way to pass in any interesting non-permutations.  Changing the representation to `std::function` will be done in a separate differential.)

Depends On D137680

Reviewed By: aartbik

Differential Revision: https://reviews.llvm.org/D137681
2022-11-14 13:48:41 -08:00
wren romano
d9affadd00 [mlir][sparse] rename the values of the runtime DimLevelType
This change is to make way for reusing the DimLevelType enum in lieu of the SparseTensorEncodingAttr::DimLevelType enum, but broken out to make it quick and easy to review

Reviewed By: aartbik

Differential Revision: https://reviews.llvm.org/D135995
2022-10-18 12:08:19 -07:00
bixia1
d18bfb23f3 [mlir][sparse] Add readCOOElement for reading a sparse tensor element from files.
Use the routine for openSparseTensorCOO and getSparseTensorReaderNext.

Reviewed By: aartbik, wrengr

Differential Revision: https://reviews.llvm.org/D135732
2022-10-16 07:25:21 -07:00
bixia1
9f1f21c49d [mlir][sparse] Replace pass-by-value with pass-by-memref for C interface routines to fix Windows build.
Reviewed By: aartbik, wrengr

Differential Revision: https://reviews.llvm.org/D135811
2022-10-12 14:52:19 -07:00
bixia1
f2b73f517b [mlir][sparse] Add MLIR interface for sparse tensor file input and output.
Reviewed By: aartbik, wrengr

Differential Revision: https://reviews.llvm.org/D135480
2022-10-11 16:25:13 -07:00
wren romano
6206692931 [mlir][sparse] Renaming mlir_sparse_tensor_utils library to SparseTensorRuntime
The "mlir_xxx_utils" naming scheme is reserved/intended for shared libraries, whereas this library must be static due to issues of linking DLLs on Windows.  So we rename the library to avoid any potential confusion.   In addition we also rename the ExecutionEngine/SparseTensorUtils.{h,cpp} files to match the new library name.

Reviewed By: aartbik, stella.stamenova

Differential Revision: https://reviews.llvm.org/D135613
2022-10-11 15:00:11 -07:00