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
1 change: 1 addition & 0 deletions components/omega/OmegaBuild.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ macro(common)
option(OMEGA_LOG_FLUSH "Turn on unbuffered logging (default OFF)." OFF)
option(OMEGA_TEST_CDASH "Turn on CDash support (default ON)." ON)
option(OMEGA_EXTERNAL_PROF "Integration of Omega timers with external profiling tools (default OFF)." OFF)
option(OMEGA_DISABLE_FP_CONTRACT "Disable floating point contraction on GPU architectures (default ON)." ON)

if("${OMEGA_BUILD_TYPE}" STREQUAL "Debug" OR "${OMEGA_BUILD_TYPE}" STREQUAL "DEBUG")
set(OMEGA_DEBUG ON)
Expand Down
19 changes: 19 additions & 0 deletions components/omega/src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,25 @@ target_compile_definitions(
OMEGA_VECTOR_LENGTH=${OMEGA_VECTOR_LENGTH}
)

# Disable floating point contraction (e.g. fused multiply-add) for GPU
# architectures. Needed for ERS and PEM test to pass COMPARE step.
# Controlled by OMEGA_DISABLE_FP_CONTRACT (default ON)
if (OMEGA_DISABLE_FP_CONTRACT)
if (OMEGA_ARCH STREQUAL "CUDA")
target_compile_options(OmegaLibFlags INTERFACE
$<$<COMPILE_LANGUAGE:CXX>:--fmad=false -Xcompiler -ffp-contract=off>
)
elseif (OMEGA_ARCH STREQUAL "HIP")
target_compile_options(OmegaLibFlags INTERFACE
$<$<COMPILE_LANGUAGE:CXX>:-ffp-contract=off>
)
elseif (OMEGA_ARCH STREQUAL "SYCL")
target_compile_options(OmegaLibFlags INTERFACE
$<$<COMPILE_LANGUAGE:CXX>:-fp-model=precise -ffp-contract=off>
)
endif()
endif()

if(OMEGA_SINGLE_PRECISION)
target_compile_definitions(
OmegaLibFlags
Expand Down
Loading