From fad6922bae94a037eb768d59a902426eda5f198c Mon Sep 17 00:00:00 2001 From: Emilien Bauer Date: Mon, 10 Jun 2024 13:32:07 +0100 Subject: [PATCH] Use memref.atomic_rmw instead. --- .github/workflows/ci-mlir-mpi.yml | 2 +- .github/workflows/ci-mlir.yml | 2 +- devito/ir/ietxdsl/cluster_to_ssa.py | 5 ++--- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci-mlir-mpi.yml b/.github/workflows/ci-mlir-mpi.yml index c6c92a6d28..819377aa61 100644 --- a/.github/workflows/ci-mlir-mpi.yml +++ b/.github/workflows/ci-mlir-mpi.yml @@ -36,7 +36,7 @@ jobs: run: | pip install -e .[tests] pip install mpi4py - pip install git+https://github.com/xdslproject/xdsl@210181350d926f91ee5fdb27f0eb5d1cf53a8997 + pip install git+https://github.com/xdslproject/xdsl@1ffdc2d9f33a435af7382a668e153fade01a1255 - name: Test with MPI run: | diff --git a/.github/workflows/ci-mlir.yml b/.github/workflows/ci-mlir.yml index 5e3996ddf5..304d438830 100644 --- a/.github/workflows/ci-mlir.yml +++ b/.github/workflows/ci-mlir.yml @@ -36,7 +36,7 @@ jobs: run: | pip install -e .[tests] pip install mpi4py - pip install git+https://github.com/xdslproject/xdsl@210181350d926f91ee5fdb27f0eb5d1cf53a8997 + pip install git+https://github.com/xdslproject/xdsl@1ffdc2d9f33a435af7382a668e153fade01a1255 - name: Test no-MPI, no-Openmp run: | diff --git a/devito/ir/ietxdsl/cluster_to_ssa.py b/devito/ir/ietxdsl/cluster_to_ssa.py index d4863d8488..caf1839c7e 100644 --- a/devito/ir/ietxdsl/cluster_to_ssa.py +++ b/devito/ir/ietxdsl/cluster_to_ssa.py @@ -369,10 +369,9 @@ def build_generic_step_expression(self, dim: SteppingDimension, eq: LoweredEq): match eq.operation: case None: - pass + memref.Store.get(value, memtemp, ssa_indices) case OpInc: - value = arith.Addf(value, memref.Load.get(memtemp, ssa_indices).res) - memref.Store.get(value, memtemp, ssa_indices) + memref.AtomicRMWOp(operands=[value, memtemp, ssa_indices], result_types=[value.type], properties={"kind" : builtin.IntegerAttr(0, builtin.i64)}) def build_condition(self, dim: SteppingDimension, eq: BooleanFunction): return self._visit_math_nodes(dim, eq, None)