Skip to content

Commit 7d703b0

Browse files
authored
Merge branch 'master' into add_monopole_work_aggregation
2 parents aaf27b9 + f42d82d commit 7d703b0

File tree

2 files changed

+13
-6
lines changed

2 files changed

+13
-6
lines changed

CMakeLists.txt

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ set(OCTOTIGER_CUDA_ARCH "sm_50"
8585

8686
set(OCTOTIGER_KOKKOS_SIMD_LIBRARY "KOKKOS" CACHE STRING "Choose either KOKKOS (for kokkos simd types) or STD (for std::experimental::simd.")
8787
set(OCTOTIGER_KOKKOS_SIMD_EXTENSION "DISCOVER" CACHE STRING "Choose either AVX512 AVX2 VSX NEON SVE SCALAR or DISCOVER (automatic discovery)")
88+
set(OCTOTIGER_SVE_LEN "512" CACHE STRING "Choose number of bits for SVE (must be 128, 256 or 512)")
8889

8990
# silence warnings for deprecated HPX includes
9091
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-cpp")
@@ -166,6 +167,7 @@ FetchContent_Declare(
166167
GIT_TAG c845b7d9d8da461457cc5aa88fdda5923773a4bf
167168
)
168169
FetchContent_MakeAvailable(kokkossimd)
170+
set(SVE_LENGTH ${OCTOTIGER_SVE_LEN})
169171
FetchContent_Declare(
170172
svesimd
171173
GIT_REPOSITORY https://github.com/srinivasyadav18/sve.git
@@ -825,10 +827,14 @@ elseif(${OCTOTIGER_KOKKOS_SIMD_EXTENSION} STREQUAL SVE)
825827
if(OCTOTIGER_WITH_CXX17)
826828
message(FATAL_ERROR "SVE builds with std::experimental::simd require C++20. Please set OCTOTIGER_WITH_CXX20=ON")
827829
endif()
828-
target_compile_definitions(octotiger PUBLIC SVE_LEN=512)
829-
target_compile_definitions(optionslib PUBLIC SVE_LEN=512)
830-
target_compile_definitions(octolib PUBLIC SVE_LEN=512)
831-
target_compile_definitions(hydrolib PUBLIC SVE_LEN=512)
830+
target_compile_definitions(octotiger PUBLIC SVE_LEN=${OCTOTIGER_SVE_LEN})
831+
target_compile_definitions(optionslib PUBLIC SVE_LEN=${OCTOTIGER_SVE_LEN})
832+
target_compile_definitions(octolib PUBLIC SVE_LEN=${OCTOTIGER_SVE_LEN})
833+
target_compile_definitions(hydrolib PUBLIC SVE_LEN=${OCTOTIGER_SVE_LEN})
834+
target_compile_options(hydrolib PUBLIC "-msve-vector-bits=${OCTOTIGER_SVE_LEN}")
835+
target_compile_options(octolib PUBLIC "-msve-vector-bits=${OCTOTIGER_SVE_LEN}")
836+
target_compile_options(optionslib PUBLIC "-msve-vector-bits=${OCTOTIGER_SVE_LEN}")
837+
target_compile_options(octotiger PUBLIC "-msve-vector-bits=${OCTOTIGER_SVE_LEN}")
832838
endif()
833839
elseif(${OCTOTIGER_KOKKOS_SIMD_EXTENSION} STREQUAL SCALAR)
834840
message(STATUS "KOKKOS SIMD extension manually set to SCALAR (SIMD is OFF)")

octotiger/common_kernel/std_simd.hpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,9 @@ static_assert(host_simd_mask_t::size() == 2);
5151
namespace SIMD_NAMESPACE = sve::experimental::parallelism_v2;
5252
using host_simd_t = sve::experimental::native_simd<double>;
5353
using host_simd_mask_t = sve::experimental::native_simd_mask<double>;
54-
static_assert(host_simd_t::size() == 8);
55-
static_assert(host_simd_mask_t::size() == 8);
54+
static_assert(host_simd_t::size() == 8 || host_simd_t::size() == 4 || host_simd_t::size() == 2);
55+
static_assert(host_simd_mask_t::size() == 8 || host_simd_mask_t::size() == 4 ||
56+
host_simd_mask_t::size() == 2);
5657
#elif defined(OCTOTIGER_KOKKOS_SIMD_VSX)
5758
#if !(defined(__VSX__)
5859
#error "VSX Kokkos kernels are specified explicitly but build is without VSX support."

0 commit comments

Comments
 (0)