This patch adds python bindings for the dense array variants.
Fixes #56975
Paths
| Differential D131801
[mlir][python] Add python bindings for DenseArrayAttr ClosedPublic Authored by Mogball on Aug 12 2022, 12:52 PM.
Details
Summary This patch adds python bindings for the dense array variants. Fixes #56975
Diff Detail
Event TimelineMogball added a child revision: D131803: (Reland) [mlir] Switch segment size attributes to DenseI32ArrayAttr.Aug 12 2022, 1:06 PM ftynse added inline comments. This revision is now accepted and ready to land.Aug 12 2022, 2:35 PM Closed by commit rG619fd8c2ab50: [mlir][python] Add python bindings for DenseArrayAttr (authored by Mogball). · Explain WhyAug 12 2022, 4:44 PM This revision was automatically updated to reflect the committed changes. Comment Actions This patch broke the windows mlir bot: https://lab.llvm.org/buildbot/#/builders/13/builds/24498 Comment Actions I set up my windows build but didn't get the same build error. Are you able to reproduce it? Comment Actions
Yes, I can reproduce it on one of my machines, but not the other and our internal buildbots can also (in addition to the public bot). I suspect it's an issue with the Visual Studio version (the passing one is the newest version of the set). What version are you using? I would suggest reverting this change until we can figure out what the issue is since the buildbot has been broken all weekend. Comment Actions I believe this snippet (compiled with MSVC) reproduces the error. Interestingly, clang fails to compile that same snippet, which makes me wonder if that code or file is #ifdef-ed somewhere.
Revision Contents
Diff 452284 mlir/include/mlir-c/BuiltinAttributes.h
mlir/lib/Bindings/Python/IRAttributes.cpp
mlir/lib/CAPI/IR/BuiltinAttributes.cpp
mlir/test/CAPI/ir.c
mlir/test/python/ir/attributes.py
|
Nit: I remember throw-based approach being inefficient so we opted for a direct implementation of the iterator protocol elsewhere. No need to change here, but please add a TODO/bug.