Cyclops Tensor Framework
parallel arithmetic on multidimensional arrays
CTF_int::summation Class Reference

class for execution distributed summation of tensors More...

#include <summation.h>

Collaboration diagram for CTF_int::summation:

Public Member Functions

 ~summation ()
 lazy constructor More...
 
 summation (summation const &other)
 copy constructor More...
 
 summation (tensor *A, int const *idx_A, char const *alpha, tensor *B, int const *idx_B, char const *beta)
 constructor definining summation with C's mul and add ops More...
 
 summation (tensor *A, char const *idx_A, char const *alpha, tensor *B, char const *idx_B, char const *beta)
 
 summation (tensor *A, int const *idx_A, char const *alpha, tensor *B, int const *idx_B, char const *beta, univar_function const *func)
 constructor definining summation with custom function More...
 
 summation (tensor *A, char const *idx_A, char const *alpha, tensor *B, char const *idx_B, char const *beta, univar_function const *func)
 
void execute (bool run_diag=false)
 run summation More...
 
double estimate_time ()
 predicts execution time in seconds using performance models More...
 
int is_equal (summation const &os)
 returns 1 if summations have same tensors and index map More...
 
int sum_tensors (bool run_diag)
 PDAXPY: a*idx_map_A(A) + b*idx_map_B(B) -> idx_map_B(B). Treats symmetric as lower triangular. More...
 
void print ()
 print contraction details More...
 

Data Fields

tensorA
 left operand More...
 
tensorB
 output More...
 
char const * alpha
 scaling of A More...
 
char const * beta
 scaling of existing B More...
 
int * idx_A
 indices of left operand More...
 
int * idx_B
 indices of output More...
 
bool is_custom
 whether there is a elementwise custom function More...
 
univar_function const * func
 function to execute on elements More...
 

Detailed Description

class for execution distributed summation of tensors

Definition at line 15 of file summation.h.

Constructor & Destructor Documentation

CTF_int::summation::~summation ( )

lazy constructor

destructor

Definition at line 19 of file summation.cxx.

References CTF_int::cdealloc().

CTF_int::summation::summation ( summation const &  other)

copy constructor

Parameters
[in]otherobject to copy

Definition at line 24 of file summation.cxx.

References A, CTF_int::alloc(), alpha, B, beta, func, idx_A, idx_B, is_custom, and CTF_int::tensor::order.

CTF_int::summation::summation ( tensor A,
int const *  idx_A,
char const *  alpha,
tensor B,
int const *  idx_B,
char const *  beta 
)

constructor definining summation with C's mul and add ops

Parameters
[in]Aleft operand tensor
[in]idx_Aindices of left operand
[in]alphascaling factor alpha * A[idx_A]; (can be NULL)
[in]Bouput operand tensor
[in]idx_Bindices of right operand
[in]betascaling factor of ouput (can be NULL) C[idx_B] = beta*B[idx_B] + alpha * A[idx_A]

Definition at line 37 of file summation.cxx.

References CTF_int::alloc().

CTF_int::summation::summation ( tensor A,
char const *  idx_A,
char const *  alpha,
tensor B,
char const *  idx_B,
char const *  beta 
)

Definition at line 57 of file summation.cxx.

References CTF_int::conv_idx().

CTF_int::summation::summation ( tensor A,
int const *  idx_A,
char const *  alpha,
tensor B,
int const *  idx_B,
char const *  beta,
univar_function const *  func 
)

constructor definining summation with custom function

Parameters
[in]Aleft operand tensor
[in]idx_Aindices of left operand
[in]alphascaling factor alpha * A[idx_A]; (can be NULL)
[in]Bouput operand tensor
[in]idx_Bindices of right operand
[in]funccustom elementwise function func(A[idx_A],&B[idx_B])
[in]betascaling factor of ouput (can be NULL) C[idx_B] = beta*B[idx_B] + alpha * A[idx_A]

Definition at line 74 of file summation.cxx.

References CTF_int::alloc().

CTF_int::summation::summation ( tensor A,
char const *  idx_A,
char const *  alpha,
tensor B,
char const *  idx_B,
char const *  beta,
univar_function const *  func 
)

Definition at line 99 of file summation.cxx.

References CTF_int::conv_idx().

Member Function Documentation

double CTF_int::summation::estimate_time ( )

predicts execution time in seconds using performance models

Definition at line 132 of file summation.cxx.

References A, ABORT, CTF_int::algstrct::add(), CTF_int::algstrct::addid(), CTF_int::tensor::addinv(), align_symmetric_indices(), CTF_int::alloc(), CTF_int::alloc_ptr(), alpha, ASSERT, B, beta, CTF_int::tspsum_virt::blk_sz_A, CTF_int::tsum_virt::blk_sz_A, CTF_int::tspsum_virt::blk_sz_B, CTF_int::tsum_virt::blk_sz_B, CTF_int::calc_dim(), CTF_int::tensor::calc_nvirt(), CTF_int::cdealloc(), CTF_int::mapping::cdt, CTF_int::mapping::child, CTF_int::contract_mst(), CTF_int::conv_idx< int >(), CTF_int::copy_mapping(), CTF_int::tensor::data, CTF_int::desymmetrize(), DPRINTF, CTF_int::seq_tsr_spsum::edge_len_A, CTF_int::seq_tsr_sum::edge_len_A, CTF_int::seq_tsr_spsum::edge_len_B, CTF_int::seq_tsr_sum::edge_len_B, CTF_int::tensor::edge_map, CTF_int::accumulatable::el_size, CTF_int::ERROR, CTF_int::est_time_transp(), CTF_int::scaling::execute(), execute(), CTF_int::tensor::extract_diag(), CTF_int::seq_tsr_spsum::func, CTF_int::seq_tsr_sum::func, CTF_int::get_sym_perms(), CTF_int::mapping::has_child, CTF_int::tensor::has_home, CTF_int::tensor::home_buffer, CTF_int::tensor::home_size, idx_A, idx_B, CTF_int::seq_tsr_sum::inr_stride, CTF_int::inv_idx(), CTF_int::seq_tsr_spsum::is_custom, CTF_int::seq_tsr_sum::is_custom, CTF_int::tensor::is_data_aliased, CTF_int::tensor::is_home, CTF_int::seq_tsr_spsum::is_inner, CTF_int::seq_tsr_sum::is_inner, CTF_int::tensor::is_mapped, CTF_int::algstrct::isequal(), CTF_int::algstrct::mulid(), CTF_int::tensor::name, CTF_int::tensor::nnz_blk, CTF_int::tensor::nnz_loc, CTF_int::tensor::nnz_tot, CTF_int::nosym_transpose(), CTF_int::mapping::np, NS, CTF_int::tspsum_virt::num_dim, CTF_int::tsum_virt::num_dim, CTF_int::tensor::order, overcounting_factor(), CTF_int::tensor::pad_edge_len, CTF_int::algstrct::pair_dealloc(), CTF_int::permute_target(), CTF_int::PHYSICAL_MAP, print(), CTF_int::tensor::pull_alias(), CTF_int::strp_sum::rec_strp_A, CTF_int::strp_sum::rec_strp_B, CTF_int::tensor::rec_tsr, CTF_int::tspsum_virt::rec_tsum, CTF_int::tspsum_replicate::rec_tsum, CTF_int::strp_sum::rec_tsum, CTF_int::tsum_virt::rec_tsum, CTF_int::tsum_replicate::rec_tsum, CTF_int::tspsum_permute::rec_tsum, CTF_int::tspsum_pin_keys::rec_tsum, CTF_int::algstrct::safeaddinv(), CTF_int::algstrct::safecopy(), CTF_int::tensor::self_reduce(), CTF_int::tensor::set_new_nnz_glb(), CTF_int::tensor::set_padding(), sign(), CTF_int::tensor::sr, CTF_int::tsum::sr_A, CTF_int::tsum::sr_B, CTF_int::strp_sum::strip_A, CTF_int::strp_sum::strip_B, CTF_int::strip_diag(), CTF_int::strp_tsr::strip_dim, CTF_int::SUCCESS, sum_tensors(), SY, CTF_int::tensor::sym, CTF_int::seq_tsr_spsum::sym_A, CTF_int::seq_tsr_sum::sym_A, CTF_int::seq_tsr_spsum::sym_B, CTF_int::seq_tsr_sum::sym_B, CTF_int::symmetrize(), TAU_FSTART, TAU_FSTOP, CTF_int::tensor::topo, CTF_int::mapping::type, CTF_int::tensor::unfold(), CTF_int::tspsum_virt::virt_dim, CTF_int::tsum_virt::virt_dim, and CTF_int::VIRTUAL_MAP.

Referenced by CTF_int::Unifun_Term::estimate_time(), CTF::Idx_Tensor::estimate_time(), CTF_int::Sum_Term::estimate_time(), CTF_int::Contract_Term::estimate_time(), and CTF::Tensor< dtype >::operator=().

Field Documentation

char const* CTF_int::summation::alpha

scaling of A

Definition at line 23 of file summation.h.

Referenced by estimate_time(), summation(), and CTF_int::tsum::tsum().

char const* CTF_int::summation::beta

scaling of existing B

Definition at line 25 of file summation.h.

Referenced by estimate_time(), summation(), and CTF_int::tsum::tsum().

univar_function const* CTF_int::summation::func

function to execute on elements

Definition at line 34 of file summation.h.

Referenced by summation().

bool CTF_int::summation::is_custom

whether there is a elementwise custom function

Definition at line 32 of file summation.h.

Referenced by CTF_int::seq_tsr_spsum::seq_tsr_spsum(), CTF_int::seq_tsr_sum::seq_tsr_sum(), and summation().


The documentation for this class was generated from the following files: