From cd8445891115859673db708c9bfa703ee4dd8f6f Mon Sep 17 00:00:00 2001 From: PrimedErwin <1973609350@qq.com> Date: Wed, 21 May 2025 21:51:41 +0800 Subject: [PATCH] add determinism float flag to all platforms on test --- .github/workflows/main.yml | 6 +++--- CMakeLists.txt | 3 --- src/modules/vmath.c | 4 ++-- 3 files changed, 5 insertions(+), 8 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 6097f98a..a0e2cd11 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -36,7 +36,7 @@ jobs: shell: bash run: | mkdir -p output/x86_64 - python cmake_build.py Release -DPK_BUILD_MODULE_LZ4=ON + python cmake_build.py Release -DPK_BUILD_MODULE_LZ4=ON -DPK_ENABLE_DETERMINISTIC_FLOAT=ON cp main.exe output/x86_64 cp pocketpy.dll output/x86_64 - uses: actions/upload-artifact@v4 @@ -70,7 +70,7 @@ jobs: run: | python scripts/check_pragma_once.py include mkdir -p output/x86_64 - python cmake_build.py Release -DPK_BUILD_MODULE_LZ4=ON + python cmake_build.py Release -DPK_BUILD_MODULE_LZ4=ON -DPK_ENABLE_DETERMINISTIC_FLOAT=ON python scripts/run_tests.py cp main output/x86_64 cp libpocketpy.so output/x86_64 @@ -90,7 +90,7 @@ jobs: submodules: true - name: Compile and Test run: | - python cmake_build.py Release -DPK_BUILD_MODULE_LZ4=ON + python cmake_build.py Release -DPK_BUILD_MODULE_LZ4=ON -DPK_ENABLE_DETERMINISTIC_FLOAT=ON python scripts/run_tests.py - name: Benchmark run: python scripts/run_tests.py benchmark diff --git a/CMakeLists.txt b/CMakeLists.txt index a5f44f8a..73231325 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -113,9 +113,6 @@ if(PK_BUILD_WITH_UNITY) endif() ############################################ -if(NOT MSVC) - target_link_libraries(${PROJECT_NAME} pthread) -endif() if(PK_BUILD_MODULE_LZ4) target_link_libraries(${PROJECT_NAME} lz4) diff --git a/src/modules/vmath.c b/src/modules/vmath.c index 18132e7c..8f0d3992 100644 --- a/src/modules/vmath.c +++ b/src/modules/vmath.c @@ -579,8 +579,8 @@ static bool inverse(const c11_mat3x3* m, c11_mat3x3* restrict out) { } static void trs(c11_vec2 t, float r, c11_vec2 s, c11_mat3x3* restrict out) { - float cr = cosf(r); - float sr = sinf(r); + float cr = cos(r); + float sr = sin(r); // clang-format off *out = (c11_mat3x3){ ._11 = s.x * cr, ._12 = -s.y * sr, ._13 = t.x,