Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 16 additions & 5 deletions stark/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,27 @@ if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE Release CACHE STRING "Choose the type of build (Debug or Release)" FORCE)
endif()

# Option to disable AVX for ARM-based devices
set(STARK_ENABLE_AVX2 ON CACHE BOOL "Flag to enable AVX for Stark and its dependencies")
# SIMD options
set(STARK_ENABLE_AVX2 "AUTO" CACHE STRING "Enable AVX2+FMA SIMD: AUTO, ON, or OFF. AUTO enables on x86/x86_64/AMD64.")
set_property(CACHE STARK_ENABLE_AVX2 PROPERTY STRINGS "AUTO" "ON" "OFF")
string(TOUPPER "${STARK_ENABLE_AVX2}" _STARK_AVX2)
if(NOT _STARK_AVX2 MATCHES "^(AUTO|ON|OFF)$")
message(FATAL_ERROR "STARK_ENABLE_AVX2 must be AUTO, ON, or OFF (got: ${STARK_ENABLE_AVX2})")
endif()
if(_STARK_AVX2 STREQUAL "AUTO")
if(CMAKE_SYSTEM_PROCESSOR MATCHES "^(x86_64|X86_64|amd64|AMD64|i[3-6]86)$")
set(_STARK_AVX2 "ON")
else()
set(_STARK_AVX2 "OFF")
endif()
endif()
message(STATUS "Stark: AVX2 = ${_STARK_AVX2} (STARK_ENABLE_AVX2=${STARK_ENABLE_AVX2}, processor=${CMAKE_SYSTEM_PROCESSOR})")

# If AVX is disabled for stark, disable it for all dependencies that use AVX
if(NOT ${STARK_ENABLE_AVX2})
set(SYMX_ENABLE_AVX OFF CACHE BOOL "Flag to enable AVX for symx" FORCE)
set(SYMX_ENABLE_AVX2 OFF CACHE BOOL "Flag to enable AVX for symx" FORCE)
set(TMCD_ENABLE_AVX2 OFF CACHE BOOL "Flag to enable AVX for tmcd" FORCE)
endif()


# Parallel compilation in MSVC
if (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
add_compile_options("/MP")
Expand Down
2 changes: 1 addition & 1 deletion stark/src/core/Stark.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ bool Stark::run_one_step()

this->dt /= 2.0;
if (this->dt < this->settings.simulation.time_step_size_lower_bound) {
output->print_with_new_line(fmt::format("Adaptive time step size out of bounds ({:.e}). Exiting simulation.\n", this->settings.simulation.time_step_size_lower_bound), Verbosity::Summary);
output->print_with_new_line(fmt::format("Adaptive time step size out of bounds ({:e}). Exiting simulation.\n", this->settings.simulation.time_step_size_lower_bound), Verbosity::Summary);
return false; // Not successful, not taken, and should not retry (exit simulation)
}
}
Expand Down