Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 8 additions & 5 deletions mlir/extras/runtime/refbackend.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
except:
warnings.warn("no execution engine in mlir bindings; refbackend won't work")


from .. import types as T
from ...dialects.memref import cast
from ..runtime.passes import Pipeline, run_pipeline
Expand Down Expand Up @@ -113,9 +112,11 @@ def convert_arg_to_ctype(arg, unranked=True):

def convert_returns_from_ctype(args, mlir_types):
return tuple(
arg
if mlir_type_to_ctype(type)
else unranked_memref_to_numpy(arg, memref_type_to_np_dtype(type))
(
arg
if mlir_type_to_ctype(type)
else unranked_memref_to_numpy(arg, memref_type_to_np_dtype(type))
)
for arg, type in zip(args, mlir_types)
)

Expand Down Expand Up @@ -294,8 +295,10 @@ def compile(
verify=verify,
)

# python: /project/llvm-project/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp:821:
# llvm::Instruction* {anonymous}::InstructionsState::getMainOp() const: Assertion `valid() && "InstructionsState is invalid."' failed.
def load(
self, module, consume_return_callback=None, opt_level=2
self, module, consume_return_callback=None, opt_level=0
) -> LLVMJITBackendInvoker:
return LLVMJITBackendInvoker(
module,
Expand Down