LBANN  0.103.0
LivermoreBigArtificialNeuralNetworkToolkit
tensor_impl.hpp File Reference
#include "lbann/utils/tensor.hpp"
#include "lbann_config.hpp"
#include <El/blas_like/level1/Copy/Translate.hpp>
#include <El/blas_like/level1/Copy/TranslateBetweenGrids.hpp>
#include "lbann/macros/instantiate_device.hpp"
Include dependency graph for tensor_impl.hpp:

Go to the source code of this file.

Namespaces

 lbann
 

Macros

#define PROTO_MATRIX_TYPE(T, ColDist, RowDist, Device)
 
#define PROTO_DEVICE(T, Device)
 

Functions

template<typename TDT >
void lbann::do_tensor_copy (const BaseDistMat &src, El::AbstractDistMatrix< TDT > &tgt)
 Function to efficiently select the best method for copying between two distributed tensors. Enable selection between synchronous and asynchronous copies based on tensor distribution and pre-processing macros. More...
 
template<typename TDT >
void lbann::view_or_copy_tensor (const BaseDistMat &src, El::AbstractDistMatrix< TDT > &tgt, bool locked_view=true)
 If distributed tensors have the same distribution setup the target to use a view to the source tensor, otherwise copy the src to target. More...
 

Macro Definition Documentation

◆ PROTO_DEVICE

#define PROTO_DEVICE (   T,
  Device 
)
Value:
PROTO_MATRIX_TYPE(T, El::STAR, El::VC, Device) \
PROTO_MATRIX_TYPE(T, El::MC, El::MR, Device) \
PROTO_MATRIX_TYPE(T, El::STAR, El::STAR, Device)
constexpr El::Device Device
#define PROTO_MATRIX_TYPE(T, ColDist, RowDist, Device)

◆ PROTO_MATRIX_TYPE

#define PROTO_MATRIX_TYPE (   T,
  ColDist,
  RowDist,
  Device 
)
Value:
if constexpr (std::is_same<T, TDT>::value) { \
if (tgt_dist.colDist == ColDist && tgt_dist.rowDist == RowDist && \
tgt_dist.device == Device) { \
using TgtMatrixType = \
El::DistMatrix<T, ColDist, RowDist, El::ELEMENT, Device>; \
src, \
dynamic_cast<TgtMatrixType&>(tgt)); \
did_copy = true; \
} \
}
constexpr El::Device Device
void do_tensor_copy_between_grids(const BaseDistMat &src, El::AbstractDistMatrix< TDT > &tgt)
Copy between two tensors on different process grids.
Definition: tensor_impl.hpp:66