From c8f4352bd8cd28c33531c55945998ae4ec03543a Mon Sep 17 00:00:00 2001 From: George Bisbas Date: Mon, 24 Jun 2024 17:58:03 +0100 Subject: [PATCH] tests: Add elastic 3D tests --- .github/workflows/ci-lit.yml | 14 +- .github/workflows/ci-mlir-mpi-openmp.yml | 5 - .github/workflows/ci-mlir-mpi.yml | 5 - .github/workflows/ci-mlir-openmp.yml | 5 - requirements-testing.txt | 2 +- tests/filecheck/.lit_test_times.txt | 8 - tests/filecheck/elastic.py | 497 ----------------------- tests/filecheck/lit.cfg | 14 +- tests/filecheck/version.mlir | 3 + tests/test_xdsl_base.py | 13 +- xdsl_examples/diffusion_2D_wBCs.py | 2 +- 11 files changed, 36 insertions(+), 532 deletions(-) delete mode 100644 tests/filecheck/.lit_test_times.txt delete mode 100644 tests/filecheck/elastic.py create mode 100644 tests/filecheck/version.mlir diff --git a/.github/workflows/ci-lit.yml b/.github/workflows/ci-lit.yml index b0341e694dc..8792362964b 100644 --- a/.github/workflows/ci-lit.yml +++ b/.github/workflows/ci-lit.yml @@ -21,20 +21,24 @@ jobs: - name: Checkout Devito uses: actions/checkout@v4 - - name: Install native dependencies - run: | - apt-get update && apt install curl mpich -y + - name: Python Setup + uses: actions/setup-python@v5 + with: + python-version: "3.10" - name: Upgrade pip run: | pip install --upgrade pip + - name: Install native dependencies + run: | + apt-get update && apt install curl mpich -y + - name: Install requirements and xDSL run: | - pip install -e .[tests] pip install git+https://github.com/xdslproject/xdsl@f8bb935880276cf077e0a80f1905105d0a98eb33 + pip install -e .[tests] - name: Execute lit tests run: | - export PATH=/xdsl-sc/llvm-project/build/bin/:$PATH lit -v tests/filecheck/ diff --git a/.github/workflows/ci-mlir-mpi-openmp.yml b/.github/workflows/ci-mlir-mpi-openmp.yml index b57c5f632bb..b1000d71d5b 100644 --- a/.github/workflows/ci-mlir-mpi-openmp.yml +++ b/.github/workflows/ci-mlir-mpi-openmp.yml @@ -28,11 +28,6 @@ jobs: run: | apt-get update && apt install curl mpich -y - - name: Set up Python - uses: actions/setup-python@v5 - with: - python-version: '3.10' - - name: Upgrade pip run: | pip install --upgrade pip diff --git a/.github/workflows/ci-mlir-mpi.yml b/.github/workflows/ci-mlir-mpi.yml index 7609b1bdd4d..e8c086a5b71 100644 --- a/.github/workflows/ci-mlir-mpi.yml +++ b/.github/workflows/ci-mlir-mpi.yml @@ -28,11 +28,6 @@ jobs: run: | apt-get update && apt install curl mpich -y - - name: Set up Python - uses: actions/setup-python@v5 - with: - python-version: '3.10' - - name: Upgrade pip run: | pip install --upgrade pip diff --git a/.github/workflows/ci-mlir-openmp.yml b/.github/workflows/ci-mlir-openmp.yml index 5c27f019728..aa36a701a52 100644 --- a/.github/workflows/ci-mlir-openmp.yml +++ b/.github/workflows/ci-mlir-openmp.yml @@ -28,11 +28,6 @@ jobs: run: | apt-get update && apt install curl mpich -y - - name: Set up Python - uses: actions/setup-python@v5 - with: - python-version: '3.10' - - name: Upgrade pip run: | pip install --upgrade pip diff --git a/requirements-testing.txt b/requirements-testing.txt index 443ded3b5eb..07c41ad9e88 100644 --- a/requirements-testing.txt +++ b/requirements-testing.txt @@ -7,4 +7,4 @@ nbval scipy lit<19.0.0 filecheck<0.0.25 -pooch; python_version >= "3.8" +pooch; python_version >= "3.8" \ No newline at end of file diff --git a/tests/filecheck/.lit_test_times.txt b/tests/filecheck/.lit_test_times.txt deleted file mode 100644 index 21807875024..00000000000 --- a/tests/filecheck/.lit_test_times.txt +++ /dev/null @@ -1,8 +0,0 @@ -3.708262e+00 elastic.py -2.077432e-01 shape_inference.mlir -2.248495e-01 xdsl_mpi_pipeline.mlir -2.397058e-01 xdsl_mpi_pipeline_b.mlir -4.199147e-01 xdsl_mpi_pipeline_c.mlir -4.528842e-01 xdsl_mpi_pipeline_d.mlir -4.988873e-01 xdsl_mpi_pipeline_e.mlir -3.507416e-01 xdsl_pipeline.mlir diff --git a/tests/filecheck/elastic.py b/tests/filecheck/elastic.py deleted file mode 100644 index c2c905ae172..00000000000 --- a/tests/filecheck/elastic.py +++ /dev/null @@ -1,497 +0,0 @@ -# RUN: python %s | filecheck %s - -# Test dynamically registering a dialect from an IRDL file - -from devito import (Grid, TensorTimeFunction, VectorTimeFunction, div, grad, diag, solve, - Operator, Eq, Constant, SpaceDimension) -from devito.tools import as_tuple -from examples.seismic.source import RickerSource, TimeAxis - -import numpy as np - -# flake8: noqa - -if __name__ == "__main__": - - shape = (101, 101) - - so = 4 - nt = 20 - - # Initial grid: km x km, with spacing - shape = shape # Number of grid point (nx, nz) - spacing = as_tuple(10.0 for _ in range(len(shape))) - extent = tuple([s*(n-1) for s, n in zip(spacing, shape)]) - - x = SpaceDimension(name='x', spacing=Constant(name='h_x', value=extent[0]/(shape[0]-1))) # noqa - z = SpaceDimension(name='z', spacing=Constant(name='h_z', value=extent[1]/(shape[1]-1))) # noqa - grid = Grid(extent=extent, shape=shape, dimensions=(x, z)) - - # Timestep size from Eq. 7 with V_p=6000. and dx=100 - t0, tn = 0., nt - dt = (10. / np.sqrt(2.)) / 6. - time_range = TimeAxis(start=t0, stop=tn, step=dt) - - src = RickerSource(name='src', grid=grid, f0=0.01, time_range=time_range) - src.coordinates.data[:] = [250., 250.] - - # Now we create the velocity and pressure fields - v = VectorTimeFunction(name='v', grid=grid, space_order=so, time_order=1) - tau = TensorTimeFunction(name='t', grid=grid, space_order=so, time_order=1) - - # We need some initial conditions - V_p = 2.0 - V_s = 1.0 - density = 1.8 - - # The source injection term - src_xx = src.inject(field=tau.forward[0, 0], expr=src) - src_zz = src.inject(field=tau.forward[1, 1], expr=src) - - # Thorbecke's parameter notation - cp2 = V_p*V_p - cs2 = V_s*V_s - ro = 1/density - - mu = cs2*density - l = (cp2*density - 2*mu) - - # First order elastic wave equation - pde_v = v.dt - ro * div(tau) - pde_tau = (tau.dt - l * diag(div(v.forward)) - mu * (grad(v.forward) + - grad(v.forward).transpose(inner=False))) - - # Time update - u_v = Eq(v.forward, solve(pde_v, v.forward)) - u_t = Eq(tau.forward, solve(pde_tau, tau.forward)) - - # Inject sources. We use it to preinject data - # Up to here, let's only use Devito - op = Operator([u_v] + [u_t] + src_xx + src_zz) - op(dt=dt) - - opx = Operator([u_v] + [u_t], opt='xdsl') - opx(dt=dt, time_M=nt) - - opx._module.verify() - print(opx._module) - - -# CHECK: builtin.module { -# CHECK-NEXT: func.func @Kernel(%v_x_vec0 : !stencil.field<[-4,105]x[-4,105]xf32>, %v_x_vec1 : !stencil.field<[-4,105]x[-4,105]xf32>, %v_z_vec0 : !stencil.field<[-4,105]x[-4,105]xf32>, %v_z_vec1 : !stencil.field<[-4,105]x[-4,105]xf32>, %t_xz_vec0 : !stencil.field<[-4,105]x[-4,105]xf32>, %t_xz_vec1 : !stencil.field<[-4,105]x[-4,105]xf32>, %t_xx_vec0 : !stencil.field<[-4,105]x[-4,105]xf32>, %t_xx_vec1 : !stencil.field<[-4,105]x[-4,105]xf32>, %t_zz_vec0 : !stencil.field<[-4,105]x[-4,105]xf32>, %t_zz_vec1 : !stencil.field<[-4,105]x[-4,105]xf32>, %timers : !llvm.ptr) { -# CHECK-NEXT: %0 = func.call @timer_start() : () -> f64 -# CHECK-NEXT: %time_m = arith.constant 0 : index -# CHECK-NEXT: %time_M = arith.constant 20 : index -# CHECK-NEXT: %1 = arith.constant 1 : index -# CHECK-NEXT: %2 = arith.addi %time_M, %1 : index -# CHECK-NEXT: %step = arith.constant 1 : index -# CHECK-NEXT: %3, %4, %5, %6, %7, %8, %9, %10, %11, %12 = scf.for %time = %time_m to %2 step %step iter_args(%v_x_t0 = %v_x_vec0, %v_x_t1 = %v_x_vec1, %v_z_t0 = %v_z_vec0, %v_z_t1 = %v_z_vec1, %t_xz_t0 = %t_xz_vec0, %t_xz_t1 = %t_xz_vec1, %t_xx_t0 = %t_xx_vec0, %t_xx_t1 = %t_xx_vec1, %t_zz_t0 = %t_zz_vec0, %t_zz_t1 = %t_zz_vec1) -> (!stencil.field<[-4,105]x[-4,105]xf32>, !stencil.field<[-4,105]x[-4,105]xf32>, !stencil.field<[-4,105]x[-4,105]xf32>, !stencil.field<[-4,105]x[-4,105]xf32>, !stencil.field<[-4,105]x[-4,105]xf32>, !stencil.field<[-4,105]x[-4,105]xf32>, !stencil.field<[-4,105]x[-4,105]xf32>, !stencil.field<[-4,105]x[-4,105]xf32>, !stencil.field<[-4,105]x[-4,105]xf32>, !stencil.field<[-4,105]x[-4,105]xf32>) { -# CHECK-NEXT: %t_xx_t0_temp = stencil.load %t_xx_t0 : !stencil.field<[-4,105]x[-4,105]xf32> -> !stencil.temp -# CHECK-NEXT: %t_xz_t0_temp = stencil.load %t_xz_t0 : !stencil.field<[-4,105]x[-4,105]xf32> -> !stencil.temp -# CHECK-NEXT: %v_x_t0_temp = stencil.load %v_x_t0 : !stencil.field<[-4,105]x[-4,105]xf32> -> !stencil.temp -# CHECK-NEXT: %v_x_t1_temp = stencil.apply(%t_xx_t0_blk = %t_xx_t0_temp : !stencil.temp, %t_xz_t0_blk = %t_xz_t0_temp : !stencil.temp, %v_x_t0_blk = %v_x_t0_temp : !stencil.temp) -> (!stencil.temp) { -# CHECK-NEXT: %13 = arith.constant 5.555556e-01 : f32 -# CHECK-NEXT: %14 = arith.constant 1.125000e+00 : f32 -# CHECK-NEXT: %h_x = arith.constant 1.000000e+01 : f32 -# CHECK-NEXT: %15 = arith.constant -1 : i64 -# CHECK-NEXT: %16 = "math.fpowi"(%h_x, %15) : (f32, i64) -> f32 -# CHECK-NEXT: %17 = stencil.access %t_xx_t0_blk[1, 0] : !stencil.temp -# CHECK-NEXT: %18 = arith.mulf %14, %16 : f32 -# CHECK-NEXT: %19 = arith.mulf %18, %17 : f32 -# CHECK-NEXT: %20 = arith.constant 4.166667e-02 : f32 -# CHECK-NEXT: %h_x_1 = arith.constant 1.000000e+01 : f32 -# CHECK-NEXT: %21 = arith.constant -1 : i64 -# CHECK-NEXT: %22 = "math.fpowi"(%h_x_1, %21) : (f32, i64) -> f32 -# CHECK-NEXT: %23 = stencil.access %t_xx_t0_blk[-1, 0] : !stencil.temp -# CHECK-NEXT: %24 = arith.mulf %20, %22 : f32 -# CHECK-NEXT: %25 = arith.mulf %24, %23 : f32 -# CHECK-NEXT: %26 = arith.constant -1.125000e+00 : f32 -# CHECK-NEXT: %h_x_2 = arith.constant 1.000000e+01 : f32 -# CHECK-NEXT: %27 = arith.constant -1 : i64 -# CHECK-NEXT: %28 = "math.fpowi"(%h_x_2, %27) : (f32, i64) -> f32 -# CHECK-NEXT: %29 = stencil.access %t_xx_t0_blk[0, 0] : !stencil.temp -# CHECK-NEXT: %30 = arith.mulf %26, %28 : f32 -# CHECK-NEXT: %31 = arith.mulf %30, %29 : f32 -# CHECK-NEXT: %32 = arith.constant -4.166667e-02 : f32 -# CHECK-NEXT: %h_x_3 = arith.constant 1.000000e+01 : f32 -# CHECK-NEXT: %33 = arith.constant -1 : i64 -# CHECK-NEXT: %34 = "math.fpowi"(%h_x_3, %33) : (f32, i64) -> f32 -# CHECK-NEXT: %35 = stencil.access %t_xx_t0_blk[2, 0] : !stencil.temp -# CHECK-NEXT: %36 = arith.mulf %32, %34 : f32 -# CHECK-NEXT: %37 = arith.mulf %36, %35 : f32 -# CHECK-NEXT: %38 = arith.addf %19, %25 : f32 -# CHECK-NEXT: %39 = arith.addf %38, %31 : f32 -# CHECK-NEXT: %40 = arith.addf %39, %37 : f32 -# CHECK-NEXT: %41 = arith.mulf %13, %40 : f32 -# CHECK-NEXT: %42 = arith.constant 5.555556e-01 : f32 -# CHECK-NEXT: %43 = arith.constant 1.125000e+00 : f32 -# CHECK-NEXT: %h_z = arith.constant 1.000000e+01 : f32 -# CHECK-NEXT: %44 = arith.constant -1 : i64 -# CHECK-NEXT: %45 = "math.fpowi"(%h_z, %44) : (f32, i64) -> f32 -# CHECK-NEXT: %46 = stencil.access %t_xz_t0_blk[0, 0] : !stencil.temp -# CHECK-NEXT: %47 = arith.mulf %43, %45 : f32 -# CHECK-NEXT: %48 = arith.mulf %47, %46 : f32 -# CHECK-NEXT: %49 = arith.constant 4.166667e-02 : f32 -# CHECK-NEXT: %h_z_1 = arith.constant 1.000000e+01 : f32 -# CHECK-NEXT: %50 = arith.constant -1 : i64 -# CHECK-NEXT: %51 = "math.fpowi"(%h_z_1, %50) : (f32, i64) -> f32 -# CHECK-NEXT: %52 = stencil.access %t_xz_t0_blk[0, -2] : !stencil.temp -# CHECK-NEXT: %53 = arith.mulf %49, %51 : f32 -# CHECK-NEXT: %54 = arith.mulf %53, %52 : f32 -# CHECK-NEXT: %55 = arith.constant -1.125000e+00 : f32 -# CHECK-NEXT: %h_z_2 = arith.constant 1.000000e+01 : f32 -# CHECK-NEXT: %56 = arith.constant -1 : i64 -# CHECK-NEXT: %57 = "math.fpowi"(%h_z_2, %56) : (f32, i64) -> f32 -# CHECK-NEXT: %58 = stencil.access %t_xz_t0_blk[0, -1] : !stencil.temp -# CHECK-NEXT: %59 = arith.mulf %55, %57 : f32 -# CHECK-NEXT: %60 = arith.mulf %59, %58 : f32 -# CHECK-NEXT: %61 = arith.constant -4.166667e-02 : f32 -# CHECK-NEXT: %h_z_3 = arith.constant 1.000000e+01 : f32 -# CHECK-NEXT: %62 = arith.constant -1 : i64 -# CHECK-NEXT: %63 = "math.fpowi"(%h_z_3, %62) : (f32, i64) -> f32 -# CHECK-NEXT: %64 = stencil.access %t_xz_t0_blk[0, 1] : !stencil.temp -# CHECK-NEXT: %65 = arith.mulf %61, %63 : f32 -# CHECK-NEXT: %66 = arith.mulf %65, %64 : f32 -# CHECK-NEXT: %67 = arith.addf %48, %54 : f32 -# CHECK-NEXT: %68 = arith.addf %67, %60 : f32 -# CHECK-NEXT: %69 = arith.addf %68, %66 : f32 -# CHECK-NEXT: %70 = arith.mulf %42, %69 : f32 -# CHECK-NEXT: %dt = arith.constant 1.178511e+00 : f32 -# CHECK-NEXT: %71 = arith.constant -1 : i64 -# CHECK-NEXT: %72 = "math.fpowi"(%dt, %71) : (f32, i64) -> f32 -# CHECK-NEXT: %73 = stencil.access %v_x_t0_blk[0, 0] : !stencil.temp -# CHECK-NEXT: %74 = arith.mulf %72, %73 : f32 -# CHECK-NEXT: %75 = arith.addf %41, %70 : f32 -# CHECK-NEXT: %76 = arith.addf %75, %74 : f32 -# CHECK-NEXT: %dt_1 = arith.constant 1.178511e+00 : f32 -# CHECK-NEXT: %77 = arith.mulf %76, %dt_1 : f32 -# CHECK-NEXT: stencil.return %77 : f32 -# CHECK-NEXT: } -# CHECK-NEXT: %v_x_t1_temp_1 = stencil.store %v_x_t1_temp to %v_x_t1 ([0, 0] : [101, 101]) : !stencil.temp to !stencil.field<[-4,105]x[-4,105]xf32> with_halo : !stencil.temp -# CHECK-NEXT: %t_zz_t0_temp = stencil.load %t_zz_t0 : !stencil.field<[-4,105]x[-4,105]xf32> -> !stencil.temp -# CHECK-NEXT: %v_z_t0_temp = stencil.load %v_z_t0 : !stencil.field<[-4,105]x[-4,105]xf32> -> !stencil.temp -# CHECK-NEXT: %v_z_t1_temp = stencil.apply(%t_xz_t0_blk = %t_xz_t0_temp : !stencil.temp, %t_zz_t0_blk = %t_zz_t0_temp : !stencil.temp, %v_z_t0_blk = %v_z_t0_temp : !stencil.temp) -> (!stencil.temp) { -# CHECK-NEXT: %13 = arith.constant 5.555556e-01 : f32 -# CHECK-NEXT: %14 = arith.constant 1.125000e+00 : f32 -# CHECK-NEXT: %h_x = arith.constant 1.000000e+01 : f32 -# CHECK-NEXT: %15 = arith.constant -1 : i64 -# CHECK-NEXT: %16 = "math.fpowi"(%h_x, %15) : (f32, i64) -> f32 -# CHECK-NEXT: %17 = stencil.access %t_xz_t0_blk[0, 0] : !stencil.temp -# CHECK-NEXT: %18 = arith.mulf %14, %16 : f32 -# CHECK-NEXT: %19 = arith.mulf %18, %17 : f32 -# CHECK-NEXT: %20 = arith.constant 4.166667e-02 : f32 -# CHECK-NEXT: %h_x_1 = arith.constant 1.000000e+01 : f32 -# CHECK-NEXT: %21 = arith.constant -1 : i64 -# CHECK-NEXT: %22 = "math.fpowi"(%h_x_1, %21) : (f32, i64) -> f32 -# CHECK-NEXT: %23 = stencil.access %t_xz_t0_blk[-2, 0] : !stencil.temp -# CHECK-NEXT: %24 = arith.mulf %20, %22 : f32 -# CHECK-NEXT: %25 = arith.mulf %24, %23 : f32 -# CHECK-NEXT: %26 = arith.constant -1.125000e+00 : f32 -# CHECK-NEXT: %h_x_2 = arith.constant 1.000000e+01 : f32 -# CHECK-NEXT: %27 = arith.constant -1 : i64 -# CHECK-NEXT: %28 = "math.fpowi"(%h_x_2, %27) : (f32, i64) -> f32 -# CHECK-NEXT: %29 = stencil.access %t_xz_t0_blk[-1, 0] : !stencil.temp -# CHECK-NEXT: %30 = arith.mulf %26, %28 : f32 -# CHECK-NEXT: %31 = arith.mulf %30, %29 : f32 -# CHECK-NEXT: %32 = arith.constant -4.166667e-02 : f32 -# CHECK-NEXT: %h_x_3 = arith.constant 1.000000e+01 : f32 -# CHECK-NEXT: %33 = arith.constant -1 : i64 -# CHECK-NEXT: %34 = "math.fpowi"(%h_x_3, %33) : (f32, i64) -> f32 -# CHECK-NEXT: %35 = stencil.access %t_xz_t0_blk[1, 0] : !stencil.temp -# CHECK-NEXT: %36 = arith.mulf %32, %34 : f32 -# CHECK-NEXT: %37 = arith.mulf %36, %35 : f32 -# CHECK-NEXT: %38 = arith.addf %19, %25 : f32 -# CHECK-NEXT: %39 = arith.addf %38, %31 : f32 -# CHECK-NEXT: %40 = arith.addf %39, %37 : f32 -# CHECK-NEXT: %41 = arith.mulf %13, %40 : f32 -# CHECK-NEXT: %42 = arith.constant 5.555556e-01 : f32 -# CHECK-NEXT: %43 = arith.constant 1.125000e+00 : f32 -# CHECK-NEXT: %h_z = arith.constant 1.000000e+01 : f32 -# CHECK-NEXT: %44 = arith.constant -1 : i64 -# CHECK-NEXT: %45 = "math.fpowi"(%h_z, %44) : (f32, i64) -> f32 -# CHECK-NEXT: %46 = stencil.access %t_zz_t0_blk[0, 1] : !stencil.temp -# CHECK-NEXT: %47 = arith.mulf %43, %45 : f32 -# CHECK-NEXT: %48 = arith.mulf %47, %46 : f32 -# CHECK-NEXT: %49 = arith.constant 4.166667e-02 : f32 -# CHECK-NEXT: %h_z_1 = arith.constant 1.000000e+01 : f32 -# CHECK-NEXT: %50 = arith.constant -1 : i64 -# CHECK-NEXT: %51 = "math.fpowi"(%h_z_1, %50) : (f32, i64) -> f32 -# CHECK-NEXT: %52 = stencil.access %t_zz_t0_blk[0, -1] : !stencil.temp -# CHECK-NEXT: %53 = arith.mulf %49, %51 : f32 -# CHECK-NEXT: %54 = arith.mulf %53, %52 : f32 -# CHECK-NEXT: %55 = arith.constant -1.125000e+00 : f32 -# CHECK-NEXT: %h_z_2 = arith.constant 1.000000e+01 : f32 -# CHECK-NEXT: %56 = arith.constant -1 : i64 -# CHECK-NEXT: %57 = "math.fpowi"(%h_z_2, %56) : (f32, i64) -> f32 -# CHECK-NEXT: %58 = stencil.access %t_zz_t0_blk[0, 0] : !stencil.temp -# CHECK-NEXT: %59 = arith.mulf %55, %57 : f32 -# CHECK-NEXT: %60 = arith.mulf %59, %58 : f32 -# CHECK-NEXT: %61 = arith.constant -4.166667e-02 : f32 -# CHECK-NEXT: %h_z_3 = arith.constant 1.000000e+01 : f32 -# CHECK-NEXT: %62 = arith.constant -1 : i64 -# CHECK-NEXT: %63 = "math.fpowi"(%h_z_3, %62) : (f32, i64) -> f32 -# CHECK-NEXT: %64 = stencil.access %t_zz_t0_blk[0, 2] : !stencil.temp -# CHECK-NEXT: %65 = arith.mulf %61, %63 : f32 -# CHECK-NEXT: %66 = arith.mulf %65, %64 : f32 -# CHECK-NEXT: %67 = arith.addf %48, %54 : f32 -# CHECK-NEXT: %68 = arith.addf %67, %60 : f32 -# CHECK-NEXT: %69 = arith.addf %68, %66 : f32 -# CHECK-NEXT: %70 = arith.mulf %42, %69 : f32 -# CHECK-NEXT: %dt = arith.constant 1.178511e+00 : f32 -# CHECK-NEXT: %71 = arith.constant -1 : i64 -# CHECK-NEXT: %72 = "math.fpowi"(%dt, %71) : (f32, i64) -> f32 -# CHECK-NEXT: %73 = stencil.access %v_z_t0_blk[0, 0] : !stencil.temp -# CHECK-NEXT: %74 = arith.mulf %72, %73 : f32 -# CHECK-NEXT: %75 = arith.addf %41, %70 : f32 -# CHECK-NEXT: %76 = arith.addf %75, %74 : f32 -# CHECK-NEXT: %dt_1 = arith.constant 1.178511e+00 : f32 -# CHECK-NEXT: %77 = arith.mulf %76, %dt_1 : f32 -# CHECK-NEXT: stencil.return %77 : f32 -# CHECK-NEXT: } -# CHECK-NEXT: %v_z_t1_temp_1 = stencil.store %v_z_t1_temp to %v_z_t1 ([0, 0] : [101, 101]) : !stencil.temp to !stencil.field<[-4,105]x[-4,105]xf32> with_halo : !stencil.temp -# CHECK-NEXT: %t_xx_t1_temp = stencil.apply(%v_z_t1_blk = %v_z_t1_temp_1 : !stencil.temp, %v_x_t1_blk = %v_x_t1_temp_1 : !stencil.temp, %t_xx_t0_blk = %t_xx_t0_temp : !stencil.temp) -> (!stencil.temp) { -# CHECK-NEXT: %13 = arith.constant 3.600000e+00 : f32 -# CHECK-NEXT: %14 = arith.constant 1.125000e+00 : f32 -# CHECK-NEXT: %h_z = arith.constant 1.000000e+01 : f32 -# CHECK-NEXT: %15 = arith.constant -1 : i64 -# CHECK-NEXT: %16 = "math.fpowi"(%h_z, %15) : (f32, i64) -> f32 -# CHECK-NEXT: %17 = stencil.access %v_z_t1_blk[0, 0] : !stencil.temp -# CHECK-NEXT: %18 = arith.mulf %14, %16 : f32 -# CHECK-NEXT: %19 = arith.mulf %18, %17 : f32 -# CHECK-NEXT: %20 = arith.constant 4.166667e-02 : f32 -# CHECK-NEXT: %h_z_1 = arith.constant 1.000000e+01 : f32 -# CHECK-NEXT: %21 = arith.constant -1 : i64 -# CHECK-NEXT: %22 = "math.fpowi"(%h_z_1, %21) : (f32, i64) -> f32 -# CHECK-NEXT: %23 = stencil.access %v_z_t1_blk[0, -2] : !stencil.temp -# CHECK-NEXT: %24 = arith.mulf %20, %22 : f32 -# CHECK-NEXT: %25 = arith.mulf %24, %23 : f32 -# CHECK-NEXT: %26 = arith.constant -1.125000e+00 : f32 -# CHECK-NEXT: %h_z_2 = arith.constant 1.000000e+01 : f32 -# CHECK-NEXT: %27 = arith.constant -1 : i64 -# CHECK-NEXT: %28 = "math.fpowi"(%h_z_2, %27) : (f32, i64) -> f32 -# CHECK-NEXT: %29 = stencil.access %v_z_t1_blk[0, -1] : !stencil.temp -# CHECK-NEXT: %30 = arith.mulf %26, %28 : f32 -# CHECK-NEXT: %31 = arith.mulf %30, %29 : f32 -# CHECK-NEXT: %32 = arith.constant -4.166667e-02 : f32 -# CHECK-NEXT: %h_z_3 = arith.constant 1.000000e+01 : f32 -# CHECK-NEXT: %33 = arith.constant -1 : i64 -# CHECK-NEXT: %34 = "math.fpowi"(%h_z_3, %33) : (f32, i64) -> f32 -# CHECK-NEXT: %35 = stencil.access %v_z_t1_blk[0, 1] : !stencil.temp -# CHECK-NEXT: %36 = arith.mulf %32, %34 : f32 -# CHECK-NEXT: %37 = arith.mulf %36, %35 : f32 -# CHECK-NEXT: %38 = arith.addf %19, %25 : f32 -# CHECK-NEXT: %39 = arith.addf %38, %31 : f32 -# CHECK-NEXT: %40 = arith.addf %39, %37 : f32 -# CHECK-NEXT: %41 = arith.mulf %13, %40 : f32 -# CHECK-NEXT: %42 = arith.constant 7.200000e+00 : f32 -# CHECK-NEXT: %43 = arith.constant 1.125000e+00 : f32 -# CHECK-NEXT: %h_x = arith.constant 1.000000e+01 : f32 -# CHECK-NEXT: %44 = arith.constant -1 : i64 -# CHECK-NEXT: %45 = "math.fpowi"(%h_x, %44) : (f32, i64) -> f32 -# CHECK-NEXT: %46 = stencil.access %v_x_t1_blk[0, 0] : !stencil.temp -# CHECK-NEXT: %47 = arith.mulf %43, %45 : f32 -# CHECK-NEXT: %48 = arith.mulf %47, %46 : f32 -# CHECK-NEXT: %49 = arith.constant 4.166667e-02 : f32 -# CHECK-NEXT: %h_x_1 = arith.constant 1.000000e+01 : f32 -# CHECK-NEXT: %50 = arith.constant -1 : i64 -# CHECK-NEXT: %51 = "math.fpowi"(%h_x_1, %50) : (f32, i64) -> f32 -# CHECK-NEXT: %52 = stencil.access %v_x_t1_blk[-2, 0] : !stencil.temp -# CHECK-NEXT: %53 = arith.mulf %49, %51 : f32 -# CHECK-NEXT: %54 = arith.mulf %53, %52 : f32 -# CHECK-NEXT: %55 = arith.constant -1.125000e+00 : f32 -# CHECK-NEXT: %h_x_2 = arith.constant 1.000000e+01 : f32 -# CHECK-NEXT: %56 = arith.constant -1 : i64 -# CHECK-NEXT: %57 = "math.fpowi"(%h_x_2, %56) : (f32, i64) -> f32 -# CHECK-NEXT: %58 = stencil.access %v_x_t1_blk[-1, 0] : !stencil.temp -# CHECK-NEXT: %59 = arith.mulf %55, %57 : f32 -# CHECK-NEXT: %60 = arith.mulf %59, %58 : f32 -# CHECK-NEXT: %61 = arith.constant -4.166667e-02 : f32 -# CHECK-NEXT: %h_x_3 = arith.constant 1.000000e+01 : f32 -# CHECK-NEXT: %62 = arith.constant -1 : i64 -# CHECK-NEXT: %63 = "math.fpowi"(%h_x_3, %62) : (f32, i64) -> f32 -# CHECK-NEXT: %64 = stencil.access %v_x_t1_blk[1, 0] : !stencil.temp -# CHECK-NEXT: %65 = arith.mulf %61, %63 : f32 -# CHECK-NEXT: %66 = arith.mulf %65, %64 : f32 -# CHECK-NEXT: %67 = arith.addf %48, %54 : f32 -# CHECK-NEXT: %68 = arith.addf %67, %60 : f32 -# CHECK-NEXT: %69 = arith.addf %68, %66 : f32 -# CHECK-NEXT: %70 = arith.mulf %42, %69 : f32 -# CHECK-NEXT: %dt = arith.constant 1.178511e+00 : f32 -# CHECK-NEXT: %71 = arith.constant -1 : i64 -# CHECK-NEXT: %72 = "math.fpowi"(%dt, %71) : (f32, i64) -> f32 -# CHECK-NEXT: %73 = stencil.access %t_xx_t0_blk[0, 0] : !stencil.temp -# CHECK-NEXT: %74 = arith.mulf %72, %73 : f32 -# CHECK-NEXT: %75 = arith.addf %41, %70 : f32 -# CHECK-NEXT: %76 = arith.addf %75, %74 : f32 -# CHECK-NEXT: %dt_1 = arith.constant 1.178511e+00 : f32 -# CHECK-NEXT: %77 = arith.mulf %76, %dt_1 : f32 -# CHECK-NEXT: stencil.return %77 : f32 -# CHECK-NEXT: } -# CHECK-NEXT: %t_xx_t1_temp_1 = stencil.store %t_xx_t1_temp to %t_xx_t1 ([0, 0] : [101, 101]) : !stencil.temp to !stencil.field<[-4,105]x[-4,105]xf32> with_halo : !stencil.temp -# CHECK-NEXT: %t_xz_t1_temp = stencil.apply(%v_z_t1_blk = %v_z_t1_temp_1 : !stencil.temp, %v_x_t1_blk = %v_x_t1_temp_1 : !stencil.temp, %t_xz_t0_blk = %t_xz_t0_temp : !stencil.temp) -> (!stencil.temp) { -# CHECK-NEXT: %13 = arith.constant 1.800000e+00 : f32 -# CHECK-NEXT: %14 = arith.constant 1.125000e+00 : f32 -# CHECK-NEXT: %h_x = arith.constant 1.000000e+01 : f32 -# CHECK-NEXT: %15 = arith.constant -1 : i64 -# CHECK-NEXT: %16 = "math.fpowi"(%h_x, %15) : (f32, i64) -> f32 -# CHECK-NEXT: %17 = stencil.access %v_z_t1_blk[1, 0] : !stencil.temp -# CHECK-NEXT: %18 = arith.mulf %14, %16 : f32 -# CHECK-NEXT: %19 = arith.mulf %18, %17 : f32 -# CHECK-NEXT: %20 = arith.constant 4.166667e-02 : f32 -# CHECK-NEXT: %h_x_1 = arith.constant 1.000000e+01 : f32 -# CHECK-NEXT: %21 = arith.constant -1 : i64 -# CHECK-NEXT: %22 = "math.fpowi"(%h_x_1, %21) : (f32, i64) -> f32 -# CHECK-NEXT: %23 = stencil.access %v_z_t1_blk[-1, 0] : !stencil.temp -# CHECK-NEXT: %24 = arith.mulf %20, %22 : f32 -# CHECK-NEXT: %25 = arith.mulf %24, %23 : f32 -# CHECK-NEXT: %26 = arith.constant -1.125000e+00 : f32 -# CHECK-NEXT: %h_x_2 = arith.constant 1.000000e+01 : f32 -# CHECK-NEXT: %27 = arith.constant -1 : i64 -# CHECK-NEXT: %28 = "math.fpowi"(%h_x_2, %27) : (f32, i64) -> f32 -# CHECK-NEXT: %29 = stencil.access %v_z_t1_blk[0, 0] : !stencil.temp -# CHECK-NEXT: %30 = arith.mulf %26, %28 : f32 -# CHECK-NEXT: %31 = arith.mulf %30, %29 : f32 -# CHECK-NEXT: %32 = arith.constant -4.166667e-02 : f32 -# CHECK-NEXT: %h_x_3 = arith.constant 1.000000e+01 : f32 -# CHECK-NEXT: %33 = arith.constant -1 : i64 -# CHECK-NEXT: %34 = "math.fpowi"(%h_x_3, %33) : (f32, i64) -> f32 -# CHECK-NEXT: %35 = stencil.access %v_z_t1_blk[2, 0] : !stencil.temp -# CHECK-NEXT: %36 = arith.mulf %32, %34 : f32 -# CHECK-NEXT: %37 = arith.mulf %36, %35 : f32 -# CHECK-NEXT: %38 = arith.addf %19, %25 : f32 -# CHECK-NEXT: %39 = arith.addf %38, %31 : f32 -# CHECK-NEXT: %40 = arith.addf %39, %37 : f32 -# CHECK-NEXT: %41 = arith.mulf %13, %40 : f32 -# CHECK-NEXT: %42 = arith.constant 1.800000e+00 : f32 -# CHECK-NEXT: %43 = arith.constant 1.125000e+00 : f32 -# CHECK-NEXT: %h_z = arith.constant 1.000000e+01 : f32 -# CHECK-NEXT: %44 = arith.constant -1 : i64 -# CHECK-NEXT: %45 = "math.fpowi"(%h_z, %44) : (f32, i64) -> f32 -# CHECK-NEXT: %46 = stencil.access %v_x_t1_blk[0, 1] : !stencil.temp -# CHECK-NEXT: %47 = arith.mulf %43, %45 : f32 -# CHECK-NEXT: %48 = arith.mulf %47, %46 : f32 -# CHECK-NEXT: %49 = arith.constant 4.166667e-02 : f32 -# CHECK-NEXT: %h_z_1 = arith.constant 1.000000e+01 : f32 -# CHECK-NEXT: %50 = arith.constant -1 : i64 -# CHECK-NEXT: %51 = "math.fpowi"(%h_z_1, %50) : (f32, i64) -> f32 -# CHECK-NEXT: %52 = stencil.access %v_x_t1_blk[0, -1] : !stencil.temp -# CHECK-NEXT: %53 = arith.mulf %49, %51 : f32 -# CHECK-NEXT: %54 = arith.mulf %53, %52 : f32 -# CHECK-NEXT: %55 = arith.constant -1.125000e+00 : f32 -# CHECK-NEXT: %h_z_2 = arith.constant 1.000000e+01 : f32 -# CHECK-NEXT: %56 = arith.constant -1 : i64 -# CHECK-NEXT: %57 = "math.fpowi"(%h_z_2, %56) : (f32, i64) -> f32 -# CHECK-NEXT: %58 = stencil.access %v_x_t1_blk[0, 0] : !stencil.temp -# CHECK-NEXT: %59 = arith.mulf %55, %57 : f32 -# CHECK-NEXT: %60 = arith.mulf %59, %58 : f32 -# CHECK-NEXT: %61 = arith.constant -4.166667e-02 : f32 -# CHECK-NEXT: %h_z_3 = arith.constant 1.000000e+01 : f32 -# CHECK-NEXT: %62 = arith.constant -1 : i64 -# CHECK-NEXT: %63 = "math.fpowi"(%h_z_3, %62) : (f32, i64) -> f32 -# CHECK-NEXT: %64 = stencil.access %v_x_t1_blk[0, 2] : !stencil.temp -# CHECK-NEXT: %65 = arith.mulf %61, %63 : f32 -# CHECK-NEXT: %66 = arith.mulf %65, %64 : f32 -# CHECK-NEXT: %67 = arith.addf %48, %54 : f32 -# CHECK-NEXT: %68 = arith.addf %67, %60 : f32 -# CHECK-NEXT: %69 = arith.addf %68, %66 : f32 -# CHECK-NEXT: %70 = arith.mulf %42, %69 : f32 -# CHECK-NEXT: %dt = arith.constant 1.178511e+00 : f32 -# CHECK-NEXT: %71 = arith.constant -1 : i64 -# CHECK-NEXT: %72 = "math.fpowi"(%dt, %71) : (f32, i64) -> f32 -# CHECK-NEXT: %73 = stencil.access %t_xz_t0_blk[0, 0] : !stencil.temp -# CHECK-NEXT: %74 = arith.mulf %72, %73 : f32 -# CHECK-NEXT: %75 = arith.addf %41, %70 : f32 -# CHECK-NEXT: %76 = arith.addf %75, %74 : f32 -# CHECK-NEXT: %dt_1 = arith.constant 1.178511e+00 : f32 -# CHECK-NEXT: %77 = arith.mulf %76, %dt_1 : f32 -# CHECK-NEXT: stencil.return %77 : f32 -# CHECK-NEXT: } -# CHECK-NEXT: %t_xz_t1_temp_1 = stencil.store %t_xz_t1_temp to %t_xz_t1 ([0, 0] : [101, 101]) : !stencil.temp to !stencil.field<[-4,105]x[-4,105]xf32> with_halo : !stencil.temp -# CHECK-NEXT: %t_zz_t1_temp = stencil.apply(%v_x_t1_blk = %v_x_t1_temp_1 : !stencil.temp, %v_z_t1_blk = %v_z_t1_temp_1 : !stencil.temp, %t_zz_t0_blk = %t_zz_t0_temp : !stencil.temp) -> (!stencil.temp) { -# CHECK-NEXT: %13 = arith.constant 3.600000e+00 : f32 -# CHECK-NEXT: %14 = arith.constant 1.125000e+00 : f32 -# CHECK-NEXT: %h_x = arith.constant 1.000000e+01 : f32 -# CHECK-NEXT: %15 = arith.constant -1 : i64 -# CHECK-NEXT: %16 = "math.fpowi"(%h_x, %15) : (f32, i64) -> f32 -# CHECK-NEXT: %17 = stencil.access %v_x_t1_blk[0, 0] : !stencil.temp -# CHECK-NEXT: %18 = arith.mulf %14, %16 : f32 -# CHECK-NEXT: %19 = arith.mulf %18, %17 : f32 -# CHECK-NEXT: %20 = arith.constant 4.166667e-02 : f32 -# CHECK-NEXT: %h_x_1 = arith.constant 1.000000e+01 : f32 -# CHECK-NEXT: %21 = arith.constant -1 : i64 -# CHECK-NEXT: %22 = "math.fpowi"(%h_x_1, %21) : (f32, i64) -> f32 -# CHECK-NEXT: %23 = stencil.access %v_x_t1_blk[-2, 0] : !stencil.temp -# CHECK-NEXT: %24 = arith.mulf %20, %22 : f32 -# CHECK-NEXT: %25 = arith.mulf %24, %23 : f32 -# CHECK-NEXT: %26 = arith.constant -1.125000e+00 : f32 -# CHECK-NEXT: %h_x_2 = arith.constant 1.000000e+01 : f32 -# CHECK-NEXT: %27 = arith.constant -1 : i64 -# CHECK-NEXT: %28 = "math.fpowi"(%h_x_2, %27) : (f32, i64) -> f32 -# CHECK-NEXT: %29 = stencil.access %v_x_t1_blk[-1, 0] : !stencil.temp -# CHECK-NEXT: %30 = arith.mulf %26, %28 : f32 -# CHECK-NEXT: %31 = arith.mulf %30, %29 : f32 -# CHECK-NEXT: %32 = arith.constant -4.166667e-02 : f32 -# CHECK-NEXT: %h_x_3 = arith.constant 1.000000e+01 : f32 -# CHECK-NEXT: %33 = arith.constant -1 : i64 -# CHECK-NEXT: %34 = "math.fpowi"(%h_x_3, %33) : (f32, i64) -> f32 -# CHECK-NEXT: %35 = stencil.access %v_x_t1_blk[1, 0] : !stencil.temp -# CHECK-NEXT: %36 = arith.mulf %32, %34 : f32 -# CHECK-NEXT: %37 = arith.mulf %36, %35 : f32 -# CHECK-NEXT: %38 = arith.addf %19, %25 : f32 -# CHECK-NEXT: %39 = arith.addf %38, %31 : f32 -# CHECK-NEXT: %40 = arith.addf %39, %37 : f32 -# CHECK-NEXT: %41 = arith.mulf %13, %40 : f32 -# CHECK-NEXT: %42 = arith.constant 7.200000e+00 : f32 -# CHECK-NEXT: %43 = arith.constant 1.125000e+00 : f32 -# CHECK-NEXT: %h_z = arith.constant 1.000000e+01 : f32 -# CHECK-NEXT: %44 = arith.constant -1 : i64 -# CHECK-NEXT: %45 = "math.fpowi"(%h_z, %44) : (f32, i64) -> f32 -# CHECK-NEXT: %46 = stencil.access %v_z_t1_blk[0, 0] : !stencil.temp -# CHECK-NEXT: %47 = arith.mulf %43, %45 : f32 -# CHECK-NEXT: %48 = arith.mulf %47, %46 : f32 -# CHECK-NEXT: %49 = arith.constant 4.166667e-02 : f32 -# CHECK-NEXT: %h_z_1 = arith.constant 1.000000e+01 : f32 -# CHECK-NEXT: %50 = arith.constant -1 : i64 -# CHECK-NEXT: %51 = "math.fpowi"(%h_z_1, %50) : (f32, i64) -> f32 -# CHECK-NEXT: %52 = stencil.access %v_z_t1_blk[0, -2] : !stencil.temp -# CHECK-NEXT: %53 = arith.mulf %49, %51 : f32 -# CHECK-NEXT: %54 = arith.mulf %53, %52 : f32 -# CHECK-NEXT: %55 = arith.constant -1.125000e+00 : f32 -# CHECK-NEXT: %h_z_2 = arith.constant 1.000000e+01 : f32 -# CHECK-NEXT: %56 = arith.constant -1 : i64 -# CHECK-NEXT: %57 = "math.fpowi"(%h_z_2, %56) : (f32, i64) -> f32 -# CHECK-NEXT: %58 = stencil.access %v_z_t1_blk[0, -1] : !stencil.temp -# CHECK-NEXT: %59 = arith.mulf %55, %57 : f32 -# CHECK-NEXT: %60 = arith.mulf %59, %58 : f32 -# CHECK-NEXT: %61 = arith.constant -4.166667e-02 : f32 -# CHECK-NEXT: %h_z_3 = arith.constant 1.000000e+01 : f32 -# CHECK-NEXT: %62 = arith.constant -1 : i64 -# CHECK-NEXT: %63 = "math.fpowi"(%h_z_3, %62) : (f32, i64) -> f32 -# CHECK-NEXT: %64 = stencil.access %v_z_t1_blk[0, 1] : !stencil.temp -# CHECK-NEXT: %65 = arith.mulf %61, %63 : f32 -# CHECK-NEXT: %66 = arith.mulf %65, %64 : f32 -# CHECK-NEXT: %67 = arith.addf %48, %54 : f32 -# CHECK-NEXT: %68 = arith.addf %67, %60 : f32 -# CHECK-NEXT: %69 = arith.addf %68, %66 : f32 -# CHECK-NEXT: %70 = arith.mulf %42, %69 : f32 -# CHECK-NEXT: %dt = arith.constant 1.178511e+00 : f32 -# CHECK-NEXT: %71 = arith.constant -1 : i64 -# CHECK-NEXT: %72 = "math.fpowi"(%dt, %71) : (f32, i64) -> f32 -# CHECK-NEXT: %73 = stencil.access %t_zz_t0_blk[0, 0] : !stencil.temp -# CHECK-NEXT: %74 = arith.mulf %72, %73 : f32 -# CHECK-NEXT: %75 = arith.addf %41, %70 : f32 -# CHECK-NEXT: %76 = arith.addf %75, %74 : f32 -# CHECK-NEXT: %dt_1 = arith.constant 1.178511e+00 : f32 -# CHECK-NEXT: %77 = arith.mulf %76, %dt_1 : f32 -# CHECK-NEXT: stencil.return %77 : f32 -# CHECK-NEXT: } -# CHECK-NEXT: %t_zz_t1_temp_1 = stencil.store %t_zz_t1_temp to %t_zz_t1 ([0, 0] : [101, 101]) : !stencil.temp to !stencil.field<[-4,105]x[-4,105]xf32> with_halo : !stencil.temp -# CHECK-NEXT: scf.yield %v_x_t1, %v_x_t0, %v_z_t1, %v_z_t0, %t_xz_t1, %t_xz_t0, %t_xx_t1, %t_xx_t0, %t_zz_t1, %t_zz_t0 : !stencil.field<[-4,105]x[-4,105]xf32>, !stencil.field<[-4,105]x[-4,105]xf32>, !stencil.field<[-4,105]x[-4,105]xf32>, !stencil.field<[-4,105]x[-4,105]xf32>, !stencil.field<[-4,105]x[-4,105]xf32>, !stencil.field<[-4,105]x[-4,105]xf32>, !stencil.field<[-4,105]x[-4,105]xf32>, !stencil.field<[-4,105]x[-4,105]xf32>, !stencil.field<[-4,105]x[-4,105]xf32>, !stencil.field<[-4,105]x[-4,105]xf32> -# CHECK-NEXT: } -# CHECK-NEXT: %13 = func.call @timer_end(%0) : (f64) -> f64 -# CHECK-NEXT: "llvm.store"(%13, %timers) <{"ordering" = 0 : i64}> : (f64, !llvm.ptr) -> () -# CHECK-NEXT: func.return -# CHECK-NEXT: } -# CHECK-NEXT: func.func private @timer_start() -> f64 -# CHECK-NEXT: func.func private @timer_end(f64) -> f64 -# CHECK-NEXT: } diff --git a/tests/filecheck/lit.cfg b/tests/filecheck/lit.cfg index cbb3ced0d5b..0d9ed1830a6 100644 --- a/tests/filecheck/lit.cfg +++ b/tests/filecheck/lit.cfg @@ -1,11 +1,19 @@ import lit.formats import os +config.test_source_root = os.path.dirname(__file__) +xdsl_src = os.path.dirname(os.path.dirname(config.test_source_root)) -config.name = "Devito/xDSL" -config.test_format = lit.formats.ShTest() -config.suffixes = ['.mlir', '.py'] +config.name = "xDSL" +config.test_format = lit.formats.ShTest(preamble_commands=[f"cd {xdsl_src}"]) +config.suffixes = ['.test', '.mlir', '.py'] +xdsl_opt = "xdsl/tools/xdsl-opt" +xdsl_run = "xdsl/tools/xdsl_run.py" +irdl_to_pyrdl = "xdsl/tools/irdl_to_pyrdl.py" + +config.substitutions.append(('XDSL_ROUNDTRIP', "xdsl-opt %s --print-op-generic --split-input-file | xdsl-opt --split-input-file | filecheck %s")) +config.substitutions.append(("XDSL_GENERIC_ROUNDTRIP", "xdsl-opt %s --print-op-generic --split-input-file | filecheck %s --check-prefix=CHECK-GENERIC")) if "COVERAGE" in lit_config.params: config.substitutions.append(('xdsl-opt', f"coverage run {xdsl_opt}")) config.substitutions.append(('xdsl-run', f"coverage run {xdsl_run}")) diff --git a/tests/filecheck/version.mlir b/tests/filecheck/version.mlir new file mode 100644 index 00000000000..f410422757a --- /dev/null +++ b/tests/filecheck/version.mlir @@ -0,0 +1,3 @@ +// RUN: xdsl-opt --version | filecheck %s + +//CHECK: xdsl-opt built from xdsl version {{.*}} \ No newline at end of file diff --git a/tests/test_xdsl_base.py b/tests/test_xdsl_base.py index ed50c0eacf5..d5c12210af9 100644 --- a/tests/test_xdsl_base.py +++ b/tests/test_xdsl_base.py @@ -1120,7 +1120,6 @@ def test_elastic_2D(self, shape, so, nt): assert not np.isclose(xdsl_norm_tau2, 0.0, rtol=1e-04) assert not np.isclose(xdsl_norm_tau3, 0.0, rtol=1e-04) - @pytest.mark.parametrize('shape', [(101, 101, 101), (201, 201, 201)]) @pytest.mark.parametrize('so', [2, 4, 8]) @pytest.mark.parametrize('nt', [10, 20, ]) @@ -1198,11 +1197,21 @@ def test_elastic_3D(self, shape, so, nt): # TODO: Reinitialize the fields to zero v[0].data[:] = 0 v[1].data[:] = 0 + v[2].data[:] = 0 + + # t_xx, t_xy, t_xz + # t_yx, t_yy, t_yz + # t_zx, t_zy, t_zz tau[0].data[:] = 0 tau[1].data[:] = 0 tau[2].data[:] = 0 tau[3].data[:] = 0 + tau[4].data[:] = 0 + tau[5].data[:] = 0 + tau[6].data[:] = 0 + tau[7].data[:] = 0 + tau[8].data[:] = 0 # Inject sources. We use it to preinject data op = Operator([u_v] + [u_t] + src_xx + src_yy + src_zz) @@ -1230,4 +1239,4 @@ def test_elastic_3D(self, shape, so, nt): assert not np.isclose(xdsl_norm_tau0, 0.0, rtol=1e-04) assert not np.isclose(xdsl_norm_tau1, 0.0, rtol=1e-04) assert not np.isclose(xdsl_norm_tau2, 0.0, rtol=1e-04) - assert not np.isclose(xdsl_norm_tau3, 0.0, rtol=1e-04) \ No newline at end of file + assert not np.isclose(xdsl_norm_tau3, 0.0, rtol=1e-04) diff --git a/xdsl_examples/diffusion_2D_wBCs.py b/xdsl_examples/diffusion_2D_wBCs.py index b42495a7067..ac5868e37b8 100644 --- a/xdsl_examples/diffusion_2D_wBCs.py +++ b/xdsl_examples/diffusion_2D_wBCs.py @@ -25,8 +25,8 @@ help="Block levels") parser.add_argument("-devito", "--devito", default=False, type=bool, help="Devito run") parser.add_argument("-xdsl", "--xdsl", default=False, type=bool, help="xDSL run") -args = parser.parse_args() parser.add_argument("-plot", "--plot", default=False, type=bool, help="Plot2D") +args = parser.parse_args() mpiconf = configuration['mpi']