فهرست منبع

Turn back on MacOS unit tests but without AVX2 (#84)

Jorrit Rouwe 3 سال پیش
والد
کامیت
88c230e1e6
4فایلهای تغییر یافته به همراه11 افزوده شده و 11 حذف شده
  1. 5 5
      .github/workflows/build.yml
  2. 2 2
      Jolt/Math/DVec3.h
  3. 2 2
      UnitTests/Math/DVec3Tests.cpp
  4. 2 2
      UnitTests/UnitTestFramework.h

+ 5 - 5
.github/workflows/build.yml

@@ -89,13 +89,13 @@ jobs:
     - name: Checkout Code
     - name: Checkout Code
       uses: actions/checkout@v2
       uses: actions/checkout@v2
     - name: Configure CMake
     - name: Configure CMake
-      run: cmake -B ${{github.workspace}}/Build/MacOS_${{matrix.build_type}}_${{matrix.clang_version}} -DCMAKE_BUILD_TYPE=${{matrix.build_type}} -DCMAKE_CXX_COMPILER=${{matrix.clang_version}} Build
+      # github macos-latest runs on a 2013 Ivy Bridge CPU so doesn't have AVX2, LZCNT, TZCNT or FMADD
+      run: cmake -B ${{github.workspace}}/Build/MacOS_${{matrix.build_type}}_${{matrix.clang_version}} -DCMAKE_BUILD_TYPE=${{matrix.build_type}} -DCMAKE_CXX_COMPILER=${{matrix.clang_version}} -DUSE_AVX2=OFF -DUSE_LZCNT=OFF -DUSE_TZCNT=OFF -DUSE_FMADD=OFF Build
     - name: Build
     - name: Build
       run: cmake --build ${{github.workspace}}/Build/MacOS_${{matrix.build_type}}_${{matrix.clang_version}} --config ${{matrix.build_type}}
       run: cmake --build ${{github.workspace}}/Build/MacOS_${{matrix.build_type}}_${{matrix.clang_version}} --config ${{matrix.build_type}}
-# Disabled unit tests, they work on a Mac Mini 2014 but not in a github action for some reason
-#    - name: Test
-#      working-directory: ${{github.workspace}}/Build/MacOS_${{matrix.build_type}}_${{matrix.clang_version}}
-#      run: ctest --output-on-failure
+    - name: Test
+      working-directory: ${{github.workspace}}/Build/MacOS_${{matrix.build_type}}_${{matrix.clang_version}}
+      run: ctest --output-on-failure
 
 
   android:
   android:
     runs-on: ubuntu-latest
     runs-on: ubuntu-latest

+ 2 - 2
Jolt/Math/DVec3.h

@@ -5,7 +5,7 @@
 
 
 #include <Math/Swizzle.h>
 #include <Math/Swizzle.h>
 
 
-#ifdef JPH_USE_AVX // DVec3 currently uses AVX intrinsics but the class is currently unused so we can leave it out (it will be used in the future to support objects at a large distance from the origin)
+#ifdef JPH_USE_AVX2 // DVec3 currently uses AVX2 intrinsics but the class is currently unused so we can leave it out (it will be used in the future to support objects at a large distance from the origin)
 
 
 namespace JPH {
 namespace JPH {
 
 
@@ -218,4 +218,4 @@ static_assert(is_trivial<DVec3>(), "Is supposed to be a trivial type!");
 
 
 #include "DVec3.inl"
 #include "DVec3.inl"
 
 
-#endif // JPH_USE_AVX
+#endif // JPH_USE_AVX2

+ 2 - 2
UnitTests/Math/DVec3Tests.cpp

@@ -4,7 +4,7 @@
 #include "UnitTestFramework.h"
 #include "UnitTestFramework.h"
 #include <Math/DVec3.h>
 #include <Math/DVec3.h>
 
 
-#ifdef JPH_USE_AVX
+#ifdef JPH_USE_AVX2
 
 
 TEST_SUITE("DVec3Tests")
 TEST_SUITE("DVec3Tests")
 {
 {
@@ -50,4 +50,4 @@ TEST_SUITE("DVec3Tests")
 	}
 	}
 }
 }
 
 
-#endif // JPH_USE_AVX
+#endif // JPH_USE_AVX2

+ 2 - 2
UnitTests/UnitTestFramework.h

@@ -38,14 +38,14 @@ inline void CHECK_APPROX_EQUAL(QuatArg inLHS, QuatArg inRHS, float inTolerance =
 	CHECK(close);
 	CHECK(close);
 }
 }
 
 
-#ifdef JPH_USE_AVX
+#ifdef JPH_USE_AVX2
 
 
 inline void CHECK_APPROX_EQUAL(DVec3Arg inLHS, DVec3Arg inRHS, double inTolerance = 1.0e-6)
 inline void CHECK_APPROX_EQUAL(DVec3Arg inLHS, DVec3Arg inRHS, double inTolerance = 1.0e-6)
 {
 {
 	CHECK(inLHS.IsClose(inRHS, inTolerance * inTolerance));
 	CHECK(inLHS.IsClose(inRHS, inTolerance * inTolerance));
 }
 }
 
 
-#endif // JPH_USE_AVX
+#endif // JPH_USE_AVX2
 
 
 inline void CHECK_APPROX_EQUAL(const Float2 &inLHS, const Float2 &inRHS, float inTolerance = 1.0e-6f)
 inline void CHECK_APPROX_EQUAL(const Float2 &inLHS, const Float2 &inRHS, float inTolerance = 1.0e-6f)
 {
 {