Skip to content

Commit 2490bba

Browse files
committed
Remove SIMDe and add Accelerate support to AVX math
1 parent 7463eca commit 2490bba

File tree

22 files changed

+496
-545606
lines changed

22 files changed

+496
-545606
lines changed

CMake/Common.cmake

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ endif (USE_DOUBLE_PRECISION)
1818

1919
cmake_dependent_option(USE_AVX "Use AVX" ON "NOT USE_DOUBLE_PRECISION" OFF)
2020
if (USE_AVX)
21-
message(STATUS "If your CPU does not support SIMD, turn off the USE_AVX flag.")
21+
message(STATUS "If your CPU does not support AVX or Accelerate, turn off the USE_AVX flag.")
2222
add_definitions(-DUSE_AVX)
2323
endif()
2424

@@ -94,8 +94,8 @@ if (UNIX OR MINGW)
9494
endif ()
9595
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG}")
9696
if (USE_AVX)
97-
if (CMAKE_SYSTEM_PROCESSOR STREQUAL "arm64")
98-
add_compile_options("-mcpu=native+fp+simd")
97+
if (APPLE)
98+
link_libraries("-framework Accelerate")
9999
else()
100100
add_compile_options("-mavx")
101101
add_compile_options("-mfma")

SPlisHSPlasH/Elasticity/Elasticity_Kugelstadt2021.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,10 +56,10 @@ namespace SPH
5656
#ifdef USE_AVX
5757
VectorXr m_rhs;
5858
VectorXr m_sol;
59-
std::vector<Scalarf8, AlignmentAllocator<Scalarf8, 32>> m_RHS;
60-
std::vector<Scalarf8, AlignmentAllocator<Scalarf8, 32>> m_f_avx;
61-
std::vector<Scalarf8, AlignmentAllocator<Scalarf8, 32>> m_sol_avx;
62-
std::vector<Quaternion8f, AlignmentAllocator<Quaternion8f, 32>> m_quats_avx;
59+
std::vector<Scalarf8, AlignmentAllocator<Scalarf8>> m_RHS;
60+
std::vector<Scalarf8, AlignmentAllocator<Scalarf8>> m_f_avx;
61+
std::vector<Scalarf8, AlignmentAllocator<Scalarf8>> m_sol_avx;
62+
std::vector<Quaternion8f, AlignmentAllocator<Quaternion8f>> m_quats_avx;
6363
#else
6464
std::vector<Vector3r, Eigen::aligned_allocator<Vector3r>> m_f;
6565
std::vector<Vector3r, Eigen::aligned_allocator<Vector3r>> m_sol;

0 commit comments

Comments
 (0)