From 6f2df6588c1a4aa3cc0b0bec49840ed5d9161c60 Mon Sep 17 00:00:00 2001 From: Auto Differentiation Dev Team <107129969+auto-differentiation-dev@users.noreply.github.com> Date: Fri, 29 Nov 2024 14:48:11 +0000 Subject: [PATCH] Fix workflow + avoid one extreme test in VS <= 2017 --- .github/workflows/ci.yml | 20 ++++++++++---------- cmake/XADSetupOptions.cmake | 2 +- test/Expressions_test.cpp | 7 +++++++ 3 files changed, 18 insertions(+), 11 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b3bae95a..c8163171 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -96,9 +96,9 @@ jobs: ctest --no-compress-output --output-on-failure -j3 --output-junit test_results.xml - name: upload test results if: always() - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: - name: Test Results (windows ${{ matrix.compiler }}-${{ matrix.toolset }}-${{ matrix.config }}-${{ matrix.memory }}) + name: Test Results (windows ${{ matrix.compiler }}-${{ matrix.toolset }}-${{ matrix.config }}-${{ matrix.memory }}-${{ matrix.standard }}) path: build/test_results.xml - name: install shell: cmd @@ -210,9 +210,9 @@ jobs: ctest --no-compress-output --output-on-failure --parallel $(($(nproc) + 2)) --output-junit test_results.xml - name: upload test results if: always() - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: - name: Test Results (linux ${{ matrix.compiler }}-${{ matrix.config }}-${{ matrix.reuse_slots }}-${{ matrix.memory }}) + name: Test Results (linux ${{ matrix.compiler }}-${{ matrix.config }}-${{ matrix.reuse_slots }}-${{ matrix.memory }}-${{ matrix.standard }}) path: build/test_results.xml - name: install run: | @@ -295,7 +295,7 @@ jobs: - name: ccache uses: hendrikmuhs/ccache-action@v1.2.10 with: - key: linux-gcc${{ matrix.version }}-${{ matrix.config }}-${{ matrix.reuse_slots }}-${{ matrix.memory }} + key: linux-gcc${{ matrix.version }}-${{ matrix.config }}-${{ matrix.reuse_slots }}-${{ matrix.memory }}-${{ matrix.standard }} - name: configure run: | mkdir build @@ -324,9 +324,9 @@ jobs: ctest --no-compress-output --output-on-failure --parallel $(($(nproc) + 2)) --output-junit test_results.xml - name: upload test results if: always() - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: - name: Test Results (linux ${{ matrix.compiler }}-${{ matrix.config }}-${{ matrix.reuse_slots }}-${{ matrix.memory }}) + name: Test Results (linux ${{ matrix.compiler }}-${{ matrix.config }}-${{ matrix.reuse_slots }}-${{ matrix.memory }}-${{ matrix.standard }}) path: ${{ env.GITHUB_WORKSPACE }}/build/test_results.xml - name: coverage tests if: ${{ matrix.coverage }} @@ -450,9 +450,9 @@ jobs: ctest --no-compress-output --output-on-failure -j$(sysctl -n hw.ncpu) --output-junit test_results.xml - name: upload test results if: always() - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: - name: Test Results (macos ${{ matrix.config }}-${{ matrix.compiler }}-${{ matrix.standard }}-${{ matrix.memory }}) + name: Test Results (macos ${{ matrix.config }}-${{ matrix.compiler }}-${{ matrix.standard }}-${{ matrix.memory }}-${{ matrix.standard }}) path: build/test_results.xml - name: coverage tests if: ${{ matrix.coverage }} @@ -506,7 +506,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Upload - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: Event File path: ${{ github.event_path }} diff --git a/cmake/XADSetupOptions.cmake b/cmake/XADSetupOptions.cmake index 1c98eaa1..ebd58150 100644 --- a/cmake/XADSetupOptions.cmake +++ b/cmake/XADSetupOptions.cmake @@ -64,7 +64,7 @@ endif() option(XAD_TAPE_REUSE_SLOTS "Reuse slots in tape that have become free (slower, less memory)" OFF) option(XAD_NO_THREADLOCAL "Disable thread-local tape - only for single-threaded tape use" OFF) if (MSVC AND MSVC_VERSION GREATER_EQUAL 1910) - option(XAD_USE_STRONG_INLINE "Use forced inlining for higher preformance, at a higher compile time cost" OFF) + option(XAD_USE_STRONG_INLINE "Use forced inlining for higher performance, at a higher compile time cost" OFF) else() # in VS 2015, without strong inlining, some long expressions in release mode get miscompiled set(XAD_USE_STRONG_INLINE ON CACHE BOOL "Use forced inlining for higher preformance, at a higher compile time cost" FORCE) diff --git a/test/Expressions_test.cpp b/test/Expressions_test.cpp index b664c53a..3a558f36 100644 --- a/test/Expressions_test.cpp +++ b/test/Expressions_test.cpp @@ -1683,6 +1683,11 @@ struct TestHeston } }; + +#if !defined(_MSC_VER) || (_MSC_VER > 1920) +// only build this with Visual Studio newer than 2017, as older versions struggle +// and miscompile these expressions in Release mode + TEST(Expressions, canEvaluateLongExpressionsLikeHestonAdjoint) { xad::Tape tape; @@ -1708,6 +1713,8 @@ TEST(Expressions, canEvaluateLongExpressionsLikeHestonAdjoint) EXPECT_THAT(dx, DoubleNear(dxd, 1e-5)); } +#endif + TEST(Expressions, canEvaluateLongExpressionsLikeHestonForward) { TestHeston tester;