Loading src/TNL/Experimental/Arithmetics/CMakeLists.txt +6 −7 Original line number Diff line number Diff line Loading @@ -5,8 +5,8 @@ set( headers FlopsCounter.h Quad_impl.h # Modified by D. Simon Real.h MultiPrecision.h #Added by D. Simon Double.h #Added by D. Simon Double_impl.h #Added by D. Simon #Double.h #Added by D. Simon #Double_impl.h #Added by D. Simon ) SET( CURRENT_DIR ${CMAKE_SOURCE_DIR}/src/TNL/Experimental/Arithmetics ) Loading @@ -18,5 +18,4 @@ set( tnl_experimental_arithmetics_SOURCES set( tnl_experimental_arithmetics_CUDA__SOURCES ) # INSTALL( FILES ${headers} DESTINATION include/tnl-${tnlVersion}/TNL/Experimental/Arithmetics ) old INSTALL( FILES ${headers} DESTINATION ${TNL_TARGET_INCLUDE_DIRECTORY}/Experimental/Arithmetics ) src/TNL/Experimental/Arithmetics/MultiPrecision.h +5 −3 Original line number Diff line number Diff line Loading @@ -24,7 +24,6 @@ public: MultiPrecision(); // initialize number to 0 explicit MultiPrecision(int); // assignment of signed long integer explicit MultiPrecision(double d); // assignment of double /// TODO Constructor for Quad /* OPERATORS */ MultiPrecision& operator=(const MultiPrecision& mp); Loading @@ -38,7 +37,6 @@ public: MultiPrecision operator*(const MultiPrecision& mp) const; MultiPrecision operator/(const MultiPrecision& mp) const; bool operator==(const MultiPrecision &mp) const; /// TODO Operator for comparing Quad and MultiPrecision bool operator!=(const MultiPrecision &mp) const; bool operator<(const MultiPrecision &mp) const; bool operator>(const MultiPrecision &mp) const; Loading @@ -61,5 +59,9 @@ public: ~MultiPrecision(); }; MultiPrecision abs(const MultiPrecision); MultiPrecision sqrt(const MultiPrecision); MultiPrecision cqrt(const MultiPrecision; } // namespace Arithmetics } // namespace TNL src/TNL/Experimental/Arithmetics/Quad_impl.h +2 −2 Original line number Diff line number Diff line Loading @@ -414,7 +414,7 @@ void quickTwoSum(T a, T b, T *s, T *e) { template <typename T> void twoSum(T a, T b, T *s, T *e) { *s = a + b; double v = *s - a; T v = *s - a; *e = (a - (*s - v)) + (b - v); } Loading src/TNL/Experimental/Arithmetics/UnitTests/CMakeLists.txt +18 −11 Original line number Diff line number Diff line # ADD_EXECUTABLE( QuadTest${mpiExt}${debugExt} QuadTest.cpp ) # TARGET_COMPILE_OPTIONS( QuadTest${mpiExt}${debugExt} PRIVATE ${CXX_TESTS_FLAGS} ) # TARGET_LINK_LIBRARIES( QuadTest${mpiExt}${debugExt} # ${GTEST_BOTH_LIBRARIES} # tnl${mpiExt}${debugExt}-${tnlVersion} ) ADD_EXECUTABLE( MultiPrecisionTest${debugExt} MultiPrecisionTest.cpp ../MultiPrecision.cpp ) TARGET_COMPILE_OPTIONS( MultiPrecisionTest${debugExt} PRIVATE ${CXX_TESTS_FLAGS} ) TARGET_LINK_LIBRARIES( MultiPrecisionTest${debugExt} ADD_EXECUTABLE( MultiPrecisionTest MultiPrecisionTest.cpp ) TARGET_COMPILE_OPTIONS( MultiPrecisionTest PRIVATE ${CXX_TESTS_FLAGS} ) TARGET_LINK_LIBRARIES( MultiPrecisionTest ${GTEST_BOTH_LIBRARIES} ${GMP_LIBRARIES} tnl ) # ADD_TEST( QuadTest${mpiExt}${debugExt} ${EXECUTABLE_OUTPUT_PATH}/QuadTest${mpiExt}${debugExt} ) ADD_TEST( MultiPrecisionTest${debugExt} ${EXECUTABLE_OUTPUT_PATH}/MultiPrecisionTest${debugExt} ) No newline at end of file #ADD_EXECUTABLE( QuadTest QuadTest.cpp ) #TARGET_COMPILE_OPTIONS( QuadTest PRIVATE ${CXX_TESTS_FLAGS} ) #TARGET_LINK_LIBRARIES( QuadTest # ${GTEST_BOTH_LIBRARIES} # tnl ) #ADD_EXECUTABLE( DoubleTest DoubleTest.cpp ) #TARGET_COMPILE_OPTIONS( DoubleTest PRIVATE ${CXX_TESTS_FLAGS} ) #TARGET_LINK_LIBRARIES( DoubleTest # ${GTEST_BOTH_LIBRARIES} # tnl ) ADD_TEST( MultiPrecisionTest ${EXECUTABLE_OUTPUT_PATH}/MultiPrecisionTest${CMAKE_EXECUTABLE_SUFFIX} ) #ADD_TEST( QuadTest ${EXECUTABLE_OUTPUT_PATH}/QuadTest${CMAKE_EXECUTABLE_SUFFIX} ) #ADD_TEST( DoubleTest ${EXECUTABLE_OUTPUT_PATH}/DoubleTest${CMAKE_EXECUTABLE_SUFFIX} ) src/UnitTests/Containers/VectorTest.h +23 −2 Original line number Diff line number Diff line Loading @@ -15,6 +15,8 @@ #ifdef HAVE_GTEST #include <limits> #include <TNL/Experimental/Arithmetics/MultiPrecision.h> #include <TNL/Experimental/Arithmetics/Quad.h> #include <TNL/Containers/Vector.h> #include <TNL/File.h> #include <TNL/Math.h> Loading @@ -23,6 +25,7 @@ using namespace TNL; using namespace TNL::Containers; using namespace TNL::Arithmetics; using namespace TNL::Containers::Algorithms; // should be small enough to have fast tests, but larger than minGPUReductionDataSize Loading Loading @@ -86,29 +89,47 @@ using VectorTypes = ::testing::Types< Vector< int, Devices::Host, short >, Vector< long, Devices::Host, short >, Vector< float, Devices::Host, short >, Vector< Quad<float>, Devices::Host, short>, Vector< double, Devices::Host, short >, Vector< Quad<double>, Devices::Host, short >, Vector< MultiPrecision, Devices::Host, short >, Vector< int, Devices::Host, int >, Vector< long, Devices::Host, int >, Vector< float, Devices::Host, int >, Vector< Quad<float>, Devices::Host, int>, Vector< double, Devices::Host, int >, Vector< Quad<double>, Devices::Host, int>, Vector< MultiPrecision, Devices::Host, int >, Vector< int, Devices::Host, long >, Vector< long, Devices::Host, long >, Vector< float, Devices::Host, long >, Vector< double, Devices::Host, long > Vector< Quad<float>, Devices::Host, long>, Vector< double, Devices::Host, long >, Vector< Quad<double>, Devices::Host, long>, Vector< MultiPrecision, Devices::Host, long > #ifdef HAVE_CUDA , Vector< int, Devices::Cuda, short >, Vector< long, Devices::Cuda, short >, Vector< float, Devices::Cuda, short >, Vector< Quad<float>, Devices::Cuda, short>, Vector< double, Devices::Cuda, short >, Vector< Quad<double>, Devices::Cuda, short>, Vector< MultiPrecision, Devices::Cuda, short>, Vector< int, Devices::Cuda, int >, Vector< long, Devices::Cuda, int >, Vector< float, Devices::Cuda, int >, Vector< Quad<float>, Devices::Cuda, int>, Vector< double, Devices::Cuda, int >, Vector< Quad<double>, Devices::Cuda, int>, Vector< MultiPrecision, Devices::Cuda, int>, Vector< int, Devices::Cuda, long >, Vector< long, Devices::Cuda, long >, Vector< float, Devices::Cuda, long >, Vector< double, Devices::Cuda, long > Vector< Quad<float>, Devices::Cuda, long>, Vector< double, Devices::Cuda, long >, Vector< Quad<double>, Devices::Cuda, long>, Vector< MultiPrecision, Devices::Host, long > #endif #ifdef HAVE_MIC , Loading Loading
src/TNL/Experimental/Arithmetics/CMakeLists.txt +6 −7 Original line number Diff line number Diff line Loading @@ -5,8 +5,8 @@ set( headers FlopsCounter.h Quad_impl.h # Modified by D. Simon Real.h MultiPrecision.h #Added by D. Simon Double.h #Added by D. Simon Double_impl.h #Added by D. Simon #Double.h #Added by D. Simon #Double_impl.h #Added by D. Simon ) SET( CURRENT_DIR ${CMAKE_SOURCE_DIR}/src/TNL/Experimental/Arithmetics ) Loading @@ -18,5 +18,4 @@ set( tnl_experimental_arithmetics_SOURCES set( tnl_experimental_arithmetics_CUDA__SOURCES ) # INSTALL( FILES ${headers} DESTINATION include/tnl-${tnlVersion}/TNL/Experimental/Arithmetics ) old INSTALL( FILES ${headers} DESTINATION ${TNL_TARGET_INCLUDE_DIRECTORY}/Experimental/Arithmetics )
src/TNL/Experimental/Arithmetics/MultiPrecision.h +5 −3 Original line number Diff line number Diff line Loading @@ -24,7 +24,6 @@ public: MultiPrecision(); // initialize number to 0 explicit MultiPrecision(int); // assignment of signed long integer explicit MultiPrecision(double d); // assignment of double /// TODO Constructor for Quad /* OPERATORS */ MultiPrecision& operator=(const MultiPrecision& mp); Loading @@ -38,7 +37,6 @@ public: MultiPrecision operator*(const MultiPrecision& mp) const; MultiPrecision operator/(const MultiPrecision& mp) const; bool operator==(const MultiPrecision &mp) const; /// TODO Operator for comparing Quad and MultiPrecision bool operator!=(const MultiPrecision &mp) const; bool operator<(const MultiPrecision &mp) const; bool operator>(const MultiPrecision &mp) const; Loading @@ -61,5 +59,9 @@ public: ~MultiPrecision(); }; MultiPrecision abs(const MultiPrecision); MultiPrecision sqrt(const MultiPrecision); MultiPrecision cqrt(const MultiPrecision; } // namespace Arithmetics } // namespace TNL
src/TNL/Experimental/Arithmetics/Quad_impl.h +2 −2 Original line number Diff line number Diff line Loading @@ -414,7 +414,7 @@ void quickTwoSum(T a, T b, T *s, T *e) { template <typename T> void twoSum(T a, T b, T *s, T *e) { *s = a + b; double v = *s - a; T v = *s - a; *e = (a - (*s - v)) + (b - v); } Loading
src/TNL/Experimental/Arithmetics/UnitTests/CMakeLists.txt +18 −11 Original line number Diff line number Diff line # ADD_EXECUTABLE( QuadTest${mpiExt}${debugExt} QuadTest.cpp ) # TARGET_COMPILE_OPTIONS( QuadTest${mpiExt}${debugExt} PRIVATE ${CXX_TESTS_FLAGS} ) # TARGET_LINK_LIBRARIES( QuadTest${mpiExt}${debugExt} # ${GTEST_BOTH_LIBRARIES} # tnl${mpiExt}${debugExt}-${tnlVersion} ) ADD_EXECUTABLE( MultiPrecisionTest${debugExt} MultiPrecisionTest.cpp ../MultiPrecision.cpp ) TARGET_COMPILE_OPTIONS( MultiPrecisionTest${debugExt} PRIVATE ${CXX_TESTS_FLAGS} ) TARGET_LINK_LIBRARIES( MultiPrecisionTest${debugExt} ADD_EXECUTABLE( MultiPrecisionTest MultiPrecisionTest.cpp ) TARGET_COMPILE_OPTIONS( MultiPrecisionTest PRIVATE ${CXX_TESTS_FLAGS} ) TARGET_LINK_LIBRARIES( MultiPrecisionTest ${GTEST_BOTH_LIBRARIES} ${GMP_LIBRARIES} tnl ) # ADD_TEST( QuadTest${mpiExt}${debugExt} ${EXECUTABLE_OUTPUT_PATH}/QuadTest${mpiExt}${debugExt} ) ADD_TEST( MultiPrecisionTest${debugExt} ${EXECUTABLE_OUTPUT_PATH}/MultiPrecisionTest${debugExt} ) No newline at end of file #ADD_EXECUTABLE( QuadTest QuadTest.cpp ) #TARGET_COMPILE_OPTIONS( QuadTest PRIVATE ${CXX_TESTS_FLAGS} ) #TARGET_LINK_LIBRARIES( QuadTest # ${GTEST_BOTH_LIBRARIES} # tnl ) #ADD_EXECUTABLE( DoubleTest DoubleTest.cpp ) #TARGET_COMPILE_OPTIONS( DoubleTest PRIVATE ${CXX_TESTS_FLAGS} ) #TARGET_LINK_LIBRARIES( DoubleTest # ${GTEST_BOTH_LIBRARIES} # tnl ) ADD_TEST( MultiPrecisionTest ${EXECUTABLE_OUTPUT_PATH}/MultiPrecisionTest${CMAKE_EXECUTABLE_SUFFIX} ) #ADD_TEST( QuadTest ${EXECUTABLE_OUTPUT_PATH}/QuadTest${CMAKE_EXECUTABLE_SUFFIX} ) #ADD_TEST( DoubleTest ${EXECUTABLE_OUTPUT_PATH}/DoubleTest${CMAKE_EXECUTABLE_SUFFIX} )
src/UnitTests/Containers/VectorTest.h +23 −2 Original line number Diff line number Diff line Loading @@ -15,6 +15,8 @@ #ifdef HAVE_GTEST #include <limits> #include <TNL/Experimental/Arithmetics/MultiPrecision.h> #include <TNL/Experimental/Arithmetics/Quad.h> #include <TNL/Containers/Vector.h> #include <TNL/File.h> #include <TNL/Math.h> Loading @@ -23,6 +25,7 @@ using namespace TNL; using namespace TNL::Containers; using namespace TNL::Arithmetics; using namespace TNL::Containers::Algorithms; // should be small enough to have fast tests, but larger than minGPUReductionDataSize Loading Loading @@ -86,29 +89,47 @@ using VectorTypes = ::testing::Types< Vector< int, Devices::Host, short >, Vector< long, Devices::Host, short >, Vector< float, Devices::Host, short >, Vector< Quad<float>, Devices::Host, short>, Vector< double, Devices::Host, short >, Vector< Quad<double>, Devices::Host, short >, Vector< MultiPrecision, Devices::Host, short >, Vector< int, Devices::Host, int >, Vector< long, Devices::Host, int >, Vector< float, Devices::Host, int >, Vector< Quad<float>, Devices::Host, int>, Vector< double, Devices::Host, int >, Vector< Quad<double>, Devices::Host, int>, Vector< MultiPrecision, Devices::Host, int >, Vector< int, Devices::Host, long >, Vector< long, Devices::Host, long >, Vector< float, Devices::Host, long >, Vector< double, Devices::Host, long > Vector< Quad<float>, Devices::Host, long>, Vector< double, Devices::Host, long >, Vector< Quad<double>, Devices::Host, long>, Vector< MultiPrecision, Devices::Host, long > #ifdef HAVE_CUDA , Vector< int, Devices::Cuda, short >, Vector< long, Devices::Cuda, short >, Vector< float, Devices::Cuda, short >, Vector< Quad<float>, Devices::Cuda, short>, Vector< double, Devices::Cuda, short >, Vector< Quad<double>, Devices::Cuda, short>, Vector< MultiPrecision, Devices::Cuda, short>, Vector< int, Devices::Cuda, int >, Vector< long, Devices::Cuda, int >, Vector< float, Devices::Cuda, int >, Vector< Quad<float>, Devices::Cuda, int>, Vector< double, Devices::Cuda, int >, Vector< Quad<double>, Devices::Cuda, int>, Vector< MultiPrecision, Devices::Cuda, int>, Vector< int, Devices::Cuda, long >, Vector< long, Devices::Cuda, long >, Vector< float, Devices::Cuda, long >, Vector< double, Devices::Cuda, long > Vector< Quad<float>, Devices::Cuda, long>, Vector< double, Devices::Cuda, long >, Vector< Quad<double>, Devices::Cuda, long>, Vector< MultiPrecision, Devices::Host, long > #endif #ifdef HAVE_MIC , Loading