[mlir][Python] Fix lifetime of ExecutionEngine runtime functions.
authorSean Silva <silvasean@google.com>
Tue, 28 Sep 2021 21:58:51 +0000 (21:58 +0000)
committerSean Silva <silvasean@google.com>
Tue, 28 Sep 2021 22:32:20 +0000 (22:32 +0000)
commit204d301bb1921431a853c0bfba32007c018df1d5
tree6ededf199ce69362c0583438645c2d9fd04c3940
parentaa53785f23b2b89a9a423af131697b1f7c92869f
[mlir][Python] Fix lifetime of ExecutionEngine runtime functions.

We weren't retaining the ctypes closures that the ExecutionEngine was
calling back into, leading to mysterious errors.

Open to feedback about how to test this. And an extra pair of eyes to
make sure I caught all the places that need to be aware of this.

Differential Revision: https://reviews.llvm.org/D110661
mlir/lib/Bindings/Python/ExecutionEngineModule.cpp
mlir/python/mlir/execution_engine.py