Cyclops Tensor Framework
parallel arithmetic on multidimensional arrays
|
algstrct (algebraic structure) defines the elementwise operations computed in each tensor contraction, virtual classes defined in derived typed classes or algstrctcpy More...
#include <algstrct.h>
Public Member Functions | |
virtual int | pair_size () const |
gets pair size el_size plus the key size More... | |
algstrct () | |
default constructor More... | |
algstrct (int el_size) | |
constructor creates algstrct with all parameters More... | |
virtual | ~algstrct ()=0 |
destructor More... | |
virtual algstrct * | clone () const =0 |
''copy constructor'' More... | |
virtual bool | is_ordered () const =0 |
virtual MPI_Op | addmop () const |
MPI addition operation for reductions. More... | |
virtual MPI_Datatype | mdtype () const |
MPI datatype. More... | |
virtual char const * | addid () const |
MPI datatype for pairs. More... | |
virtual char const * | mulid () const |
identity element for multiplication i.e. 1 More... | |
virtual void | addinv (char const *a, char *b) const |
b = -a More... | |
virtual void | safeaddinv (char const *a, char *&b) const |
b = -a, with checks for NULL and alloc as necessary More... | |
virtual void | add (char const *a, char const *b, char *c) const |
c = a+b More... | |
virtual void | accum (char const *a, char *b) const |
b+=a More... | |
virtual bool | has_mul () const |
virtual void | mul (char const *a, char const *b, char *c) const |
c = a*b More... | |
virtual void | safemul (char const *a, char const *b, char *&c) const |
c = a*b, with NULL treated as mulid More... | |
virtual void | min (char const *a, char const *b, char *c) const |
c = min(a,b) More... | |
virtual void | max (char const *a, char const *b, char *c) const |
c = max(a,b) More... | |
virtual void | min (char *c) const |
c = minimum possible value More... | |
virtual void | max (char *c) const |
c = maximum possible value More... | |
virtual void | cast_int (int64_t i, char *c) const |
c = &i More... | |
virtual void | cast_double (double d, char *c) const |
c = &d More... | |
virtual int64_t | cast_to_int (char const *c) const |
return (int64_t)*c More... | |
virtual double | cast_to_double (char const *c) const |
return (double)*c More... | |
virtual void | print (char const *a, FILE *fp=stdout) const |
prints the value More... | |
virtual void | scal (int n, char const *alpha, char *X, int incX) const |
X["i"]=alpha*X["i"];. More... | |
virtual void | axpy (int n, char const *alpha, char const *X, int incX, char *Y, int incY) const |
Y["i"]+=alpha*X["i"];. More... | |
virtual void | gemm (char tA, char tB, int m, int n, int k, char const *alpha, char const *A, char const *B, char const *beta, char *C) const |
beta*C["ij"]=alpha*A^tA["ik"]*B^tB["kj"]; More... | |
virtual void | gemm_batch (char tA, char tB, int l, int m, int n, int k, char const *alpha, char const *A, char const *B, char const *beta, char *C) const |
beta*C["ijl"]=alpha*A^tA["ikl"]*B^tB["kjl"]; More... | |
virtual void | offload_gemm (char tA, char tB, int m, int n, int k, char const *alpha, char const *A, char const *B, char const *beta, char *C) const |
virtual bool | is_offloadable () const |
virtual void | coomm (int m, int n, int k, char const *alpha, char const *A, int const *rows_A, int const *cols_A, int64_t nnz_A, char const *B, char const *beta, char *C, bivar_function const *func) const |
sparse version of gemm using coordinate format for A More... | |
virtual void | csrmm (int m, int n, int k, char const *alpha, char const *A, int const *JA, int const *IA, int64_t nnz_A, char const *B, char const *beta, char *C, bivar_function const *func) const |
sparse version of gemm using CSR format for A More... | |
virtual void | csrmultd (int m, int n, int k, char const *alpha, char const *A, int const *JA, int const *IA, int64_t nnz_A, char const *B, int const *JB, int const *IB, int64_t nnz_B, char const *beta, char *C) const |
sparse version of gemm using CSR format for A and B More... | |
virtual void | csrmultcsr (int m, int n, int k, char const *alpha, char const *A, int const *JA, int const *IA, int64_t nnz_A, char const *B, int const *JB, int const *IB, int64_t nnz_B, char const *beta, char *&C_CSR) const |
virtual bool | isequal (char const *a, char const *b) const |
returns true if algstrct elements a and b are equal More... | |
virtual void | coo_to_csr (int64_t nz, int nrow, char *csr_vs, int *csr_cs, int *csr_rs, char const *coo_vs, int const *coo_rs, int const *coo_cs) const |
converts coordinate sparse matrix layout to CSR layout More... | |
virtual void | csr_to_coo (int64_t nz, int nrow, char const *csr_vs, int const *csr_ja, int const *csr_ia, char *coo_vs, int *coo_rs, int *coo_cs) const |
converts CSR sparse matrix layout to coordinate (COO) layout More... | |
virtual char * | csr_add (char *cA, char *cB) const |
adds CSR matrices A (stored in cA) and B (stored in cB) to create matric C (pointer to all_data returned), C data allocated internally More... | |
virtual char * | csr_reduce (char *cA, int root, MPI_Comm cm) const |
reduces CSR matrices stored in cA on each processor in cm and returns result on processor root More... | |
virtual char * | pair_alloc (int64_t n) const |
allocate space for n (int64_t,dtype) pairs, necessary for object types More... | |
virtual char * | alloc (int64_t n) const |
allocate space for n items, necessary for object types More... | |
virtual int64_t | get_key (char const *a) const |
gets key from pair More... | |
virtual char * | get_value (char *a) const |
gets pair to value from pair More... | |
virtual char const * | get_const_value (char const *a) const |
virtual void | dealloc (char *ptr) const |
deallocate given pointer containing contiguous array of values More... | |
virtual void | pair_dealloc (char *ptr) const |
deallocate given pointer containing contiguous array of pairs More... | |
virtual void | init (int64_t n, char *arr) const |
initialize n objects to zero More... | |
virtual void | sort (int64_t n, char *pairs) const |
sorts n sets of pairs using std::sort More... | |
double | estimate_csr_red_time (int64_t msg_sz, CommData const *cdt) const |
void | acc (char *b, char const *beta, char const *a, char const *alpha) const |
compute b=beta*b + alpha*a More... | |
void | accmul (char *c, char const *a, char const *b, char const *alpha) const |
compute c=c + alpha*a*b More... | |
virtual void | copy (char *a, char const *b) const |
copies element b to element a More... | |
void | safecopy (char *&a, char const *b) const |
copies element b to element a, , with checks for NULL and alloc as necessary More... | |
virtual void | copy (char *a, char const *b, int64_t n) const |
copies n elements from array b to array a More... | |
virtual void | copy (int64_t n, char const *a, int inc_a, char *b, int inc_b) const |
copies n elements TO array b with increment inc_a FROM array a with increment inc_b More... | |
virtual void | copy (int64_t m, int64_t n, char const *a, int64_t lda_a, char *b, int64_t lda_b) const |
copies m-by-n submatrix from a with lda_a to b with lda_b More... | |
virtual void | copy (int64_t m, int64_t n, char const *a, int64_t lda_a, char const *alpha, char *b, int64_t lda_b, char const *beta) const |
copies m-by-n submatrix from a with lda_a and scaling alpha to b with lda_b and scaling by 1 More... | |
virtual void | copy_pair (char *a, char const *b) const |
copies pair b to element a More... | |
virtual void | copy_pairs (char *a, char const *b, int64_t n) const |
copies n pair from array b to array a More... | |
virtual void | set (char *a, char const *b, int64_t n) const |
sets n elements of array a to value b More... | |
virtual void | set_pair (char *a, int64_t key, char const *vb) const |
sets 1 elements of pair a to value and key More... | |
virtual void | set_pairs (char *a, char const *b, int64_t n) const |
sets n elements of array of pairs a to value b More... | |
Public Member Functions inherited from CTF_int::accumulatable | |
virtual void | init_shell (int64_t n, char *arr) const |
initialize n objects to zero More... | |
Data Fields | |
bool | has_coo_ker |
whether there was a custom COO CSRMM kernel provided for this algebraic structure More... | |
void(* | abs )(char const *a, char *b) |
b = max(a,addinv(a)) More... | |
Data Fields inherited from CTF_int::accumulatable | |
int | el_size |
size of each element of algstrct in bytes More... | |
algstrct (algebraic structure) defines the elementwise operations computed in each tensor contraction, virtual classes defined in derived typed classes or algstrctcpy
Definition at line 34 of file algstrct.h.
|
inline |
default constructor
Definition at line 52 of file algstrct.h.
References CTF_int::accumulatable::accum(), ctf.core::b, and CTF_int::accumulatable::el_size.
CTF_int::algstrct::algstrct | ( | int | el_size | ) |
constructor creates algstrct with all parameters
brief copy constructor param[in] other another algstrct to copy from
[in] | el_size | number of bytes in each element in the algstrct set |
Definition at line 68 of file algstrct.cxx.
|
inlinepure virtual |
void CTF_int::algstrct::acc | ( | char * | b, |
char const * | beta, | ||
char const * | a, | ||
char const * | alpha | ||
) | const |
compute b=beta*b + alpha*a
Definition at line 514 of file algstrct.cxx.
Referenced by CTF_int::cyclic_reshuffle(), CTF_int::glb_cyclic_reshuffle(), CTF_int::glb_ord_pup(), and CTF_int::pad_cyclic_pup_virt_buff().
void CTF_int::algstrct::accmul | ( | char * | c, |
char const * | a, | ||
char const * | b, | ||
char const * | alpha | ||
) | const |
compute c=c + alpha*a*b
Definition at line 521 of file algstrct.cxx.
|
virtual |
|
virtual |
c = a+b
Reimplemented in CTF::Monoid< dtype, is_ord >.
Definition at line 109 of file algstrct.cxx.
References ASSERT.
Referenced by CTF_int::univar_function::acc_f(), CTF::Univar_Function< dtype_A, dtype_B >::acc_f(), CTF::Bivar_Function< dtype_A, dtype_B, dtype_C >::acc_f(), CTF::Bivar_Function< dtype_A, dtype_B, dtype_C >::csrmm(), CTF::Bivar_Function< dtype_A, dtype_B, dtype_C >::csrmultcsr(), CTF::Bivar_Function< dtype_A, dtype_B, dtype_C >::csrmultd(), CTF_int::summation::estimate_time(), CTF_int::get_len_ordering(), CTF_int::readwrite(), CTF_int::sp_read(), CTF_int::sp_write(), CTF_int::spA_dnB_dnC_seq_ctr(), CTF_int::spA_dnB_seq_sum(), CTF_int::spspsum(), CTF_int::sym_seq_ctr_ref(), and CTF_int::sym_seq_sum_ref().
|
virtual |
MPI datatype for pairs.
identity element for addition i.e. 0
Reimplemented in CTF::Monoid< dtype, is_ord >.
Definition at line 89 of file algstrct.cxx.
Referenced by CTF_int::block_reshuffle(), CTF_int::cyclic_reshuffle(), dgtog_reshuffle(), CTF_int::summation::estimate_time(), CTF_int::get_len_ordering(), CTF_int::glb_cyclic_reshuffle(), CTF_int::glb_ord_pup(), CTF::Idx_Tensor::operator=(), CTF::Typ_Idx_Tensor< dtype_C >::operator=(), CTF::Tensor< dtype >::operator=(), CTF_int::pad_cyclic_pup_virt_buff(), CTF_int::padded_reshuffle(), CTF_int::reduce_step_pre(), CTF_int::spctr_replicate::run(), CTF_int::tspsum_replicate::run(), CTF_int::ctr_2d_general::run(), CTF_int::seq_tsr_spctr::run(), CTF_int::tsum_replicate::run(), CTF_int::ctr_replicate::run(), CTF::Tensor< dtype >::slice(), CTF_int::sp_read(), CTF_int::spA_dnB_dnC_seq_ctr(), CTF_int::spA_dnB_seq_sum(), CTF_int::sym_seq_ctr_cust(), CTF_int::sym_seq_ctr_inr(), CTF_int::sym_seq_ctr_ref(), CTF_int::sym_seq_sum_ref(), CTF_int::symmetrize(), CTF_int::tensor::tensor(), CTF_int::wr_pairs_layout(), CTF::Tensor< dtype >::write(), and CTF_int::zero_padding().
|
virtual |
b = -a
Reimplemented in CTF::Ring< dtype, is_ord >, and CTF::Group< dtype, is_ord >.
Definition at line 103 of file algstrct.cxx.
References ASSERT.
Referenced by CTF_int::desymmetrize(), CTF_int::get_len_ordering(), CTF_int::symmetrize(), and CTF_int::wr_pairs_layout().
|
virtual |
MPI addition operation for reductions.
Reimplemented in CTF::Monoid< dtype, is_ord >.
Definition at line 73 of file algstrct.cxx.
References ASSERT.
Referenced by CTF_int::spctr_replicate::est_time_fp(), CTF_int::ctr_2d_general::est_time_fp(), CTF_int::spctr_2d_general::est_time_fp(), CTF_int::ctr_replicate::est_time_fp(), CTF_int::reduce_step_post(), CTF_int::spctr_replicate::run(), CTF_int::tspsum_replicate::run(), CTF_int::ctr_2d_general::run(), CTF_int::tsum_replicate::run(), and CTF_int::ctr_replicate::run().
|
virtual |
allocate space for n items, necessary for object types
[in] | n | number of items |
Reimplemented in CTF::Set< dtype, is_ord >.
Definition at line 685 of file algstrct.cxx.
References CTF_int::alloc().
Referenced by CTF_int::block_reshuffle(), CTF_int::desymmetrize(), dgtog_reshuffle(), CTF_int::get_len_ordering(), CTF::Tensor< dtype >::get_local_data(), CTF_int::nosym_transpose(), and CTF_int::tensor::tensor().
|
virtual |
Y["i"]+=alpha*X["i"];.
Reimplemented in CTF::Semiring< dtype, is_ord >, and CTF::Monoid< dtype, is_ord >.
Definition at line 280 of file algstrct.cxx.
References ASSERT.
Referenced by CTF_int::sym_seq_sum_inr().
|
virtual |
c = &d
Reimplemented in CTF::Set< dtype, is_ord >, CTF::Set< dtype, is_ord >, CTF::Set< dtype, is_ord >, CTF::Set< dtype, is_ord >, CTF::Set< dtype, is_ord >, CTF::Set< dtype, is_ord >, CTF::Set< dtype, is_ord >, CTF::Set< dtype, is_ord >, CTF::Set< dtype, is_ord >, and CTF::Set< dtype, is_ord >.
Definition at line 150 of file algstrct.cxx.
References ASSERT.
Referenced by CTF_int::desymmetrize(), CTF::Idx_Tensor::Idx_Tensor(), CTF_int::scal_diag(), and CTF_int::symmetrize().
|
virtual |
c = &i
Reimplemented in CTF::Set< dtype, is_ord >, CTF::Set< dtype, is_ord >, CTF::Set< dtype, is_ord >, CTF::Set< dtype, is_ord >, CTF::Set< dtype, is_ord >, CTF::Set< dtype, is_ord >, CTF::Set< dtype, is_ord >, CTF::Set< dtype, is_ord >, CTF::Set< dtype, is_ord >, and CTF::Set< dtype, is_ord >.
Definition at line 144 of file algstrct.cxx.
References ASSERT.
Referenced by CTF::Idx_Tensor::Idx_Tensor().
|
virtual |
return (double)*c
Reimplemented in CTF::Set< dtype, is_ord >, CTF::Set< dtype, is_ord >, CTF::Set< dtype, is_ord >, CTF::Set< dtype, is_ord >, CTF::Set< dtype, is_ord >, and CTF::Set< dtype, is_ord >.
Definition at line 156 of file algstrct.cxx.
References ASSERT.
|
virtual |
return (int64_t)*c
Reimplemented in CTF::Set< dtype, is_ord >, CTF::Set< dtype, is_ord >, CTF::Set< dtype, is_ord >, CTF::Set< dtype, is_ord >, CTF::Set< dtype, is_ord >, and CTF::Set< dtype, is_ord >.
Definition at line 163 of file algstrct.cxx.
References ASSERT.
|
pure virtual |
''copy constructor''
Implemented in CTF::Semiring< dtype, is_ord >, CTF::Set< dtype, is_ord >, CTF::Monoid< dtype, is_ord >, CTF::Ring< dtype, is_ord >, and CTF::Group< dtype, is_ord >.
Referenced by CTF::Tensor< dtype >::add_from_subworld(), CTF::Tensor< dtype >::add_to_subworld(), CTF_int::tensor::init(), and CTF_int::Term::Term().
|
virtual |
converts coordinate sparse matrix layout to CSR layout
Reimplemented in CTF::Set< dtype, is_ord >.
Definition at line 350 of file algstrct.cxx.
References ASSERT.
Referenced by CTF_int::CSR_Matrix::CSR_Matrix().
|
virtual |
sparse version of gemm using coordinate format for A
Reimplemented in CTF::Semiring< dtype, is_ord >.
Definition at line 703 of file algstrct.cxx.
References ASSERT.
Referenced by CTF_int::COO_Matrix::coomm().
|
virtual |
copies element b to element a
Reimplemented in CTF::Set< dtype, is_ord >.
Definition at line 538 of file algstrct.cxx.
Referenced by ctf.core.tensor::astype(), CTF_int::bcast_step(), CTF_int::block_reshuffle(), CTF_int::cyclic_reshuffle(), dgtog_reshuffle(), CTF_int::scaling::execute(), CTF_int::get_len_ordering(), CTF_int::glb_cyclic_reshuffle(), CTF_int::glb_ord_pup(), CTF_int::nosym_transpose(), CTF_int::order_globally(), CTF_int::pad_cyclic_pup_virt_buff(), CTF_int::readwrite(), ctf.core.tensor::real(), CTF_int::redist_bucket_r0(), CTF_int::reduce_step_post(), CTF_int::strp_tsr::run(), CTF_int::ctr_2d_general::run(), CTF_int::tspsum_map::run(), CTF_int::tspsum_permute::run(), and CTF_int::symmetrize().
|
virtual |
copies n elements from array b to array a
Reimplemented in CTF::Set< dtype, is_ord >.
Definition at line 546 of file algstrct.cxx.
Referenced by ctf.core.tensor::astype(), and ctf.core.tensor::real().
|
virtual |
copies n elements TO array b with increment inc_a FROM array a with increment inc_b
Reimplemented in CTF::Set< dtype, is_ord >, CTF::Set< dtype, is_ord >, CTF::Set< dtype, is_ord >, CTF::Set< dtype, is_ord >, and CTF::Set< dtype, is_ord >.
Definition at line 555 of file algstrct.cxx.
References ctf.core::copy(), CTF_BLAS::DCOPY(), CTF_BLAS::SCOPY(), and CTF_BLAS::ZCOPY().
Referenced by ctf.core.tensor::astype(), and ctf.core.tensor::real().
|
virtual |
copies m-by-n submatrix from a with lda_a to b with lda_b
Reimplemented in CTF::Set< dtype, is_ord >.
Definition at line 578 of file algstrct.cxx.
Referenced by ctf.core.tensor::astype(), and ctf.core.tensor::real().
|
virtual |
copies m-by-n submatrix from a with lda_a and scaling alpha to b with lda_b and scaling by 1
Definition at line 593 of file algstrct.cxx.
References ctf.core::b.
Referenced by ctf.core.tensor::astype(), and ctf.core.tensor::real().
|
virtual |
copies pair b to element a
Reimplemented in CTF::Set< dtype, is_ord >.
Definition at line 542 of file algstrct.cxx.
Referenced by CTF_int::spspsum().
|
virtual |
copies n pair from array b to array a
Reimplemented in CTF::Set< dtype, is_ord >.
Definition at line 550 of file algstrct.cxx.
Referenced by CTF_int::tspsum_virt::run(), and CTF_int::tspsum_permute::run().
|
virtual |
adds CSR matrices A (stored in cA) and B (stored in cB) to create matric C (pointer to all_data returned), C data allocated internally
Reimplemented in CTF::Monoid< dtype, is_ord >, CTF::Monoid< dtype, is_ord >, and CTF::Monoid< dtype, is_ord >.
Definition at line 362 of file algstrct.cxx.
References CTF_int::CSR_Matrix::csr_add().
Referenced by CTF::Monoid< dtype, is_ord >::csr_add(), and CTF_int::spctr_2d_general::run().
|
virtual |
reduces CSR matrices stored in cA on each processor in cm and returns result on processor root
Definition at line 367 of file algstrct.cxx.
References CTF_int::CSR_Matrix::all_data, CTF_int::alloc(), CTF_int::cdealloc(), CTF_int::csrred_mdl, CTF_int::CSR_Matrix::partition(), CTF_int::CSR_Matrix::size(), TAU_FSTART, and TAU_FSTOP.
Referenced by CTF_int::reduce_step_post(), and CTF_int::spctr_replicate::run().
|
virtual |
converts CSR sparse matrix layout to coordinate (COO) layout
Reimplemented in CTF::Set< dtype, is_ord >.
Definition at line 355 of file algstrct.cxx.
References ASSERT.
Referenced by CTF_int::COO_Matrix::COO_Matrix().
|
virtual |
sparse version of gemm using CSR format for A
Reimplemented in CTF::Semiring< dtype, is_ord >.
Definition at line 708 of file algstrct.cxx.
References ASSERT.
Referenced by CTF_int::CSR_Matrix::csrmm().
|
virtual |
Reimplemented in CTF::Semiring< dtype, is_ord >.
Definition at line 733 of file algstrct.cxx.
References ASSERT.
Referenced by CTF_int::CSR_Matrix::csrmultcsr().
|
virtual |
sparse version of gemm using CSR format for A and B
Reimplemented in CTF::Semiring< dtype, is_ord >.
Definition at line 714 of file algstrct.cxx.
References ASSERT.
Referenced by CTF_int::CSR_Matrix::csrmultd().
|
virtual |
deallocate given pointer containing contiguous array of values
[in] | ptr | array to deallocate |
Reimplemented in CTF::Set< dtype, is_ord >.
Definition at line 689 of file algstrct.cxx.
References CTF_int::cdealloc().
Referenced by dgtog_reshuffle(), CTF_int::scaling::execute(), CTF_int::get_len_ordering(), and CTF_int::nosym_transpose().
double CTF_int::algstrct::estimate_csr_red_time | ( | int64_t | msg_sz, |
CommData const * | cdt | ||
) | const |
estimate time in seconds necessary for CSR reduction with input of size msg_sz
Definition at line 508 of file algstrct.cxx.
References CTF_int::csrred_mdl, and CTF_int::CommData::np.
Referenced by CTF_int::spctr_replicate::est_time_fp(), and CTF_int::spctr_2d_general::est_time_fp().
|
virtual |
beta*C["ij"]=alpha*A^tA["ik"]*B^tB["kj"];
Reimplemented in CTF::Semiring< dtype, is_ord >.
Definition at line 307 of file algstrct.cxx.
References ASSERT.
|
virtual |
beta*C["ijl"]=alpha*A^tA["ikl"]*B^tB["kjl"];
Reimplemented in CTF::Semiring< dtype, is_ord >.
Definition at line 291 of file algstrct.cxx.
References ASSERT.
Referenced by CTF_int::sym_seq_ctr_inr().
|
virtual |
Reimplemented in CTF::Set< dtype, is_ord >.
Definition at line 677 of file algstrct.cxx.
|
virtual |
gets key from pair
Reimplemented in CTF::Set< dtype, is_ord >.
Definition at line 669 of file algstrct.cxx.
References ctf.core::a.
|
virtual |
gets pair to value from pair
Reimplemented in CTF::Set< dtype, is_ord >.
Definition at line 673 of file algstrct.cxx.
|
inlinevirtual |
returns whether multiplication operator is present
Reimplemented in CTF::Semiring< dtype, is_ord >.
Definition at line 109 of file algstrct.h.
References ctf.core::a, CTF_int::alloc(), ctf.core::b, ctf.core::copy(), CTF_int::gemm(), CTF_int::gemm_batch(), and CTF_int::offload_gemm().
Referenced by CTF::Idx_Tensor::operator=().
|
virtual |
initialize n objects to zero
[in] | n | number of items |
[in] | arr | array containing n items, to be set to zero |
Reimplemented in CTF::Set< dtype, is_ord >, and CTF::Monoid< dtype, is_ord >.
Definition at line 697 of file algstrct.cxx.
Referenced by dgtog_reshuffle().
|
virtual |
Reimplemented in CTF::Semiring< dtype, is_ord >, CTF::Semiring< dtype, is_ord >, CTF::Semiring< dtype, is_ord >, CTF::Semiring< dtype, is_ord >, CTF::Semiring< dtype, is_ord >, CTF::Semiring< dtype, is_ord >, CTF::Semiring< dtype, is_ord >, CTF::Semiring< dtype, is_ord >, and CTF::Semiring< dtype, is_ord >.
Definition at line 336 of file algstrct.cxx.
Referenced by CTF_int::get_len_ordering().
|
pure virtual |
Implemented in CTF::Set< dtype, is_ord >.
Referenced by CTF::Tensor< dtype >::reduce().
|
virtual |
returns true if algstrct elements a and b are equal
Reimplemented in CTF::Set< dtype, is_ord >, CTF::Set< dtype, is_ord >, CTF::Set< dtype, is_ord >, CTF::Set< dtype, is_ord >, CTF::Set< dtype, is_ord >, CTF::Set< dtype, is_ord >, CTF::Set< dtype, is_ord >, CTF::Set< dtype, is_ord >, CTF::Set< dtype, is_ord >, and CTF::Set< dtype, is_ord >.
Definition at line 340 of file algstrct.cxx.
Referenced by CTF_int::tensor::compare(), CTF_int::COO_Matrix::coomm(), CTF_int::CSR_Matrix::csrmm(), CTF_int::CSR_Matrix::csrmultcsr(), CTF_int::CSR_Matrix::csrmultd(), CTF_int::cyclic_reshuffle(), CTF_int::summation::estimate_time(), CTF_int::Bifun_Term::execute(), CTF_int::get_len_ordering(), CTF_int::glb_cyclic_reshuffle(), CTF_int::glb_ord_pup(), CTF_int::pad_cyclic_pup_virt_buff(), CTF_int::spctr_replicate::run(), CTF_int::seq_tsr_spctr::run(), CTF_int::ctr_replicate::run(), CTF_int::spA_dnB_dnC_seq_ctr(), CTF_int::spA_dnB_seq_sum(), CTF_int::sym_seq_ctr_cust(), CTF_int::sym_seq_ctr_inr(), CTF_int::sym_seq_ctr_ref(), and CTF_int::sym_seq_sum_ref().
|
virtual |
c = max(a,b)
Reimplemented in CTF::Set< dtype, is_ord >.
Definition at line 138 of file algstrct.cxx.
References ASSERT.
Referenced by CTF::Tensor< dtype >::reduce().
|
virtual |
c = maximum possible value
Reimplemented in CTF::Set< dtype, is_ord >.
Definition at line 182 of file algstrct.cxx.
References ASSERT.
|
virtual |
MPI datatype.
Reimplemented in CTF::Set< dtype, is_ord >.
Definition at line 80 of file algstrct.cxx.
References ASSERT.
Referenced by CTF_int::tensor::add_to_subworld(), CTF_int::bcast_step(), CTF_int::block_reshuffle(), isendrecv< 0 >(), CTF_int::reduce_step_post(), CTF_int::spctr_replicate::run(), CTF_int::tspsum_replicate::run(), CTF_int::ctr_2d_general::run(), CTF_int::tsum_replicate::run(), and CTF_int::ctr_replicate::run().
|
virtual |
c = min(a,b)
Reimplemented in CTF::Set< dtype, is_ord >.
Definition at line 132 of file algstrct.cxx.
References ASSERT.
Referenced by CTF_int::tensor::compare(), and CTF::Tensor< dtype >::reduce().
|
virtual |
c = minimum possible value
Reimplemented in CTF::Set< dtype, is_ord >.
Definition at line 176 of file algstrct.cxx.
References ASSERT.
|
virtual |
c = a*b
Reimplemented in CTF::Semiring< dtype, is_ord >.
Definition at line 120 of file algstrct.cxx.
References ASSERT.
Referenced by CTF_int::readwrite(), CTF_int::sp_read(), CTF_int::sp_write(), CTF_int::spA_dnB_dnC_seq_ctr(), CTF_int::spA_dnB_seq_sum(), CTF_int::spspsum(), CTF_int::sym_seq_ctr_cust(), CTF_int::sym_seq_ctr_ref(), CTF_int::sym_seq_scl_cust(), CTF_int::sym_seq_scl_ref(), CTF_int::sym_seq_sum_cust(), and CTF_int::sym_seq_sum_ref().
|
virtual |
identity element for multiplication i.e. 1
Reimplemented in CTF::Semiring< dtype, is_ord >.
Definition at line 93 of file algstrct.cxx.
Referenced by CTF::Tensor< dtype >::add_from_subworld(), CTF::Tensor< dtype >::add_to_subworld(), CTF_int::contract_down_terms(), CTF_int::COO_Matrix::coomm(), CTF_int::CSR_Matrix::csrmm(), CTF_int::CSR_Matrix::csrmultcsr(), CTF_int::CSR_Matrix::csrmultd(), CTF_int::cyclic_reshuffle(), CTF_int::desymmetrize(), CTF_int::Bifun_Term::estimate_time(), CTF::Idx_Tensor::estimate_time(), CTF_int::summation::estimate_time(), CTF_int::Bifun_Term::execute(), CTF_int::get_len_ordering(), CTF_int::glb_cyclic_reshuffle(), CTF_int::glb_ord_pup(), CTF::Idx_Tensor::operator+=(), CTF::Idx_Tensor::operator-=(), CTF_int::Term::operator<<(), CTF::Idx_Tensor::operator=(), CTF::Tensor< dtype >::operator=(), CTF_int::pad_cyclic_pup_virt_buff(), CTF_int::padded_reshuffle(), CTF::Schedule::partition_and_execute(), CTF_int::reduce_step_post(), CTF_int::tensor::reduce_sum(), CTF_int::tensor::reduce_sumabs(), CTF_int::ctr_virt::run(), CTF_int::spctr_replicate::run(), CTF_int::tspsum_virt::run(), CTF_int::tspsum_replicate::run(), CTF_int::ctr_2d_general::run(), CTF_int::seq_tsr_spctr::run(), CTF_int::tsum_virt::run(), CTF_int::tsum_replicate::run(), CTF_int::spctr_virt::run(), CTF_int::ctr_replicate::run(), CTF::Tensor< dtype >::slice(), CTF_int::spA_dnB_dnC_seq_ctr(), CTF_int::spA_dnB_seq_sum(), CTF_int::sym_seq_ctr_cust(), CTF_int::sym_seq_ctr_inr(), CTF_int::sym_seq_ctr_ref(), CTF_int::sym_seq_sum_ref(), CTF_int::symmetrize(), and CTF::Tensor< dtype >::write().
|
virtual |
Reimplemented in CTF::Semiring< dtype, is_ord >, CTF::Semiring< dtype, is_ord >, CTF::Semiring< dtype, is_ord >, CTF::Semiring< dtype, is_ord >, CTF::Semiring< dtype, is_ord >, CTF::Semiring< dtype, is_ord >, CTF::Semiring< dtype, is_ord >, CTF::Semiring< dtype, is_ord >, and CTF::Semiring< dtype, is_ord >.
Definition at line 322 of file algstrct.cxx.
References ASSERT.
Referenced by CTF_int::sym_seq_ctr_inr().
|
virtual |
allocate space for n (int64_t,dtype) pairs, necessary for object types
[in] | n | number of pairs |
Reimplemented in CTF::Set< dtype, is_ord >.
Definition at line 681 of file algstrct.cxx.
References CTF_int::alloc().
Referenced by CTF_int::tensor::compare(), CTF_int::depin(), CTF_int::permute_keys(), CTF::Tensor< dtype >::read(), CTF_int::read_loc_pairs(), CTF_int::tspsum_virt::run(), CTF_int::tensor::slice(), CTF_int::sp_write(), CTF_int::spsfy_tsr(), CTF_int::spspsum(), CTF_int::wr_pairs_layout(), and CTF::Tensor< dtype >::write().
|
virtual |
deallocate given pointer containing contiguous array of pairs
[in] | ptr | array to deallocate |
Reimplemented in CTF::Set< dtype, is_ord >.
Definition at line 693 of file algstrct.cxx.
References CTF_int::cdealloc().
Referenced by CTF_int::summation::estimate_time(), CTF_int::scaling::execute(), CTF::Tensor< dtype >::get_local_data(), CTF_int::tensor::permute(), CTF_int::permute_keys(), CTF::Tensor< dtype >::read(), CTF_int::read_loc_pairs(), CTF::Tensor< dtype >::read_local(), CTF_int::tspsum_virt::run(), CTF_int::tspsum_permute::run(), CTF_int::tspsum_pin_keys::run(), CTF_int::tensor::slice(), CTF_int::summation::sum_tensors(), CTF_int::wr_pairs_layout(), and CTF::Tensor< dtype >::write().
|
inlinevirtual |
gets pair size el_size plus the key size
Reimplemented in CTF::Set< dtype, is_ord >.
Definition at line 46 of file algstrct.h.
References CTF_int::accumulatable::el_size.
Referenced by CTF_int::assign_keys(), CTF_int::tensor::compare(), CTF_int::depermute_keys(), CTF_int::depin(), CTF_int::spctr_replicate::est_time_fp(), CTF_int::spctr_2d_general::est_time_fp(), CTF_int::get_len_ordering(), CTF_int::tspsum_map::mem_fp(), CTF_int::tspsum_permute::mem_fp(), CTF_int::permute_keys(), CTF_int::summation::print(), CTF_int::readwrite(), CTF_int::tspsum_virt::run(), CTF_int::tspsum_replicate::run(), CTF_int::seq_tsr_spctr::run(), CTF_int::tspsum_map::run(), CTF_int::tspsum_permute::run(), CTF_int::spctr_pin_keys::run(), CTF_int::spctr_replicate::spmem_fp(), CTF_int::spctr_2d_general::spmem_fp(), CTF_int::spctr_pin_keys::spmem_fp(), CTF_int::spsfy_tsr(), and CTF_int::wr_pairs_layout().
|
virtual |
prints the value
Reimplemented in CTF::Set< dtype, is_ord >, CTF::Set< dtype, is_ord >, CTF::Set< dtype, is_ord >, CTF::Set< dtype, is_ord >, CTF::Set< dtype, is_ord >, CTF::Set< dtype, is_ord >, CTF::Set< dtype, is_ord >, CTF::Set< dtype, is_ord >, CTF::Set< dtype, is_ord >, CTF::Set< dtype, is_ord >, CTF::Set< dtype, is_ord >, CTF::Set< dtype, is_ord >, CTF::Set< dtype, is_ord >, CTF::Set< dtype, is_ord >, and CTF::Set< dtype, is_ord >.
Definition at line 170 of file algstrct.cxx.
Referenced by CTF_int::tensor::compare(), CTF_int::CSR_Matrix::print(), and CTF::Matrix< dtype >::print_matrix().
|
virtual |
b = -a, with checks for NULL and alloc as necessary
Reimplemented in CTF::Ring< dtype, is_ord >, and CTF::Group< dtype, is_ord >.
Definition at line 97 of file algstrct.cxx.
References ASSERT.
Referenced by CTF_int::summation::estimate_time(), CTF_int::Sum_Term::operator-(), and CTF::Idx_Tensor::operator-=().
void CTF_int::algstrct::safecopy | ( | char *& | a, |
char const * | b | ||
) | const |
copies element b to element a, , with checks for NULL and alloc as necessary
Definition at line 529 of file algstrct.cxx.
References CTF_int::alloc(), CTF_int::cdealloc(), and ctf.core::copy().
Referenced by CTF_int::Bifun_Term::Bifun_Term(), CTF_int::contract_down_terms(), CTF_int::Contract_Term::Contract_Term(), CTF_int::summation::estimate_time(), CTF_int::Contract_Term::execute(), CTF_int::get_len_ordering(), CTF::Idx_Tensor::Idx_Tensor(), CTF::Idx_Tensor::operator+=(), CTF::Idx_Tensor::operator-=(), CTF_int::Term::operator<<(), CTF::Idx_Tensor::operator=(), CTF::Typ_Idx_Tensor< dtype_C >::operator=(), CTF_int::Sum_Term::Sum_Term(), and CTF_int::Unifun_Term::Unifun_Term().
|
virtual |
c = a*b, with NULL treated as mulid
Reimplemented in CTF::Semiring< dtype, is_ord >.
Definition at line 126 of file algstrct.cxx.
References ASSERT.
Referenced by CTF_int::contract_down_terms(), CTF_int::Sum_Term::execute(), CTF_int::Contract_Term::execute(), and CTF::Idx_Tensor::operator-=().
|
virtual |
X["i"]=alpha*X["i"];.
Reimplemented in CTF::Semiring< dtype, is_ord >.
Definition at line 262 of file algstrct.cxx.
References ASSERT, and ctf.core::copy().
Referenced by CTF_int::spctr_replicate::run(), CTF_int::seq_tsr_spctr::run(), CTF_int::ctr_replicate::run(), CTF_int::scal_diag(), CTF_int::spA_dnB_dnC_seq_ctr(), CTF_int::spA_dnB_seq_sum(), CTF_int::sym_seq_ctr_cust(), CTF_int::sym_seq_ctr_inr(), CTF_int::sym_seq_ctr_ref(), and CTF_int::sym_seq_sum_ref().
|
virtual |
sets n elements of array a to value b
Reimplemented in CTF::Set< dtype, is_ord >.
Definition at line 629 of file algstrct.cxx.
Referenced by CTF_int::block_reshuffle(), CTF_int::cyclic_reshuffle(), dgtog_reshuffle(), CTF_int::padded_reshuffle(), CTF_int::spctr_replicate::run(), CTF_int::tspsum_replicate::run(), CTF_int::seq_tsr_spctr::run(), CTF_int::tsum_replicate::run(), CTF_int::ctr_replicate::run(), CTF_int::spA_dnB_dnC_seq_ctr(), CTF_int::spA_dnB_seq_sum(), CTF_int::sym_seq_ctr_cust(), CTF_int::sym_seq_ctr_inr(), CTF_int::sym_seq_ctr_ref(), CTF_int::sym_seq_sum_ref(), CTF_int::tensor::tensor(), and CTF_int::zero_padding().
|
virtual |
sets 1 elements of pair a to value and key
Reimplemented in CTF::Set< dtype, is_ord >.
Definition at line 658 of file algstrct.cxx.
Referenced by CTF_int::assign_keys(), CTF_int::permute_keys(), and CTF_int::spsfy_tsr().
|
virtual |
sets n elements of array of pairs a to value b
Reimplemented in CTF::Set< dtype, is_ord >.
Definition at line 663 of file algstrct.cxx.
|
virtual |
sorts n sets of pairs using std::sort
Reimplemented in CTF::Set< dtype, is_ord >.
Definition at line 188 of file algstrct.cxx.
References ASSERT, CTF_int::CompPtrPair::idx, CTF_int::CompPtrPair::key, and CTF_int::PairIterator::write_val().
void(* CTF_int::algstrct::abs) (char const *a, char *b) |
b = max(a,addinv(a))
brief datatype for pairs, always custom create3d
Definition at line 42 of file algstrct.h.
Referenced by CTF_int::tensor::compare(), CTF::Group< dtype, is_ord >::Group(), CTF_int::tensor::reduce_sumabs(), CTF::Ring< dtype, is_ord >::Ring(), and CTF::Set< dtype, is_ord >::Set().
bool CTF_int::algstrct::has_coo_ker |
whether there was a custom COO CSRMM kernel provided for this algebraic structure
Definition at line 37 of file algstrct.h.
Referenced by CTF_int::get_len_ordering().