diff --git a/.github/workflows/bcload.yml b/.github/workflows/bcload.yml deleted file mode 100644 index c278f0621b2..00000000000 --- a/.github/workflows/bcload.yml +++ /dev/null @@ -1,34 +0,0 @@ -name: Bitcode loading CI - -on: [push] - -jobs: - build: - name: Bitcode loading CI LLVM ${{ matrix.llvm }} ${{ matrix.build }} ${{ matrix.os }} - runs-on: ${{ matrix.os }} - - strategy: - fail-fast: false - matrix: - # BCLoad tests only run with old pass manager [aka up to and including 13] - llvm: ["15"] - build: ["Release"] # "RelWithDebInfo" - os: [ubuntu-22.04] - - timeout-minutes: 30 - steps: - - name: add llvm - run: | - wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key|sudo apt-key add - - sudo apt-add-repository "deb http://apt.llvm.org/`lsb_release -c | cut -f2`/ llvm-toolchain-`lsb_release -c | cut -f2`-${{ matrix.llvm }} main" || true - sudo apt-get install -y cmake gcc g++ llvm-${{ matrix.llvm }}-dev clang-${{ matrix.llvm }} libclang-${{ matrix.llvm }}-dev - sudo python3 -m pip install --upgrade pip lit - - uses: actions/checkout@v4 - - name: mkdir - run: cd enzyme && rm -rf build && mkdir build - - name: cmake - run: | - cd enzyme/build - cmake .. -DLLVM_EXTERNAL_LIT=`which lit` -DCMAKE_BUILD_TYPE=${{ matrix.build }} -DLLVM_DIR=/usr/lib/llvm-${{ matrix.llvm }}/lib/cmake/llvm - - name: make check-bcpass - run: cd enzyme/build && make -j `nproc` check-bcpass diff --git a/.github/workflows/benchmark.yml b/.github/workflows/benchmark.yml deleted file mode 100644 index b4bfa07ded6..00000000000 --- a/.github/workflows/benchmark.yml +++ /dev/null @@ -1,54 +0,0 @@ -name: Benchmarking - -on: - push: - branches: - - main - pull_request: - branches: - - main - merge_group: - -concurrency: - group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} - cancel-in-progress: true - -jobs: - build: - name: Benchmark Test on os ${{ matrix.os }} and llvm ${{ matrix.llvm }} mode ${{ matrix.build }} - runs-on: ${{ matrix.os }} - container: - image: ${{ (contains(matrix.os, 'linux') && 'ghcr.io/enzymead/reactant-docker-images@sha256:91e1edb7a7c869d5a70db06e417f22907be0e67ca86641d48adcea221fedc674' ) || '' }} - - strategy: - fail-fast: false - matrix: - llvm: ["15"] - build: ["Release"] #, "Debug" "RelWithDebInfo" - os: ["linux-x86-n2-32"] - timeout-minutes: 120 - steps: - - name: add llvm - run: | - # curl -fsSL https://apt.llvm.org/llvm-snapshot.gpg.key | apt-key add - - apt-get update -y - apt-get install -y lsb-release software-properties-common - apt-add-repository "deb http://apt.llvm.org/`lsb_release -c | cut -f2`/ llvm-toolchain-`lsb_release -c | cut -f2`-${{ matrix.llvm }} main" || true - apt-get --allow-unauthenticated install -y python3-pip autoconf cmake gcc g++ libtool gfortran libblas-dev llvm-${{ matrix.llvm }}-dev clang-${{ matrix.llvm }} libeigen3-dev libboost-dev libzstd-dev - python3 -m pip install lit pathlib --break-system-packages - touch /usr/lib/llvm-${{ matrix.llvm }}/bin/yaml-bench - - uses: actions/checkout@v4 - - name: mkdir - run: rm -rf build && mkdir build - - name: cmake - working-directory: build - run: cmake ../enzyme -DLLVM_EXTERNAL_LIT=`which lit` -DCMAKE_BUILD_TYPE=${{ matrix.build }} -DLLVM_DIR=/usr/lib/llvm-${{ matrix.llvm }}/lib/cmake/llvm -DENZYME_ENABLE_BENCHMARKS=On - - name: make - working-directory: build - run: make -j `nproc` LLVMEnzyme-${{ matrix.llvm }} - - name: make bench-enzyme - working-directory: build - run: make bench-enzyme - - name: results - working-directory: build - run: cat _deps/cpu_benchmarks-src/*/*/results.json diff --git a/.github/workflows/ccpp.yml b/.github/workflows/ccpp.yml deleted file mode 100644 index 9124a4d9829..00000000000 --- a/.github/workflows/ccpp.yml +++ /dev/null @@ -1,66 +0,0 @@ -name: C/C++ CI - -on: - push: - branches: - - main - pull_request: - branches: - - main - merge_group: - -concurrency: - # Skip intermediate builds: always. - # Cancel intermediate builds: only if it is a pull request build. - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }} - -jobs: - build: - name: Integration CI LLVM ${{ matrix.llvm }} ${{ matrix.build }} ${{ matrix.os }} - runs-on: ${{ matrix.os }} - - strategy: - fail-fast: false - matrix: - llvm: ["15", "16", "17", "18", "19", "20", "21"] - build: ["Release"] # "RelWithDebInfo" - os: [ubuntu-22.04] - - timeout-minutes: 45 - - steps: - - name: add llvm - run: | - wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key|sudo apt-key add - - sudo apt-get install -y libmpfr-dev - sudo apt-add-repository "deb http://apt.llvm.org/`lsb_release -c | cut -f2`/ llvm-toolchain-`lsb_release -c | cut -f2`-${{ matrix.llvm }} main" || true - sudo apt-get install -y cmake gcc g++ llvm-${{ matrix.llvm }}-dev libomp-${{ matrix.llvm }}-dev lld-${{ matrix.llvm }} clang-${{ matrix.llvm }} libclang-${{ matrix.llvm }}-dev libeigen3-dev libboost-dev libzstd-dev - sudo python3 -m pip install --upgrade pip lit - - uses: actions/checkout@v4 - - name: mkdir - run: rm -rf build && mkdir build - - name: cmake - working-directory: build - run: cmake ../enzyme -DLLVM_EXTERNAL_LIT=`which lit` -DCMAKE_BUILD_TYPE=${{ matrix.build }} -DLLVM_DIR=/usr/lib/llvm-${{ matrix.llvm }}/lib/cmake/llvm - - name: make - run: cd build && make -j `nproc` LLVMEnzyme-${{ matrix.llvm }} ClangEnzyme-${{ matrix.llvm }} LLDEnzyme-${{ matrix.llvm }} - - name: make test-cmake - working-directory: build - run: make -j `nproc` test-cmake - - name: make check-enzyme-integration - working-directory: build - run: make -j `nproc` check-enzyme-integration - - - name: Update Nightly Release - uses: ncipollo/release-action@v1 - if: ${{ !cancelled() && github.ref == 'refs/heads/main' }} - with: - tag: nightly - name: Nightly Release - body: "Latest nightly build of Enzyme." - artifacts: "build/Enzyme/LLVMEnzyme-${{ matrix.llvm }}*,build/Enzyme/ClangEnzyme-${{ matrix.llvm }}*,build/Enzyme/LLDEnzyme-${{ matrix.llvm }}*" - allowUpdates: true - removeArtifacts: false - replacesArtifacts: true - token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/doxygen.yml b/.github/workflows/doxygen.yml deleted file mode 100644 index 722fbe6b14a..00000000000 --- a/.github/workflows/doxygen.yml +++ /dev/null @@ -1,41 +0,0 @@ -name: Build and deploy Doxygen to Scripts - -on: - push: - branches: - - main - -jobs: - build-docs: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - - uses: mattnotmitt/doxygen-action@v1.12.0 - with: - working-directory: 'enzyme/' - doxyfile-path: 'doxygen.cfg' - - - name: Upload static files as artifact - id: deployment - uses: actions/upload-pages-artifact@v3 # or specific "vX.X.X" version tag for this action - with: - path: enzyme/doxygen/html - - deploy-docs: - # Grant GITHUB_TOKEN the permissions required to make a Pages deployment - permissions: - pages: write # to deploy to Pages - id-token: write # to verify the deployment originates from an appropriate source - - # Deploy to the github-pages environment - environment: - name: github-pages - url: ${{ steps.deployment.outputs.page_url }} - - needs: build-docs - runs-on: ubuntu-latest - steps: - - name: Deploy to GitHub Pages - id: deployment - uses: actions/deploy-pages@v4 # or specific "vX.X.X" version tag for this action diff --git a/.github/workflows/enzyme-bazel.yml b/.github/workflows/enzyme-bazel.yml deleted file mode 100644 index d41fdedb7f5..00000000000 --- a/.github/workflows/enzyme-bazel.yml +++ /dev/null @@ -1,78 +0,0 @@ -name: Bazel - -on: - schedule: - - cron: 0 0 * * * - push: - branches: - - main - paths: - - '.github/workflows/enzyme-bazel.yml' - - 'enzyme/Enzyme/**' - - 'enzyme/includes/**' - - 'enzyme/test/**' - - 'enzyme/tools/**' - - 'enzyme/BUILD' - - 'enzyme/WORKSPACE' - pull_request: - branches: - - main - paths: - - '.github/workflows/enzyme-bazel.yml' - - 'enzyme/Enzyme/**' - - 'enzyme/includes/**' - - 'enzyme/test/**' - - 'enzyme/tools/**' - - 'enzyme/BUILD' - - 'enzyme/WORKSPACE' - merge_group: - -concurrency: - # Skip intermediate builds: always. - # Cancel intermediate builds: only if it is a pull request build. - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }} - -jobs: - build: - name: Enzyme Bazel Build - ${{ matrix.os }} - runs-on: ${{ matrix.os }} - strategy: - fail-fast: false - matrix: - - linux-x86-n2-32 - build: - - Release - llbuild: - - Release - timeout-minutes: 500 - - container: - image: ${{ (contains(matrix.os, 'linux') && 'ghcr.io/enzymead/reactant-docker-images@sha256:91e1edb7a7c869d5a70db06e417f22907be0e67ca86641d48adcea221fedc674' ) || '' }} - - steps: - - name: Install Python dependencies - run: python -m pip install lit - - uses: actions/checkout@v4 - - uses: actions/checkout@v4 - with: - repository: 'llvm/llvm-project' - path: 'llvm-project' - - uses: bazel-contrib/setup-bazel@0.14.0 - name: Set up Bazel - with: - # Avoid downloading Bazel every time. - bazelisk-cache: true - # Store build cache per workflow. - disk-cache: ${{ github.workflow }}-${{ matrix.os }}-${{ matrix.build }}-${{ matrix.llbuild }} - # Share repository cache between workflows. - repository-cache: true - bazelisk-version: 1.x - - name: Build Enzyme - run: | - cd enzyme - bazel build --color=yes :EnzymeStatic :enzymemlir-opt - - name: Test Enzyme - run: | - cd enzyme - bazel test --color=yes --test_output=errors ... diff --git a/.github/workflows/enzyme-ci.yml b/.github/workflows/enzyme-ci.yml deleted file mode 100644 index ad21ba11f29..00000000000 --- a/.github/workflows/enzyme-ci.yml +++ /dev/null @@ -1,117 +0,0 @@ -name: Enzyme CI - -on: - push: - branches: - - main - pull_request: - merge_group: - -concurrency: - # Skip intermediate builds: always. - # Cancel intermediate builds: only if it is a pull request build. - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }} - -jobs: - build-linux: - name: Enzyme CI LLVM ${{ matrix.llvm }} ${{ matrix.build }} ${{ matrix.os }} - runs-on: ${{ matrix.os }} - - strategy: - fail-fast: false - matrix: - llvm: ["15", "16"] - build: ["Release", "Debug"] # "RelWithDebInfo" - os: [ubuntu-22.04] - - timeout-minutes: 30 - - steps: - - name: add llvm - run: | - wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key|sudo apt-key add - - sudo apt-add-repository "deb http://apt.llvm.org/`lsb_release -c | cut -f2`/ llvm-toolchain-`lsb_release -c | cut -f2`-${{ matrix.llvm }} main" || true - sudo apt-get install -y cmake gcc g++ llvm-${{ matrix.llvm }}-dev libzstd-dev - sudo python3 -m pip install --upgrade pip lit - - uses: actions/checkout@v4 - - name: mkdir - run: rm -rf build && mkdir build - - name: cmake - working-directory: build - run: cmake ../enzyme -DCMAKE_BUILD_TYPE=${{ matrix.build }} -DLLVM_EXTERNAL_LIT=`which lit` -DLLVM_DIR=/usr/lib/llvm-${{ matrix.llvm }}/lib/cmake/llvm - - name: make - working-directory: build - run: make -j `nproc` - - name: make check-typeanalysis - working-directory: build - run: make -j `nproc` check-typeanalysis - - name: make check-activityanalysis - working-directory: build - run: make -j `nproc` check-activityanalysis - - name: make check-enzyme - working-directory: build - run: make -j `nproc` check-enzyme-bench - - build-macos: - name: Enzyme CI LLVM ${{ matrix.llvm }} ${{ matrix.build }} macOS - runs-on: macos-latest - - strategy: - fail-fast: false - matrix: - llvm: ["15", "16"] - build: ["Release", "Debug"] # "RelWithDebInfo" - - timeout-minutes: 30 - steps: - - name: add llvm - run: | - brew update - brew uninstall cmake - brew install llvm@${{ matrix.llvm }} make cmake - sudo python3 -m pip install --upgrade --break-system-packages --user pip lit requests - - uses: actions/checkout@v4 - - name: mkdir - run: rm -rf build && mkdir build - - name: cmake - working-directory: build - run: cmake ../enzyme -DCMAKE_BUILD_TYPE=${{ matrix.build }} -DLLVM_EXTERNAL_LIT=`find /Users/runner/Library/Python/ -iname lit` -DLLVM_DIR=`brew --prefix llvm@${{ matrix.llvm }}`/lib/cmake/llvm - - name: make - working-directory: build - run: make -j 3 - - name: make check-typeanalysis - working-directory: build - run: make -j 3 check-typeanalysis - - name: make check-activityanalysis - working-directory: build - run: make -j 3 check-activityanalysis - - name: make check-enzyme - working-directory: build - run: make -j3 check-enzyme-bench - - build-xcode: - name: Enzyme CI LLVM ${{ matrix.llvm }} ${{ matrix.build }} macOS XCode - runs-on: macos-latest - - strategy: - fail-fast: false - matrix: - llvm: ["16"] - build: ["Release"] # "RelWithDebInfo" - - timeout-minutes: 30 - steps: - - name: add llvm - run: | - brew uninstall cmake - brew install llvm@${{ matrix.llvm }} make cmake gcc - sudo python3 -m pip install --upgrade --break-system-packages --user pip lit - - uses: actions/checkout@v4 - - name: mkdir - run: rm -rf build && mkdir build - - name: cmake - working-directory: build - run: | - cmake ../enzyme -GXcode -DCMAKE_BUILD_TYPE=${{ matrix.build }} -DLLVM_EXTERNAL_LIT=`which lit` -DLLVM_DIR=`brew --prefix llvm@${{ matrix.llvm }}`/lib/cmake/llvm - cmake --build . --parallel 3 diff --git a/.github/workflows/enzyme-julia.yml b/.github/workflows/enzyme-julia.yml deleted file mode 100644 index 6aa2fe4e505..00000000000 --- a/.github/workflows/enzyme-julia.yml +++ /dev/null @@ -1,80 +0,0 @@ -name: Julia Enzyme CI - -on: - push: - branches: - - main - pull_request: - branches: - - main - merge_group: - -# needed to allow julia-actions/cache to delete old caches that it has created -permissions: - actions: write - contents: read - -concurrency: - # Skip intermediate builds: always. - # Cancel intermediate builds: only if it is a pull request build. - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }} - -jobs: - build: - name: Enzyme CI Julia ${{ matrix.version }} ${{ matrix.os }} - runs-on: ${{ matrix.os }} - continue-on-error: ${{ matrix.version == 'nightly' }} - strategy: - fail-fast: false - matrix: - version: - - '1.10' - - '1.11' - - '1.12' - os: - - ubuntu-latest - arch: - - 'default' - timeout-minutes: 60 - steps: - - uses: actions/checkout@v5 - - uses: actions/checkout@v5 - with: - repository: 'EnzymeAD/Enzyme.jl' - path: ./jl - ref: main - - uses: julia-actions/setup-julia@v2 - with: - version: ${{ matrix.version }} - arch: ${{ matrix.arch }} - - uses: julia-actions/cache@v2 - - - name: Set environment variable to build libEnzyme - if: ${{ runner.os == 'macOS' }} - run: | - echo "SDKROOT=$(xcrun --show-sdk-path)" >> "${GITHUB_ENV}" - - name: Build libEnzyme - run: | - julia --color=yes --project=jl/deps -e 'using Pkg; Pkg.instantiate()' - julia --color=yes --project=jl/deps jl/deps/build_local.jl ./enzyme - - name: Dev EnzymeCore - run: julia --color=yes --project=jl -e 'using Pkg; Pkg.develop(path="jl/lib/EnzymeCore")' - - uses: julia-actions/julia-buildpkg@v1 - with: - project: jl - - name: "Set test arguments" - shell: bash - run: | - # Run tests in verbose mode - TEST_ARGS=(--verbose) - # if [[ ${{ runner.os }} == 'macOS' ]]; then - # # Encourage ParallelTestRunner to use two jobs on macOS, rather - # # than the single one it'd use by default. - # TEST_ARGS+=(--jobs=2) - # fi - echo "runtest_test_args=${TEST_ARGS[@]}" >> "${GITHUB_ENV}" - - uses: julia-actions/julia-runtest@v1 - with: - project: jl - test_args: ${{ env.runtest_test_args }} diff --git a/.github/workflows/enzyme-mlir.yml b/.github/workflows/enzyme-mlir.yml deleted file mode 100644 index ae77a91dbd1..00000000000 --- a/.github/workflows/enzyme-mlir.yml +++ /dev/null @@ -1,94 +0,0 @@ -name: MLIR - -on: - push: - branches: - - main - pull_request: - branches: - - main - merge_group: - -concurrency: - # Skip intermediate builds: always. - # Cancel intermediate builds: only if it is a pull request build. - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }} - -jobs: - build-linux: - name: MLIR ${{ matrix.build }} ${{ matrix.os }} - runs-on: ${{ matrix.os }} - - strategy: - fail-fast: false - matrix: - build: ["Release", "Debug"] # "RelWithDebInfo" - llbuild: ["Release"] - os: [linux-x86-n2-32] - - timeout-minutes: 500 - - container: - image: ${{ (contains(matrix.os, 'linux') && 'ghcr.io/enzymead/reactant-docker-images@sha256:91e1edb7a7c869d5a70db06e417f22907be0e67ca86641d48adcea221fedc674' ) || '' }} - - steps: - - name: Install dependencies - run: | - apt-get update - apt-get install -y binutils ninja-build cmake gcc g++ python3 python3-dev - - - uses: actions/checkout@v4 - with: - path: 'Enzyme' - - - uses: actions/checkout@v4 - with: - repository: 'llvm/llvm-project' - ref: '87d42c13cd6b119240781f31e5869981d500a186' - path: 'llvm-project' - - - name: Set BASE_DIR - # We have to use `${GITHUB_WORKSPACE}` instead of `github.workspace` because GitHub - # is terrible and the two don't match inside containers: - # https://github.com/actions/runner/issues/2058 - run: | - BASE_DIR=${GITHUB_WORKSPACE} - # Make sure this directory exists, for good measure - ls -lhrt "${BASE_DIR}"/Enzyme - ls -lhrt "${BASE_DIR}"/llvm-project - echo "BASE_DIR=${BASE_DIR}" >> ${GITHUB_ENV} - - - name: Get MLIR commit hash - id: mlir-commit - working-directory: 'llvm-project' - run: echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT - - - name: Cache MLIR - id: cache-mlir - uses: actions/cache@v4 - with: - path: ${{ env.BASE_DIR }}/llvm-project/mlir-build - key: ${{ matrix.llbuild }}-${{ matrix.os }}-mlir-${{ steps.mlir-commit.outputs.sha_short }} - - - name: MLIR build - if: steps.cache-mlir.outputs.cache-hit != 'true' - working-directory: ${{ env.BASE_DIR }}/'llvm-project' - run: | - mkdir mlir-build && cd mlir-build && cmake ../llvm -GNinja -DLLVM_ENABLE_PROJECTS="llvm;clang;mlir" -DLLVM_ENABLE_RUNTIMES=openmp -DCMAKE_BUILD_TYPE=${{ matrix.llbuild }} \ - -DLLVM_ENABLE_ASSERTIONS=ON -DLLVM_TARGETS_TO_BUILD=X86 \ - -DLLVM_USE_LINKER=gold -DLLVM_PARALLEL_LINK_JOBS=2 \ - -DCLANG_ENABLE_STATIC_ANALYZER=OFF -DCLANG_ENABLE_ARCMT=OFF \ - -DLLVM_OPTIMIZED_TABLEGEN=ON && ninja || echo "already built" - - - name: Enzyme build - working-directory: ${{ env.BASE_DIR }}/'Enzyme' - run: | - mkdir enzyme-build && cd enzyme-build - cmake ../enzyme -GNinja -DCMAKE_BUILD_TYPE=${{ matrix.build }} -DLLVM_DIR=${{ env.BASE_DIR }}/llvm-project/mlir-build -DENZYME_MLIR=ON - ninja - - - name: Check enzyme-mlir - working-directory: 'Enzyme/enzyme-build' - run: ninja check-enzymemlir - diff --git a/.github/workflows/enzyme-rust.yml b/.github/workflows/enzyme-rust.yml deleted file mode 100644 index 77b0d3042f5..00000000000 --- a/.github/workflows/enzyme-rust.yml +++ /dev/null @@ -1,97 +0,0 @@ -name: Enzyme Rust CI - -on: - push: - branches: - - main - pull_request: - branches: - - main - merge_group: - -concurrency: - # Skip intermediate builds: always. - # Cancel intermediate builds: only if it is a pull request build. - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }} - -jobs: - rust-autodiff: - name: Rust Autodiff ${{ matrix.os }} - runs-on: ${{ matrix.os }} - strategy: - fail-fast: false - matrix: - os: [linux-x86-n2-32] - commit: [cb40c25f6aebb637163d26bf76a680ed6e5d1eda] - - timeout-minutes: 90 - - container: - image: ${{ (contains(matrix.os, 'linux') && 'ghcr.io/enzymead/reactant-docker-images@sha256:91e1edb7a7c869d5a70db06e417f22907be0e67ca86641d48adcea221fedc674' ) || '' }} - - steps: - - name: Prepare env - run: | - echo "CCACHE_DIR=${GITHUB_WORKSPACE}/.ccache" >> "${GITHUB_ENV}" - - name: Install dependencies - run: | - apt-get update - apt-get install -y ninja-build cmake ccache nodejs - - name: Prepare ccache directory - run: | - mkdir -p "$CCACHE_DIR" - - name: Install Rust toolchain - run: | - curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y - . ~/.cargo/env - rustup toolchain install nightly - rustup default nightly - - uses: actions/checkout@v5 - name: Checkout Enzyme - - uses: actions/checkout@v5 - name: Checkout Rust compiler - with: - repository: rust-lang/rust - ref: ${{ matrix.commit }} - path: rust - - name: Cache ccache - uses: actions/cache@v4 - with: - path: ${{ env.CCACHE_DIR }} - key: ccache-rust-${{ matrix.os }}-${{ matrix.commit }} - - name: ccache --show-stats - run: | - ccache --show-stats --verbose - - name: Configure Rust compiler - run: | - . ~/.cargo/env - cd rust - # Replace rustc's built-in Enzyme submodule with the Enzyme source code from this repository - rm -rf src/tools/enzyme/enzyme - ln -s "${GITHUB_WORKSPACE}/enzyme" src/tools/enzyme/enzyme - ./configure \ - --release-channel=nightly \ - --enable-llvm-enzyme \ - --enable-option-checking \ - --disable-docs \ - --enable-ccache \ - --enable-llvm-assertions \ - --enable-llvm-link-shared - - name: Build Rust compiler stage 1 - working-directory: rust - run: | - . ~/.cargo/env - ./x build --stage 1 library - - name: Run Rust autodiff tests - working-directory: rust - continue-on-error: true - run: | - . ~/.cargo/env - ./x test --stage 1 tests/codegen-llvm/autodiff - ./x test --stage 1 tests/pretty/autodiff - ./x test --stage 1 tests/ui/autodiff - ./x test --stage 1 tests/ui/feature-gates/feature-gate-autodiff.rs - - name: ccache --show-stats - run: | - ccache --show-stats --verbose diff --git a/.github/workflows/format.yml b/.github/workflows/format.yml deleted file mode 100644 index 4bf18b435a8..00000000000 --- a/.github/workflows/format.yml +++ /dev/null @@ -1,26 +0,0 @@ -name: Clang-Format - -on: - push: - pull_request: - merge_group: - -concurrency: - # Skip intermediate builds: always. - # Cancel intermediate builds: only if it is a pull request build. - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }} - -jobs: - build: - name: Format - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v4 - - uses: DoozyX/clang-format-lint-action@v0.20 - with: - source: 'enzyme/Enzyme enzyme/tools/enzyme-tblgen' - exclude: './CMakeLists.txt enzyme/Enzyme/SCEV' - style: 'llvm' - clangFormatVersion: 16 diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml deleted file mode 100644 index 6771747405b..00000000000 --- a/.github/workflows/integration.yml +++ /dev/null @@ -1,59 +0,0 @@ -name: Integration -on: - pull_request: - paths: - - ".github/workflows/integration.yml" - - "enzyme/**" - - "integration/**" - push: - branches: - - main - paths: - - ".github/workflows/integration.yml" - - "enzyme/**" - - "integration/**" - tags: "*" - -concurrency: - # Skip intermediate builds: always. - # Cancel intermediate builds: only if it is a pull request build. - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }} - -jobs: - integration: - timeout-minutes: 45 - name: ${{ matrix.package }} - LLVM ${{ matrix.llvm }} - ${{ matrix.os }} - runs-on: ${{ matrix.os }} - container: - image: ${{ (contains(matrix.os, 'linux') && 'ghcr.io/enzymead/reactant-docker-images_24.04@sha256:2d3132895ab3c3a593cb494fad4ce1e17f4c145771a92809f070805d0250ac71' ) || '' }} - strategy: - fail-fast: false - matrix: - llvm: ["18"] - build: ["Release"] - os: - - linux-x86-n2-32 - - linux-x86-a2-48-a100-4gpu - package: - - mfem - steps: - - uses: actions/checkout@v7 - - name: add llvm - run: | - curl -fsSL https://apt.llvm.org/llvm-snapshot.gpg.key | gpg --dearmor -o /usr/share/keyrings/llvm-snapshot.gpg - apt-add-repository "deb http://apt.llvm.org/`lsb_release -c | cut -f2`/ llvm-toolchain-`lsb_release -c | cut -f2`-${{ matrix.llvm }} main" || true - apt-get install -y cmake gcc g++ clang-${{ matrix.llvm }} libclang-${{ matrix.llvm }}-dev llvm-${{ matrix.llvm }}-dev libzstd-dev - - uses: actions/checkout@v4 - - name: mkdir - run: rm -rf build && mkdir build - - name: cmake - working-directory: build - run: CXX=clang++-${{ matrix.llvm }} cmake ../enzyme -DCMAKE_BUILD_TYPE=${{ matrix.build }} -DLLVM_DIR=/usr/lib/llvm-${{ matrix.llvm }}/lib/cmake/llvm - - name: make - working-directory: build - run: make -j `nproc` - - name: "Run tests" - run: | - bash integration/${{ matrix.package }}/run.sh ${{ matrix.llvm }} enzyme/build/ClangEnzyme-${{ matrix.llvm }}.so `nproc` - shell: bash diff --git a/.github/workflows/tagger.yml b/.github/workflows/tagger.yml deleted file mode 100644 index 187f72e48f2..00000000000 --- a/.github/workflows/tagger.yml +++ /dev/null @@ -1,54 +0,0 @@ -name: Tag CI - -on: - release: - types: - - created - -jobs: - build: - name: Enzyme Tag CI - runs-on: ubuntu-latest - steps: - - uses: actions/create-github-app-token@v2 - id: generate_token - with: - app-id: ${{ secrets.APP_ID }} - private-key: ${{ secrets.APP_PRIVATE_KEY }} - owner: JuliaPackaging - repositories: | - Yggdrasil - - - uses: actions/checkout@v5 - with: - repository: 'JuliaPackaging/Yggdrasil' - path: ygg - - - uses: actions/checkout@v5 - with: - path: enz - - name: replace - run: | - cd ygg - git rm -rf E/Enzyme - mkdir -p E/Enzyme/ - cd E/Enzyme - cp ../../../enz/.packaging/build_tarballs.jl build_tarballs.jl - sed "s~%ENZYME_VERSION%~${GITHUB_REF}~g" build_tarballs.jl -i - sed "s~%ENZYME_HASH%~${GITHUB_SHA}~g" build_tarballs.jl -i - git add . - - name: Create Pull Request - id: cpr - uses: peter-evans/create-pull-request@v7 - with: - path: ygg - commit-message: "Upgrade enzyme to ${{ github.ref }}" - title: "Upgrade enzyme to ${{ github.ref }}" - token: ${{ steps.generate_token.outputs.token }} - reviewers: vchuravy - branch: enzyme/${{ github.ref }} - body: "Automatic PR generated for https://github.com/EnzymeAD/Enzyme " - - name: Check outputs - run: | - echo "Pull Request Number - ${{ steps.cpr.outputs.pull-request-number }}" - echo "Pull Request URL - ${{ steps.cpr.outputs.pull-request-url }}" diff --git a/enzyme/test/Fortran/ForwardMode/allocatableArraySimple_with_bindings.f90 b/enzyme/test/Fortran/ForwardMode/allocatableArraySimple_with_bindings.f90 index 24c32b9f270..8a6692ae187 100644 --- a/enzyme/test/Fortran/ForwardMode/allocatableArraySimple_with_bindings.f90 +++ b/enzyme/test/Fortran/ForwardMode/allocatableArraySimple_with_bindings.f90 @@ -1,31 +1,14 @@ ! REQUIRES: fortran -! RUN: if [[ %fc != ifx ]]; then %fc -flto -O0 -c %loadFortran %s -o /dev/stdout | %opt %loadEnzyme %enzyme -o /dev/stdout | %opt %oflags -O0 -S -o %t.ll && %fc -flto -O0 %t.ll -o %t1 && %t1 | FileCheck %s; fi -! RUN: %fc -flto -O1 -c %loadFortran %s -o /dev/stdout | %opt %loadEnzyme %enzyme -o /dev/stdout | %opt %oflags -O1 -S -o %t.ll && %fc -flto -O1 %t.ll -o %t1 && %t1 | FileCheck %s -! RUN: %fc -flto -O2 -c %loadFortran %s -o /dev/stdout | %opt %loadEnzyme %enzyme -o /dev/stdout | %opt %oflags -O2 -S -o %t.ll && %fc -flto -O2 %t.ll -o %t1 && %t1 | FileCheck %s -! RUN: %fc -flto -O3 -c %loadFortran %s -o /dev/stdout | %opt %loadEnzyme %enzyme -o /dev/stdout | %opt %oflags -O3 -S -o %t.ll && %fc -flto -O3 %t.ll -o %t1 && %t1 | FileCheck %s +! RUN: if [[ %fc != ifx ]]; then %fc -flto -O0 -c %loadFortran %s -o /dev/stdout | %opt %loadEnzyme %enzyme -o %t.ll && %fc -flto -O0 %t.ll -o %t1 && %t1 | FileCheck %s; fi +! RUN: %fc -flto -O1 -c %loadFortran %s -o /dev/stdout | %opt %loadEnzyme %enzyme -o %t.ll && %fc -flto -O1 %t.ll -o %t1 && %t1 | FileCheck %s +! RUN: %fc -flto -O2 -c %loadFortran %s -o /dev/stdout | %opt %loadEnzyme %enzyme -o %t.ll && %fc -flto -O2 %t.ll -o %t1 && %t1 | FileCheck %s +! RUN: %fc -flto -O3 -c %loadFortran %s -o /dev/stdout | %opt %loadEnzyme %enzyme -o %t.ll && %fc -flto -O3 %t.ll -o %t1 && %t1 | FileCheck %s ! NOTE: This test is only configured to run with the flang compiler at -O0 ! For it to work with the ifx compiler we will need to figure out how to ! handle the indirection involved in the enzyme_fwddiff binding -module AD - implicit none - - contains - - ! TODO: Switch to assumed shape implementation once - ! https://github.com/EnzymeAD/Enzyme/issues/2820 - ! has been addressed - subroutine selectFirst(n, x, y) - integer, intent(in) :: n - real, intent(in) :: x(n) - real, intent(inout) :: y - y = x(1) - end subroutine -end module - program app - use AD, only: selectFirst use enzyme, only: enzyme_const, enzyme_dup, enzyme_fwddiff implicit none integer :: n @@ -49,6 +32,19 @@ program app print *, int(dx(2)) print *, int(dx(3)) print *, int(dy) + +contains + + ! TODO: Switch to assumed shape implementation once + ! https://github.com/EnzymeAD/Enzyme/issues/2820 + ! has been addressed + subroutine selectFirst(n, x, y) + integer, intent(in) :: n + real, intent(in) :: x(n) + real, intent(inout) :: y + y = x(1) + end subroutine + end program diff --git a/enzyme/test/Fortran/ForwardMode/allocatableArraySimple_with_explicit_interface.f90 b/enzyme/test/Fortran/ForwardMode/allocatableArraySimple_with_explicit_interface.f90 index 5934ddd2793..dac11194750 100644 --- a/enzyme/test/Fortran/ForwardMode/allocatableArraySimple_with_explicit_interface.f90 +++ b/enzyme/test/Fortran/ForwardMode/allocatableArraySimple_with_explicit_interface.f90 @@ -1,15 +1,15 @@ ! REQUIRES: fortran ! REQUIRES: ifx -! RUN: %fc -flto -O0 -c %s -o /dev/stdout | %opt %loadEnzyme %enzyme -o /dev/stdout | %opt %oflags -O0 -S -o %t.ll && %fc -flto -O0 %t.ll -o %t1 && %t1 | FileCheck %s -! RUN: %fc -flto -O1 -c %s -o /dev/stdout | %opt %loadEnzyme %enzyme -o /dev/stdout | %opt %oflags -O1 -S -o %t.ll && %fc -flto -O1 %t.ll -o %t1 && %t1 | FileCheck %s -! RUN: %fc -flto -O2 -c %s -o /dev/stdout | %opt %loadEnzyme %enzyme -o /dev/stdout | %opt %oflags -O2 -S -o %t.ll && %fc -flto -O2 %t.ll -o %t1 && %t1 | FileCheck %s -! RUN: %fc -flto -O3 -c %s -o /dev/stdout | %opt %loadEnzyme %enzyme -o /dev/stdout | %opt %oflags -O3 -S -o %t.ll && %fc -flto -O3 %t.ll -o %t1 && %t1 | FileCheck %s +! RUN: %fc -flto -O0 -c %s -o /dev/stdout | %opt %loadEnzyme %enzyme -o %t.ll && %fc -flto -O0 %t.ll -o %t1 && %t1 | FileCheck %s +! RUN: %fc -flto -O1 -c %s -o /dev/stdout | %opt %loadEnzyme %enzyme -o %t.ll && %fc -flto -O1 %t.ll -o %t1 && %t1 | FileCheck %s +! RUN: %fc -flto -O2 -c %s -o /dev/stdout | %opt %loadEnzyme %enzyme -o %t.ll && %fc -flto -O2 %t.ll -o %t1 && %t1 | FileCheck %s +! RUN: %fc -flto -O3 -c %s -o /dev/stdout | %opt %loadEnzyme %enzyme -o %t.ll && %fc -flto -O3 %t.ll -o %t1 && %t1 | FileCheck %s ! NOTE: This test is only configured to run with the ifx compiler ! For it to work with the flang compiler we will need to address ! https://github.com/EnzymeAD/Enzyme/issues/2820 -module AD +module selectFirstForward implicit none interface subroutine selectFirst__enzyme_fwddiff(fnc, x, dx, y, dy) @@ -37,7 +37,7 @@ subroutine selectFirst(x, y) end module program app - use AD + use selectFirstForward, only: selectFirst, selectFirst__enzyme_fwddiff implicit none real, allocatable :: x(:), dx(:) real :: y, dy diff --git a/enzyme/test/Fortran/ReverseMode/allocatableArraySimple_with_bindings.f90 b/enzyme/test/Fortran/ReverseMode/allocatableArraySimple_with_bindings.f90 index 5c7da53c21c..96f436c53ff 100644 --- a/enzyme/test/Fortran/ReverseMode/allocatableArraySimple_with_bindings.f90 +++ b/enzyme/test/Fortran/ReverseMode/allocatableArraySimple_with_bindings.f90 @@ -1,31 +1,14 @@ ! REQUIRES: fortran -! RUN: if [[ %fc != ifx ]]; then %fc -flto -O0 -c %loadFortran %s -o /dev/stdout | %opt %loadEnzyme %enzyme -o /dev/stdout | %opt %oflags -O0 -S -o %t.ll && %fc -flto -O0 %t.ll -o %t1 && %t1 | FileCheck %s; fi -! RUN: %fc -flto -O1 -c %loadFortran %s -o /dev/stdout | %opt %loadEnzyme %enzyme -o /dev/stdout | %opt %oflags -O1 -S -o %t.ll && %fc -flto -O1 %t.ll -o %t1 && %t1 | FileCheck %s -! RUN: %fc -flto -O2 -c %loadFortran %s -o /dev/stdout | %opt %loadEnzyme %enzyme -o /dev/stdout | %opt %oflags -O2 -S -o %t.ll && %fc -flto -O2 %t.ll -o %t1 && %t1 | FileCheck %s -! RUN: %fc -flto -O3 -c %loadFortran %s -o /dev/stdout | %opt %loadEnzyme %enzyme -o /dev/stdout | %opt %oflags -O3 -S -o %t.ll && %fc -flto -O3 %t.ll -o %t1 && %t1 | FileCheck %s +! RUN: if [[ %fc != ifx ]]; then %fc -flto -O0 -c %loadFortran %s -o /dev/stdout | %opt %loadEnzyme %enzyme -o %t.ll && %fc -flto -O0 %t.ll -o %t1 && %t1 | FileCheck %s; fi +! RUN: %fc -flto -O1 -c %loadFortran %s -o /dev/stdout | %opt %loadEnzyme %enzyme -o %t.ll && %fc -flto -O1 %t.ll -o %t1 && %t1 | FileCheck %s +! RUN: %fc -flto -O2 -c %loadFortran %s -o /dev/stdout | %opt %loadEnzyme %enzyme -o %t.ll && %fc -flto -O2 %t.ll -o %t1 && %t1 | FileCheck %s +! RUN: %fc -flto -O3 -c %loadFortran %s -o /dev/stdout | %opt %loadEnzyme %enzyme -o %t.ll && %fc -flto -O3 %t.ll -o %t1 && %t1 | FileCheck %s ! NOTE: This test is only configured to run with the flang compiler at -O0 ! For it to work with the ifx compiler we will need to figure out how to ! handle the indirection involved in the enzyme_autodiff binding -module AD - implicit none - - contains - - ! TODO: Switch to assumed shape implementation once - ! https://github.com/EnzymeAD/Enzyme/issues/2820 - ! has been addressed - subroutine selectFirst(n, x, y) - integer, intent(in) :: n - real, intent(in) :: x(n) - real, intent(inout) :: y - y = x(1) - end subroutine -end module - program app - use AD, only: selectFirst use enzyme, only: enzyme_const, enzyme_dup, enzyme_autodiff implicit none integer :: n @@ -49,6 +32,19 @@ program app print *, int(dx(2)) print *, int(dx(3)) print *, int(dy) + +contains + + ! TODO: Switch to assumed shape implementation once + ! https://github.com/EnzymeAD/Enzyme/issues/2820 + ! has been addressed + subroutine selectFirst(n, x, y) + integer, intent(in) :: n + real, intent(in) :: x(n) + real, intent(inout) :: y + y = x(1) + end subroutine + end program diff --git a/enzyme/test/Fortran/ReverseMode/allocatableArraySimple_with_explicit_interface.f90 b/enzyme/test/Fortran/ReverseMode/allocatableArraySimple_with_explicit_interface.f90 index ae8fcc3b7fa..505bf69e5ea 100644 --- a/enzyme/test/Fortran/ReverseMode/allocatableArraySimple_with_explicit_interface.f90 +++ b/enzyme/test/Fortran/ReverseMode/allocatableArraySimple_with_explicit_interface.f90 @@ -1,15 +1,15 @@ ! REQUIRES: fortran ! REQUIRES: ifx -! RUN: %fc -flto -O0 -c %s -o /dev/stdout | %opt %loadEnzyme %enzyme -o /dev/stdout | %opt %oflags -O0 -S -o %t.ll && %fc -flto -O0 %t.ll -o %t1 && %t1 | FileCheck %s -! RUN: %fc -flto -O1 -c %s -o /dev/stdout | %opt %loadEnzyme %enzyme -o /dev/stdout | %opt %oflags -O1 -S -o %t.ll && %fc -flto -O1 %t.ll -o %t1 && %t1 | FileCheck %s -! RUN: %fc -flto -O2 -c %s -o /dev/stdout | %opt %loadEnzyme %enzyme -o /dev/stdout | %opt %oflags -O2 -S -o %t.ll && %fc -flto -O2 %t.ll -o %t1 && %t1 | FileCheck %s -! RUN: %fc -flto -O3 -c %s -o /dev/stdout | %opt %loadEnzyme %enzyme -o /dev/stdout | %opt %oflags -O3 -S -o %t.ll && %fc -flto -O3 %t.ll -o %t1 && %t1 | FileCheck %s +! RUN: %fc -flto -O0 -c %s -o /dev/stdout | %opt %loadEnzyme %enzyme -o %t.ll && %fc -flto -O0 %t.ll -o %t1 && %t1 | FileCheck %s +! RUN: %fc -flto -O1 -c %s -o /dev/stdout | %opt %loadEnzyme %enzyme -o %t.ll && %fc -flto -O1 %t.ll -o %t1 && %t1 | FileCheck %s +! RUN: %fc -flto -O2 -c %s -o /dev/stdout | %opt %loadEnzyme %enzyme -o %t.ll && %fc -flto -O2 %t.ll -o %t1 && %t1 | FileCheck %s +! RUN: %fc -flto -O3 -c %s -o /dev/stdout | %opt %loadEnzyme %enzyme -o %t.ll && %fc -flto -O3 %t.ll -o %t1 && %t1 | FileCheck %s ! NOTE: This test is only configured to run with the ifx compiler ! For it to work with the flang compiler we will need to address ! https://github.com/EnzymeAD/Enzyme/issues/2820 -module AD +module selectFirstReverse implicit none interface subroutine selectFirst__enzyme_autodiff(fnc, x, dx, y, dy) @@ -37,7 +37,7 @@ subroutine selectFirst(x, y) end module program app - use AD + use selectFirstReverse, only: selectFirst, selectFirst__enzyme_autodiff implicit none real, allocatable :: x(:), dx(:) real :: y, dy diff --git a/enzyme/test/Fortran/ReverseMode/square_with_bindings.f90 b/enzyme/test/Fortran/ReverseMode/square_with_bindings.f90 index 81dda4ad823..87e17180b6d 100644 --- a/enzyme/test/Fortran/ReverseMode/square_with_bindings.f90 +++ b/enzyme/test/Fortran/ReverseMode/square_with_bindings.f90 @@ -1,24 +1,15 @@ ! REQUIRES: fortran -! RUN: if [[ %fc != ifx ]]; then %fc -flto -O0 -c %loadFortran %s -o /dev/stdout | %opt %loadEnzyme %enzyme -o /dev/stdout | %opt %oflags -O0 -S -o %t.ll && %fc -flto -O0 %t.ll -o %t1 && %t1 | FileCheck %s; fi -! RUN: %fc -flto -O1 -c %loadFortran %s -o /dev/stdout | %opt %loadEnzyme %enzyme -o /dev/stdout | %opt %oflags -O1 -S -o %t.ll && %fc -flto -O1 %t.ll -o %t1 && %t1 | FileCheck %s -! RUN: %fc -flto -O2 -c %loadFortran %s -o /dev/stdout | %opt %loadEnzyme %enzyme -o /dev/stdout | %opt %oflags -O2 -S -o %t.ll && %fc -flto -O2 %t.ll -o %t1 && %t1 | FileCheck %s -! RUN: %fc -flto -O3 -c %loadFortran %s -o /dev/stdout | %opt %loadEnzyme %enzyme -o /dev/stdout | %opt %oflags -O3 -S -o %t.ll && %fc -flto -O3 %t.ll -o %t1 && %t1 | FileCheck %s +! RUN: if [[ %fc != ifx ]]; then %fc -flto -O0 -c %loadFortran %s -o /dev/stdout | %opt %loadEnzyme %enzyme -o %t.ll && %fc -flto -O0 %t.ll -o %t1 && %t1 | FileCheck %s; fi +! RUN: %fc -flto -O1 -c %loadFortran %s -o /dev/stdout | %opt %loadEnzyme %enzyme -o %t.ll && %fc -flto -O1 %t.ll -o %t1 && %t1 | FileCheck %s +! RUN: %fc -flto -O2 -c %loadFortran %s -o /dev/stdout | %opt %loadEnzyme %enzyme -o %t.ll && %fc -flto -O2 %t.ll -o %t1 && %t1 | FileCheck %s +! RUN: %fc -flto -O3 -c %loadFortran %s -o /dev/stdout | %opt %loadEnzyme %enzyme -o %t.ll && %fc -flto -O3 %t.ll -o %t1 && %t1 | FileCheck %s ! NOTE: This test is only configured to run with the flang compiler at -O0 ! For it to work with the ifx compiler we will need to figure out how to ! handle the indirection involved in the enzyme_autodiff binding -module math -contains - real function square( x ) - real, intent(in) :: x - square = x**2 - end function -end module math - program app use enzyme, only: enzyme_autodiff - use math, only: square implicit none real :: x, dx @@ -29,6 +20,14 @@ program app call enzyme_autodiff(square, x, dx) print *, dx + +contains + + real function square( x ) + real, intent(in) :: x + square = x**2 + end function + end program app ! CHECK: 9 diff --git a/enzyme/test/Fortran/ReverseMode/square_with_explicit_interface.f90 b/enzyme/test/Fortran/ReverseMode/square_with_explicit_interface.f90 index 0150e847a8c..47c4f29b5a0 100644 --- a/enzyme/test/Fortran/ReverseMode/square_with_explicit_interface.f90 +++ b/enzyme/test/Fortran/ReverseMode/square_with_explicit_interface.f90 @@ -1,10 +1,10 @@ ! REQUIRES: fortran -! RUN: %fc -flto -O0 -c %loadFortran %s -o /dev/stdout | %opt %loadEnzyme %enzyme -o /dev/stdout | %opt %oflags -O0 -S -o %t.ll && %fc -flto -O0 %t.ll -o %t1 && %t1 | FileCheck %s -! RUN: %fc -flto -O1 -c %loadFortran %s -o /dev/stdout | %opt %loadEnzyme %enzyme -o /dev/stdout | %opt %oflags -O1 -S -o %t.ll && %fc -flto -O1 %t.ll -o %t1 && %t1 | FileCheck %s -! RUN: %fc -flto -O2 -c %loadFortran %s -o /dev/stdout | %opt %loadEnzyme %enzyme -o /dev/stdout | %opt %oflags -O2 -S -o %t.ll && %fc -flto -O2 %t.ll -o %t1 && %t1 | FileCheck %s -! RUN: %fc -flto -O3 -c %loadFortran %s -o /dev/stdout | %opt %loadEnzyme %enzyme -o /dev/stdout | %opt %oflags -O3 -S -o %t.ll && %fc -flto -O3 %t.ll -o %t1 && %t1 | FileCheck %s +! RUN: %fc -flto -O0 -c %loadFortran %s -o /dev/stdout | %opt %loadEnzyme %enzyme -o %t.ll && %fc -flto -O0 %t.ll -o %t1 && %t1 | FileCheck %s +! RUN: %fc -flto -O1 -c %loadFortran %s -o /dev/stdout | %opt %loadEnzyme %enzyme -o %t.ll && %fc -flto -O1 %t.ll -o %t1 && %t1 | FileCheck %s +! RUN: %fc -flto -O2 -c %loadFortran %s -o /dev/stdout | %opt %loadEnzyme %enzyme -o %t.ll && %fc -flto -O2 %t.ll -o %t1 && %t1 | FileCheck %s +! RUN: %fc -flto -O3 -c %loadFortran %s -o /dev/stdout | %opt %loadEnzyme %enzyme -o %t.ll && %fc -flto -O3 %t.ll -o %t1 && %t1 | FileCheck %s -module math +module squareForward interface subroutine square__enzyme_autodiff(fn, x, dx) interface @@ -22,10 +22,10 @@ real function square( x ) real, intent(in) :: x square = x**2 end function -end module math +end module program app - use math + use squareForward, only: square, square__enzyme_autodiff implicit none real :: x, dx diff --git a/enzyme/test/lit.site.cfg.py.in b/enzyme/test/lit.site.cfg.py.in index 7451af860b5..bb7d494764f 100644 --- a/enzyme/test/lit.site.cfg.py.in +++ b/enzyme/test/lit.site.cfg.py.in @@ -126,10 +126,6 @@ config.substitutions.append(('%fc', config.fc)) if config.fc == "ifx": config.available_features.add('ifx') config.substitutions.append(('%loadFortran', '-I@ENZYME_BINARY_DIR@/modules')) -# LLVM 16 defaults to opaque pointer mode; IFX versions paired with LLVM 16 -# (e.g. ifx 2023.1.0) use an older LLVM backend that cannot parse `ptr`-typed IR. -# Pass -opaque-pointers=0 to keep typed-pointer IR when optimising after Enzyme. -config.substitutions.append(('%oflags', ('-opaque-pointers=0' if int(config.llvm_ver) == 16 else ''))) # Let the main config do the real work. cfgfile = "@ENZYME_SOURCE_DIR@/test/lit.cfg.py"