Skip to content

Commit

Permalink
Format.
Browse files Browse the repository at this point in the history
  • Loading branch information
PapyChacal committed Feb 14, 2024
1 parent 12eaabe commit 30b57a1
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 6 deletions.
22 changes: 17 additions & 5 deletions devito/core/cpu.py
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,10 @@ def _jit_compile(self):

# xdsl-opt, get xDSL IR
# TODO: Remove quotes in pipeline; currently workaround with [1:-1]
xdsl_args=[source_name, "--allow-unregistered-dialect", "-p", xdsl_pipeline[1:-1]+','+mlir_pipeline]
xdsl_args = [source_name,
"--allow-unregistered-dialect",
"-p",
xdsl_pipeline[1:-1]+','+mlir_pipeline]
xdsl = xDSLOptMain(args=xdsl_args)
out = io.StringIO()
perf("-----------------")
Expand Down Expand Up @@ -638,7 +641,10 @@ def _jit_compile(self):

# xdsl-opt, get xDSL IR
# TODO: Remove quotes in pipeline; currently workaround with [1:-1]
xdsl_args=[source_name, "--allow-unregistered-dialect", "-p", xdsl_pipeline[1:-1]+','+mlir_pipeline]
xdsl_args = [source_name,
"--allow-unregistered-dialect",
"-p",
xdsl_pipeline[1:-1]+','+mlir_pipeline]
xdsl = xDSLOptMain(args=xdsl_args)
out = io.StringIO()
perf("-----------------")
Expand Down Expand Up @@ -906,13 +912,19 @@ def generate_XDSL_MPI_PIPELINE(decomp, nb_tiled_dims):
return generate_pipeline(passes)


def generate_pipeline(passes:Iterable[str]):
def generate_pipeline(passes: Iterable[str]):
passes_string = ",".join(passes)
return f'"{passes_string}"'

def generate_mlir_pipeline(passes:Iterable[str]):

def generate_mlir_pipeline(passes: Iterable[str]):
passes_string = ",".join(passes)
return f'mlir-opt{{arguments="--mlir-print-op-generic","--allow-unregistered-dialect","-p","builtin.module({passes_string})"}}'
return 'mlir-opt{arguments='\
'"--mlir-print-op-generic",'\
'"--allow-unregistered-dialect"'\
','\
f'"-p","builtin.module({passes_string})"'\
'}'


# small interop shim script for stuff that we don't want to implement in mlir-ir
Expand Down
5 changes: 4 additions & 1 deletion devito/core/gpu.py
Original file line number Diff line number Diff line change
Expand Up @@ -439,7 +439,10 @@ def _jit_compile(self):

# xdsl-opt, get xDSL IR
# TODO: Remove quotes in pipeline; currently workaround with [1:-1]
xdsl_args=[source_name, "--allow-unregistered-dialect", "-p", xdsl_pipeline[1:-1]+','+mlir_pipeline]
xdsl_args = [source_name,
"--allow-unregistered-dialect",
"-p",
xdsl_pipeline[1:-1]+','+mlir_pipeline]
xdsl = xDSLOptMain(args=xdsl_args)
out = io.StringIO()
perf("-----------------")
Expand Down

0 comments on commit 30b57a1

Please sign in to comment.