27 #ifndef NON_PUBLIC_LBANN_SRC_LAYERS_MATRIX_BUILDER_INCLUDED 28 #define NON_PUBLIC_LBANN_SRC_LAYERS_MATRIX_BUILDER_INCLUDED 34 #include <type_traits> 40 template <
bool B,
typename T,
typename F>
41 using IfThenElse =
typename std::conditional<B, T, F>::type;
64 template <
typename T, data_layout L, El::Device D>
70 El::DistMatrix<T, El::STAR, El::VC, El::ELEMENT, D>,
71 El::DistMatrix<T, El::MC, El::MR, El::ELEMENT, D>>;
73 #if defined(HYDROGEN_HAVE_GPU) && defined(HYDROGEN_HAVE_CUB) 75 static constexpr
unsigned memory_mode_ = 1U;
76 #elif defined(HYDROGEN_HAVE_GPU) 78 static constexpr
unsigned memory_mode_ = (D == El::Device::CPU ? 1U : 0U);
81 static constexpr
unsigned memory_mode_ =
82 El::DefaultMemoryMode<El::Device::CPU>();
83 #endif // defined(HYDROGEN_HAVE_GPU) && defined(HYDROGEN_HAVE_CUB) 92 auto ret = std::make_unique<concrete_matrix_type>(g, root);
93 ret->Matrix().SetMemoryMode(memory_mode_);
102 auto ret = this->MakeEmpty(g, root);
103 ret->Resize(height, width);
111 #endif // NON_PUBLIC_LBANN_SRC_LAYERS_MATRIX_BUILDER_INCLUDED meta::IfThenElse< L==data_layout::DATA_PARALLEL, El::DistMatrix< T, El::STAR, El::VC, El::ELEMENT, D >, El::DistMatrix< T, El::MC, El::MR, El::ELEMENT, D > > concrete_matrix_type
std::unique_ptr< matrix_type > matrix_ptr_type
matrix_ptr_type MakeEmpty(El::Grid const &g, El::Int root) const final
matrix_ptr_type MakeWithSize(El::Grid const &g, El::Int root, size_type height, size_type width) const final
El::AbstractDistMatrix< T > matrix_type