LBANN  0.103.0
LivermoreBigArtificialNeuralNetworkToolkit
base.hpp File Reference
#include <El.hpp>
#include "lbann_config.hpp"
#include "lbann/Elemental_extensions.hpp"
#include "lbann/utils/enum_iterator.hpp"
#include "lbann/utils/file_utils.hpp"
#include "lbann/utils/omp_pragma.hpp"
#include <functional>
#include <iostream>
#include <memory>
#include <string>
Include dependency graph for base.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

 lbann
 

Macros

#define LBANN_PRINT_MATRIX_DIMS(x)   print_matrix_dims(x, #x);
 
#define LBANN_PRINT_LOCAL_MATRIX_DIMS(x)   print_local_matrix_dims(x, #x);
 
#define LBANN_MAKE_STR_(x)   #x
 
#define LBANN_MAKE_STR(x)   LBANN_MAKE_STR_(x)
 

Typedefs

template<typename T >
using lbann::observer_ptr = typename std::add_pointer< T >::type
 Creating an observer_ptr to complement the unique_ptr and shared_ptr. More...
 
using lbann::world_comm_ptr = std::unique_ptr< lbann_comm, std::function< void(lbann_comm *)> >
 
using lbann::AbsMat = El::AbstractMatrix< DataType >
 
using lbann::CPUMat = El::Matrix< DataType, El::Device::CPU >
 
using lbann::AbsDistMat = El::AbstractDistMatrix< DataType >
 
using lbann::BaseDistMat = El::BaseDistMatrix
 
using lbann::EGrid = El::Grid
 
using lbann::Grid = El::Grid
 
template<El::Device D>
using lbann::DMat = El::Matrix< DataType, D >
 
template<El::Device D>
using lbann::AbsDistMatReadProxy = El::AbstractDistMatrixReadDeviceProxy< DataType, D >
 
using lbann::ElMat = El::ElementalMatrix< DataType >
 
using lbann::BlockMat = El::BlockMatrix< DataType >
 
template<typename TensorDataType >
using lbann::CPUMatDT = El::Matrix< TensorDataType, El::Device::CPU >
 
template<typename TensorDataType , El::Device D>
using lbann::MCMRMatDT = El::DistMatrix< TensorDataType, El::MC, El::MR, El::ELEMENT, D >
 
template<typename TensorDataType , El::Device D>
using lbann::CircMatDT = El::DistMatrix< TensorDataType, El::CIRC, El::CIRC, El::ELEMENT, D >
 
template<typename TensorDataType , El::Device D>
using lbann::StarMatDT = El::DistMatrix< TensorDataType, El::STAR, El::STAR, El::ELEMENT, D >
 
template<typename TensorDataType , El::Device D>
using lbann::StarVCMatDT = El::DistMatrix< TensorDataType, El::STAR, El::VC, El::ELEMENT, D >
 
template<typename TensorDataType , El::Device D>
using lbann::VCStarMatDT = El::DistMatrix< TensorDataType, El::VC, El::STAR, El::ELEMENT, D >
 
template<typename TensorDataType , El::Device D>
using lbann::MCStarMatDT = El::DistMatrix< TensorDataType, El::MC, El::STAR, El::ELEMENT, D >
 ColSumStarVCMat. More...
 
template<typename TensorDataType , El::Device D>
using lbann::MRStarMatDT = El::DistMatrix< TensorDataType, El::MR, El::STAR, El::ELEMENT, D >
 RowSumMat. More...
 
template<typename TensorDataType , El::Device D>
using lbann::StarMRMatDT = El::DistMatrix< TensorDataType, El::STAR, El::MR, El::ELEMENT, D >
 ColSumMat. More...
 
template<typename TensorDataType >
using lbann::DistMatDT = MCMRMatDT< TensorDataType, El::Device::CPU >
 
template<El::Device D>
using lbann::MCMRMat = MCMRMatDT< DataType, D >
 
template<El::Device D>
using lbann::CircMat = CircMatDT< DataType, D >
 
template<El::Device D>
using lbann::StarMat = StarMatDT< DataType, D >
 
template<El::Device D>
using lbann::StarVCMat = StarVCMatDT< DataType, D >
 
template<El::Device D>
using lbann::VCStarMat = VCStarMatDT< DataType, D >
 
template<El::Device D>
using lbann::MCStarMat = MCStarMatDT< DataType, D >
 ColSumStarVCMat. More...
 
template<El::Device D>
using lbann::MRStarMat = MRStarMatDT< DataType, D >
 RowSumMat. More...
 
template<El::Device D>
using lbann::StarMRMat = StarMRMatDT< DataType, D >
 ColSumMat. More...
 
using lbann::DistMat = MCMRMat< El::Device::CPU >
 
using lbann::Mat = El::Matrix< DataType, El::Device::CPU >
 
using lbann::EvalType = double
 
using lbann::execution_mode_iterator = enum_iterator< execution_mode, execution_mode::training, execution_mode::invalid >
 

Enumerations

enum  lbann::matrix_format {
  lbann::matrix_format::MC_MR, lbann::matrix_format::CIRC_CIRC, lbann::matrix_format::STAR_STAR, lbann::matrix_format::STAR_VC,
  lbann::matrix_format::MC_STAR, lbann::matrix_format::invalid
}
 Distributed matrix format. More...
 
enum  lbann::BackpropRequirements {
  lbann::PROPAGATE_NOTHING = 0, lbann::ERROR_SIGNALS = 1, lbann::PREV_ACTIVATIONS = 2, lbann::ACTIVATIONS = 4,
  lbann::WEIGHTS = 8
}
 Backpropagation requirements from a layer or operator. More...
 
enum  lbann::data_layout { lbann::data_layout::MODEL_PARALLEL, lbann::data_layout::DATA_PARALLEL, lbann::data_layout::invalid }
 Data layout that is optimized for different modes of parallelism. More...
 
enum  lbann::execution_mode {
  lbann::execution_mode::training, lbann::execution_mode::validation, lbann::execution_mode::testing, lbann::execution_mode::prediction,
  lbann::execution_mode::tournament, lbann::execution_mode::inference, lbann::execution_mode::invalid
}
 Neural network execution mode. More...
 

Functions

world_comm_ptr lbann::initialize (int &argc, char **&argv)
 
std::unique_ptr< lbann_comm > lbann::initialize_lbann (int argc, char **argv)
 Initialize LBANN for use with external applcations. More...
 
std::unique_ptr< lbann_comm > lbann::initialize_lbann (MPI_Comm c)
 Initialize LBANN for use with external applcations. More...
 
std::unique_ptr< lbann_comm > lbann::initialize_lbann (El::mpi::Comm &&c)
 Initialize LBANN for use with external applcations. More...
 
void lbann::finalize_lbann (lbann_comm *comm=nullptr)
 Destroy LBANN communicator for external application. More...
 
void lbann::finalize (lbann_comm *comm=nullptr)
 
std::string lbann::to_string (El::Device const &d)
 
El::Device lbann::device_from_string (std::string const &str)
 
matrix_format lbann::data_layout_to_matrix_format (data_layout layout)
 
std::string lbann::to_string (data_layout const &dl)
 
data_layout lbann::data_layout_from_string (std::string const &str)
 
std::string lbann::to_string (execution_mode m)
 
execution_mode lbann::exec_mode_from_string (std::string const &str)
 Convert a string to an execution_mode. More...
 
bool lbann::endsWith (const std::string mainStr, const std::string &toMatch)
 
void lbann::print_matrix_dims (AbsDistMat *m, const char *name)
 Print the dimensions and name of a Elemental matrix. More...
 
void lbann::print_local_matrix_dims (AbsMat *m, const char *name)
 Print the dimensions and name of a Elemental matrix. More...
 
void lbann::lbann_mpi_err_handler (MPI_Comm *comm, int *err_code,...)
 
std::istream & operator>> (std::istream &os, lbann::execution_mode &e)
 Extract an execution_mode from a stream. More...
 

Macro Definition Documentation

◆ LBANN_MAKE_STR

#define LBANN_MAKE_STR (   x)    LBANN_MAKE_STR_(x)

Definition at line 265 of file base.hpp.

◆ LBANN_MAKE_STR_

#define LBANN_MAKE_STR_ (   x)    #x

Definition at line 264 of file base.hpp.

◆ LBANN_PRINT_LOCAL_MATRIX_DIMS

#define LBANN_PRINT_LOCAL_MATRIX_DIMS (   x)    print_local_matrix_dims(x, #x);

Definition at line 262 of file base.hpp.

◆ LBANN_PRINT_MATRIX_DIMS

#define LBANN_PRINT_MATRIX_DIMS (   x)    print_matrix_dims(x, #x);

Definition at line 258 of file base.hpp.

Function Documentation

◆ operator>>()

std::istream& operator>> ( std::istream &  os,
lbann::execution_mode e 
)

Extract an execution_mode from a stream.