Loading cmake/dca_config.cmake +9 −0 Original line number Diff line number Diff line Loading @@ -270,6 +270,7 @@ endif() # Accumulation 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) if (DCA_WITH_MEMORY_SAVINGS) set(MEMORY_SAVINGS true) else() Loading @@ -282,6 +283,14 @@ else() set(MC_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) set(TWO_PARTICLE_ALLOCATOR "dca::linalg::util::ManagedAllocator<T>") 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) Loading cmake/dca_cuda.cmake +1 −0 Original line number Diff line number Diff line Loading @@ -19,6 +19,7 @@ if (CUDA_FOUND) # dca_add_haves_define(DCA_HAVE_CUDA) list(APPEND DCA_CUDA_LIBS ${CUDA_LIBRARIES} ${CUDA_cusparse_LIBRARY} ${CUDA_cublas_LIBRARY}) CUDA_INCLUDE_DIRECTORIES(${CUDA_INCLUDE_DIRS}) set(CUDA_SEPARABLE_COMPILATION ON) endif() # Find MAGMA. Loading include/dca/config/accumulation_options.hpp.in +14 −3 Original line number Diff line number Diff line Loading @@ -9,8 +9,14 @@ // // This class stores compile time options for the MC accumulation. #ifndef DCA_CONFIG_ACCUMULATON_OPTIONS_HPP #define DCA_CONFIG_ACCUMULATON_OPTIONS_HPP #ifndef DCA_CONFIG_ACCUMULATION_OPTIONS_HPP #define DCA_CONFIG_ACCUMULATION_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 { Loading @@ -20,9 +26,14 @@ struct AccumulationOptions { using MCAccumulationScalar = @MC_ACCUMULATION_SCALAR@; static constexpr bool memory_savings = @MEMORY_SAVINGS@; #ifdef DCA_HAVE_CUDA template <typename T> using TpAllocator = @TWO_PARTICLE_ALLOCATOR@; #endif // DCA_HAVE_CUDA }; } // config } // dca #endif // DCA_CONFIG_ACCUMULATON_OPTIONS_HPP #endif // DCA_CONFIG_ACCUMULATION_OPTIONS_HPP include/dca/config/cmake_options.hpp +3 −2 Original line number Diff line number Diff line Loading @@ -43,13 +43,14 @@ struct CMakeOptions { static const std::string dca_with_reduced_vertex_function; static const std::string dca_with_single_precision_measurements; static const std::string dca_with_memory_savings; static const std::string dca_with_managed_memory; static const std::string dca_with_qmc_bit; static void print(); }; } // config } // dca } // namespace config } // namespace dca #endif // DCA_CONFIG_CMAKE_OPTIONS_HPP include/dca/linalg/vector.hpp +3 −2 Original line number Diff line number Diff line Loading @@ -38,6 +38,7 @@ class Vector : public Allocator { public: using ThisType = Vector<ScalarType, device_name, Allocator>; using ValueType = ScalarType; using AllocatorType = Allocator; Vector(); Vector(const std::string& name); Loading Loading @@ -405,7 +406,7 @@ std::size_t Vector<ScalarType, device_name, Allocator>::deviceFingerprint() cons return device_name == GPU ? capacity_ * sizeof(ScalarType) : 0; } } // linalg } // dca } // namespace linalg } // namespace dca #endif // DCA_LINALG_VECTOR_HPP Loading
cmake/dca_config.cmake +9 −0 Original line number Diff line number Diff line Loading @@ -270,6 +270,7 @@ endif() # Accumulation 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) if (DCA_WITH_MEMORY_SAVINGS) set(MEMORY_SAVINGS true) else() Loading @@ -282,6 +283,14 @@ else() set(MC_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) set(TWO_PARTICLE_ALLOCATOR "dca::linalg::util::ManagedAllocator<T>") 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) Loading
cmake/dca_cuda.cmake +1 −0 Original line number Diff line number Diff line Loading @@ -19,6 +19,7 @@ if (CUDA_FOUND) # dca_add_haves_define(DCA_HAVE_CUDA) list(APPEND DCA_CUDA_LIBS ${CUDA_LIBRARIES} ${CUDA_cusparse_LIBRARY} ${CUDA_cublas_LIBRARY}) CUDA_INCLUDE_DIRECTORIES(${CUDA_INCLUDE_DIRS}) set(CUDA_SEPARABLE_COMPILATION ON) endif() # Find MAGMA. Loading
include/dca/config/accumulation_options.hpp.in +14 −3 Original line number Diff line number Diff line Loading @@ -9,8 +9,14 @@ // // This class stores compile time options for the MC accumulation. #ifndef DCA_CONFIG_ACCUMULATON_OPTIONS_HPP #define DCA_CONFIG_ACCUMULATON_OPTIONS_HPP #ifndef DCA_CONFIG_ACCUMULATION_OPTIONS_HPP #define DCA_CONFIG_ACCUMULATION_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 { Loading @@ -20,9 +26,14 @@ struct AccumulationOptions { using MCAccumulationScalar = @MC_ACCUMULATION_SCALAR@; static constexpr bool memory_savings = @MEMORY_SAVINGS@; #ifdef DCA_HAVE_CUDA template <typename T> using TpAllocator = @TWO_PARTICLE_ALLOCATOR@; #endif // DCA_HAVE_CUDA }; } // config } // dca #endif // DCA_CONFIG_ACCUMULATON_OPTIONS_HPP #endif // DCA_CONFIG_ACCUMULATION_OPTIONS_HPP
include/dca/config/cmake_options.hpp +3 −2 Original line number Diff line number Diff line Loading @@ -43,13 +43,14 @@ struct CMakeOptions { static const std::string dca_with_reduced_vertex_function; static const std::string dca_with_single_precision_measurements; static const std::string dca_with_memory_savings; static const std::string dca_with_managed_memory; static const std::string dca_with_qmc_bit; static void print(); }; } // config } // dca } // namespace config } // namespace dca #endif // DCA_CONFIG_CMAKE_OPTIONS_HPP
include/dca/linalg/vector.hpp +3 −2 Original line number Diff line number Diff line Loading @@ -38,6 +38,7 @@ class Vector : public Allocator { public: using ThisType = Vector<ScalarType, device_name, Allocator>; using ValueType = ScalarType; using AllocatorType = Allocator; Vector(); Vector(const std::string& name); Loading Loading @@ -405,7 +406,7 @@ std::size_t Vector<ScalarType, device_name, Allocator>::deviceFingerprint() cons return device_name == GPU ? capacity_ * sizeof(ScalarType) : 0; } } // linalg } // dca } // namespace linalg } // namespace dca #endif // DCA_LINALG_VECTOR_HPP