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.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
LGTM. A couple of minor comments inline.
mlir/lib/ExecutionEngine/SparseTensor/CMakeLists.txt | ||
---|---|---|
1 | Is this comment still relevant after the rename? And if you want to keep it, can you add some details about the errors (such as using vectors, etc.) | |
18 | I'm curious - why do we need this here? I thought all of llvm uses 17 now. | |
utils/bazel/llvm-project-overlay/mlir/BUILD.bazel | ||
6719–6724 | Should the two comments match? |
mlir/lib/ExecutionEngine/SparseTensor/CMakeLists.txt | ||
---|---|---|
1 | I think it's still relevant/helpful to have, if only to explain the situation to future readers (like myself ;) so they don't try making the library shared just to rediscover why it doesn't work. Though my personal style is to err on the side of over-documenting things like this, so do let me know if it's out of line with MLIR/LLVM style for cmake files. I've fleshed the comment out a bit more to explain how std::vector is the major stumbling block to making things shared | |
18 | Until quite recently mlir_c_runner_utils explicitly restricted things to C++11, so since this is a dependency of mlir_c_runner_utils I wanted to make sure it adheres to the same restrictions. (The same reasoning goes for mlir_float16_utils.) mlir_c_runner_utils only recently switched that to C++17, though it's still an explicit restriction. From a quick search, it doesn't look like CXX_STANDARD is set globally anywhere. The only uses I see are for mlir_c_runner_utils (and hence MLIRSparseTensorRuntime and mlir_float16_utils), and for mlir_cuda_runtime which restricts things to C++14. |
Renaming the ExecutionEngine/SparseTensorUtils.{h,cpp} files to match the new library name.
This appears to have broken the C interface. I suppose the corresponding rename will be required there. https://lab.llvm.org/buildbot/#/builders/13/builds/26975/steps/6/logs/stdio
C:\buildbot\mlir-x64-windows-ninja\llvm-project\mlir\include\mlir/ExecutionEngine/SparseTensorRuntime.h(245): error C2220: the following warning is treated as an error C:\buildbot\mlir-x64-windows-ninja\llvm-project\mlir\include\mlir/ExecutionEngine/SparseTensorRuntime.h(245): warning C4190: '_mlir_ciface_getSparseTensorReaderNextF16' has C-linkage specified, but returns UDT 'f16' which is incompatible with C C:\buildbot\mlir-x64-windows-ninja\llvm-project\mlir\include\mlir/ExecutionEngine/Float16bits.h(35): note: see declaration of 'f16'
To be clear, Nate identified this change as the reason for the windows mlir buildbot failures.
@NathanielMcVicar that function was added in D135480 which was created/landed after this differential. I'll make a note of this breakage there
Our messages crossed :O. You're right that D135480 is the cause and we were mistaken.
Is this comment still relevant after the rename? And if you want to keep it, can you add some details about the errors (such as using vectors, etc.)