Skip to content
Closed
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
7 changes: 7 additions & 0 deletions math/mathcore/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -190,4 +190,11 @@ ROOT_STANDARD_LIBRARY_PACKAGE(MathCore

target_link_libraries(MathCore PRIVATE ${CMAKE_THREAD_LIBS_INIT})

# Force remove FMA on RISC-V
if(CMAKE_SYSTEM_PROCESSOR MATCHES "riscv64|riscv")
if(CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang")
target_compile_options(MathCore PRIVATE -ffp-contract=off)
Comment thread
hrw marked this conversation as resolved.
endif()
endif()

ROOT_ADD_TEST_SUBDIRECTORY(test)
3 changes: 2 additions & 1 deletion math/mathcore/test/stress/testGenVector.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,8 @@ TYPED_TEST_P(GenVectorTest, TestGenVectors)
scale = this->fDim * 20;
if (this->fDim == 3 && this->V2Name() == "RhoEtaPhiVector") scale *= 12; // for problem with RhoEtaPhi
if (this->fDim == 4 && ( this->V2Name() == "PtEtaPhiMVector" || this->V2Name() == "PxPyPzMVector")) {
#if (defined(__arm__) || defined(__arm64__) || defined(__aarch64__) || defined(__s390x__) || defined(__FMA__))
#if (defined(__arm__) || defined(__arm64__) || defined(__aarch64__) || defined(__s390x__) || defined(__FMA__)) || \
defined(__riscv)
scale *= 1.E7;
#else
scale *= 10;
Expand Down
7 changes: 7 additions & 0 deletions math/matrix/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -82,5 +82,12 @@ ROOT_STANDARD_LIBRARY_PACKAGE(Matrix
-writeEmptyRootPCM
)

# Force remove FMA on RISC-V
if(CMAKE_SYSTEM_PROCESSOR MATCHES "riscv64|riscv")
if(CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang")
target_compile_options(Matrix PRIVATE -ffp-contract=off)
endif()
endif()

ROOT_ADD_TEST_SUBDIRECTORY(test)

6 changes: 6 additions & 0 deletions math/matrix/test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,11 @@
#For the list of contributors see $ROOTSYS / README / CREDITS.

ROOT_ADD_GTEST(testMatrixTSparse testMatrixTSparse.cxx LIBRARIES Matrix)
# Disable FMA on RISC-V to avoid 1-ULP differences between sparse and dense paths
if(CMAKE_SYSTEM_PROCESSOR MATCHES "riscv64|riscv")
if(CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang")
target_compile_options(testMatrixTSparse PRIVATE -ffp-contract=off)
endif()
endif()
ROOT_ADD_GTEST(testMatrixTDecomp testMatrixTDecomp.cxx LIBRARIES Matrix)
ROOT_ADD_GTEST(testMatrixT testMatrixT.cxx LIBRARIES Matrix)
3 changes: 2 additions & 1 deletion test/stressMathCore.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -1113,7 +1113,8 @@ int testVector(int ngen, bool testio=false) {
scale = Dim*20;
if (Dim==3 && VecType<V2>::name() == "RhoEtaPhiVector") scale *= 12; // for problem with RhoEtaPhi
if (Dim==4 && ( VecType<V2>::name() == "PtEtaPhiMVector" || VecType<V2>::name() == "PxPyPzMVector")) {
#if (defined(__arm__) || defined(__arm64__) || defined(__aarch64__) || defined(__s390x__) || defined(__FMA__))
#if (defined(__arm__) || defined(__arm64__) || defined(__aarch64__) || defined(__s390x__) || defined(__FMA__)) || \
defined(__riscv)
scale *= 1.E7;
#else
scale *= 10;
Expand Down
Loading