Skip to content

Commit

Permalink
Fix workflow + avoid one extreme test in VS <= 2017
Browse files Browse the repository at this point in the history
  • Loading branch information
auto-differentiation-dev committed Nov 29, 2024
1 parent 80415d1 commit 6f2df65
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 11 deletions.
20 changes: 10 additions & 10 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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: |
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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 }}
Expand Down Expand Up @@ -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 }}
Expand Down Expand Up @@ -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 }}
Expand Down
2 changes: 1 addition & 1 deletion cmake/XADSetupOptions.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
7 changes: 7 additions & 0 deletions test/Expressions_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<double> tape;
Expand All @@ -1708,6 +1713,8 @@ TEST(Expressions, canEvaluateLongExpressionsLikeHestonAdjoint)
EXPECT_THAT(dx, DoubleNear(dxd, 1e-5));
}

#endif

TEST(Expressions, canEvaluateLongExpressionsLikeHestonForward)
{
TestHeston<xad::FAD> tester;
Expand Down

0 comments on commit 6f2df65

Please sign in to comment.