Loading cmake/dca_config.cmake +15 −14 Original line number Diff line number Diff line Loading @@ -251,16 +251,6 @@ if (DCA_WITH_QMC_BIT) dca_add_config_define(DCA_WITH_QMC_BIT) endif() ################################################################################ # Single precision measurements # TODO: maybe change to ON by default. option(DCA_WITH_SINGLE_PRECISION_TP_MEASUREMENTS "Measure in single precision." OFF) mark_as_advanced(DCA_WITH_SINGLE_PRECISION_TP_MEASUREMENTS) if (DCA_WITH_SINGLE_PRECISION_TP_MEASUREMENTS) dca_add_config_define(DCA_WITH_SINGLE_PRECISION_TP_MEASUREMENTS) endif() ################################################################################ # Gnuplot option(DCA_WITH_GNUPLOT "Enable Gnuplot." OFF) Loading @@ -283,7 +273,7 @@ else() endif() ################################################################################ # Accumulation options. # MC options. option(DCA_WITH_MEMORY_SAVINGS "Save memory in the two particle accumulation at a slight performance cost." OFF) mark_as_advanced(DCA_WITH_MEMORY_SAVINGS) Loading @@ -293,12 +283,23 @@ else() set(MEMORY_SAVINGS false) endif() if (DCA_WITH_SINGLE_PRECISION_MEASUREMENTS) option(DCA_WITH_SINGLE_PRECISION_MC "Perform Monte Carlo and measurements in single precision." OFF) option(DCA_WITH_SINGLE_PRECISION_TP_MEASUREMENTS "Measure two particle function in single precision." OFF) if (DCA_WITH_SINGLE_PRECISION_MC) set(DCA_WITH_SINGLE_PRECISION_TP_MEASUREMENTS ON CACHE BOOL "Measure two particle function in single precision." FORCE) set(MC_SCALAR float) else() set(MC_SCALAR double) endif() if (DCA_WITH_SINGLE_PRECISION_TP_MEASUREMENTS) set(TP_ACCUMULATION_SCALAR float) else() set(TP_ACCUMULATION_SCALAR double) endif() option(DCA_WITH_MANAGED_MEMORY "Use managed memory allocator." OFF) mark_as_advanced(DCA_WITH_MANAGED_MEMORY) if (DCA_WITH_MANAGED_MEMORY) Loading @@ -307,8 +308,8 @@ else() set(TWO_PARTICLE_ALLOCATOR "dca::linalg::util::DeviceAllocator<T>") endif() configure_file("${PROJECT_SOURCE_DIR}/include/dca/config/accumulation_options.hpp.in" "${CMAKE_BINARY_DIR}/include/dca/config/accumulation_options.hpp" @ONLY) configure_file("${PROJECT_SOURCE_DIR}/include/dca/config/mc_options.hpp.in" "${CMAKE_BINARY_DIR}/include/dca/config/mc_options.hpp" @ONLY) ################################################################################ Loading include/dca/config/cmake_options.hpp +1 −0 Original line number Diff line number Diff line Loading @@ -40,6 +40,7 @@ struct CMakeOptions { static const std::string dca_profiler; static const std::string dca_with_autotuning; static const std::string dca_with_gnuplot; static const std::string dca_with_single_precision_mc; static const std::string dca_with_single_precision_tp_measurements; static const std::string dca_with_memory_savings; static const std::string dca_with_managed_memory; Loading include/dca/config/accumulation_options.hpp.in→include/dca/config/mc_options.hpp.in +8 −7 Original line number Diff line number Diff line Loading @@ -9,20 +9,21 @@ // // This class stores compile time options for the MC accumulation. #ifndef DCA_CONFIG_ACCUMULATION_OPTIONS_HPP #define DCA_CONFIG_ACCUMULATION_OPTIONS_HPP #ifndef DCA_CONFIG_MC_OPTIONS_HPP #define DCA_CONFIG_MC_OPTIONS_HPP #ifdef DCA_HAVE_CUDA #include "dca/linalg/util/allocators/device_allocator.hpp" #include "dca/linalg/util/allocators/managed_allocator.hpp" #endif // DCA_HAVE_CUDA namespace dca { namespace config { // dca::config:: struct AccumulationOptions { struct McOptions { using MCScalar = @MC_SCALAR@; using TPAccumulationScalar = @TP_ACCUMULATION_SCALAR@; static constexpr bool memory_savings = @MEMORY_SAVINGS@; Loading @@ -33,7 +34,7 @@ struct AccumulationOptions { #endif // DCA_HAVE_CUDA }; } // config } // dca } // namespace config } // namespace dca #endif // DCA_CONFIG_ACCUMULATION_OPTIONS_HPP #endif // DCA_CONFIG_MC_OPTIONS_HPP include/dca/function/function.hpp +14 −0 Original line number Diff line number Diff line Loading @@ -77,6 +77,8 @@ public: // the other function's construction. // Postcondition: The function's name is unchanged. function<scalartype, domain>& operator=(const function<scalartype, domain>& other); template <typename Scalar2> function<scalartype, domain>& operator=(const function<Scalar2, domain>& other); // Move assignment operator // Replaces the function's elements with those of other using move semantics. Loading Loading @@ -345,6 +347,18 @@ function<scalartype, domain>& function<scalartype, domain>::operator=( return *this; } template <typename Scalar, class domain> template <typename Scalar2> function<Scalar, domain>& function<Scalar, domain>::operator=(const function<Scalar2, domain>& other) { if (size() != other.size()) { throw(std::logic_error("Function size does not match.")); } std::copy_n(other.values(), Nb_elements, fnc_values); return *this; } template <typename scalartype, class domain> function<scalartype, domain>& function<scalartype, domain>::operator=( function<scalartype, domain>&& other) { Loading include/dca/linalg/util/handle_functions.hpp +1 −1 Original line number Diff line number Diff line Loading @@ -38,7 +38,7 @@ inline std::vector<CublasHandle>& getHandleContainer() { // Creates max_threads cublas handles and at least max_threads * // StreamContainer::streams_per_thread_ cuda streams. inline void resizeHandleContainer(const int max_threads) { inline void resizeHandleContainer(const std::size_t max_threads) { if (getStreamContainer().get_max_threads() < max_threads) resizeStreamContainer(max_threads); Loading Loading
cmake/dca_config.cmake +15 −14 Original line number Diff line number Diff line Loading @@ -251,16 +251,6 @@ if (DCA_WITH_QMC_BIT) dca_add_config_define(DCA_WITH_QMC_BIT) endif() ################################################################################ # Single precision measurements # TODO: maybe change to ON by default. option(DCA_WITH_SINGLE_PRECISION_TP_MEASUREMENTS "Measure in single precision." OFF) mark_as_advanced(DCA_WITH_SINGLE_PRECISION_TP_MEASUREMENTS) if (DCA_WITH_SINGLE_PRECISION_TP_MEASUREMENTS) dca_add_config_define(DCA_WITH_SINGLE_PRECISION_TP_MEASUREMENTS) endif() ################################################################################ # Gnuplot option(DCA_WITH_GNUPLOT "Enable Gnuplot." OFF) Loading @@ -283,7 +273,7 @@ else() endif() ################################################################################ # Accumulation options. # MC options. option(DCA_WITH_MEMORY_SAVINGS "Save memory in the two particle accumulation at a slight performance cost." OFF) mark_as_advanced(DCA_WITH_MEMORY_SAVINGS) Loading @@ -293,12 +283,23 @@ else() set(MEMORY_SAVINGS false) endif() if (DCA_WITH_SINGLE_PRECISION_MEASUREMENTS) option(DCA_WITH_SINGLE_PRECISION_MC "Perform Monte Carlo and measurements in single precision." OFF) option(DCA_WITH_SINGLE_PRECISION_TP_MEASUREMENTS "Measure two particle function in single precision." OFF) if (DCA_WITH_SINGLE_PRECISION_MC) set(DCA_WITH_SINGLE_PRECISION_TP_MEASUREMENTS ON CACHE BOOL "Measure two particle function in single precision." FORCE) set(MC_SCALAR float) else() set(MC_SCALAR double) endif() if (DCA_WITH_SINGLE_PRECISION_TP_MEASUREMENTS) set(TP_ACCUMULATION_SCALAR float) else() set(TP_ACCUMULATION_SCALAR double) endif() option(DCA_WITH_MANAGED_MEMORY "Use managed memory allocator." OFF) mark_as_advanced(DCA_WITH_MANAGED_MEMORY) if (DCA_WITH_MANAGED_MEMORY) Loading @@ -307,8 +308,8 @@ else() set(TWO_PARTICLE_ALLOCATOR "dca::linalg::util::DeviceAllocator<T>") endif() configure_file("${PROJECT_SOURCE_DIR}/include/dca/config/accumulation_options.hpp.in" "${CMAKE_BINARY_DIR}/include/dca/config/accumulation_options.hpp" @ONLY) configure_file("${PROJECT_SOURCE_DIR}/include/dca/config/mc_options.hpp.in" "${CMAKE_BINARY_DIR}/include/dca/config/mc_options.hpp" @ONLY) ################################################################################ Loading
include/dca/config/cmake_options.hpp +1 −0 Original line number Diff line number Diff line Loading @@ -40,6 +40,7 @@ struct CMakeOptions { static const std::string dca_profiler; static const std::string dca_with_autotuning; static const std::string dca_with_gnuplot; static const std::string dca_with_single_precision_mc; static const std::string dca_with_single_precision_tp_measurements; static const std::string dca_with_memory_savings; static const std::string dca_with_managed_memory; Loading
include/dca/config/accumulation_options.hpp.in→include/dca/config/mc_options.hpp.in +8 −7 Original line number Diff line number Diff line Loading @@ -9,20 +9,21 @@ // // This class stores compile time options for the MC accumulation. #ifndef DCA_CONFIG_ACCUMULATION_OPTIONS_HPP #define DCA_CONFIG_ACCUMULATION_OPTIONS_HPP #ifndef DCA_CONFIG_MC_OPTIONS_HPP #define DCA_CONFIG_MC_OPTIONS_HPP #ifdef DCA_HAVE_CUDA #include "dca/linalg/util/allocators/device_allocator.hpp" #include "dca/linalg/util/allocators/managed_allocator.hpp" #endif // DCA_HAVE_CUDA namespace dca { namespace config { // dca::config:: struct AccumulationOptions { struct McOptions { using MCScalar = @MC_SCALAR@; using TPAccumulationScalar = @TP_ACCUMULATION_SCALAR@; static constexpr bool memory_savings = @MEMORY_SAVINGS@; Loading @@ -33,7 +34,7 @@ struct AccumulationOptions { #endif // DCA_HAVE_CUDA }; } // config } // dca } // namespace config } // namespace dca #endif // DCA_CONFIG_ACCUMULATION_OPTIONS_HPP #endif // DCA_CONFIG_MC_OPTIONS_HPP
include/dca/function/function.hpp +14 −0 Original line number Diff line number Diff line Loading @@ -77,6 +77,8 @@ public: // the other function's construction. // Postcondition: The function's name is unchanged. function<scalartype, domain>& operator=(const function<scalartype, domain>& other); template <typename Scalar2> function<scalartype, domain>& operator=(const function<Scalar2, domain>& other); // Move assignment operator // Replaces the function's elements with those of other using move semantics. Loading Loading @@ -345,6 +347,18 @@ function<scalartype, domain>& function<scalartype, domain>::operator=( return *this; } template <typename Scalar, class domain> template <typename Scalar2> function<Scalar, domain>& function<Scalar, domain>::operator=(const function<Scalar2, domain>& other) { if (size() != other.size()) { throw(std::logic_error("Function size does not match.")); } std::copy_n(other.values(), Nb_elements, fnc_values); return *this; } template <typename scalartype, class domain> function<scalartype, domain>& function<scalartype, domain>::operator=( function<scalartype, domain>&& other) { Loading
include/dca/linalg/util/handle_functions.hpp +1 −1 Original line number Diff line number Diff line Loading @@ -38,7 +38,7 @@ inline std::vector<CublasHandle>& getHandleContainer() { // Creates max_threads cublas handles and at least max_threads * // StreamContainer::streams_per_thread_ cuda streams. inline void resizeHandleContainer(const int max_threads) { inline void resizeHandleContainer(const std::size_t max_threads) { if (getStreamContainer().get_max_threads() < max_threads) resizeStreamContainer(max_threads); Loading