Cyclops Tensor Framework
parallel arithmetic on multidimensional arrays
CTF_int::algstrct Class Referenceabstract

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>

Inheritance diagram for CTF_int::algstrct:
Collaboration diagram for CTF_int::algstrct:

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 algstrctclone () 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...
 

Detailed Description

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.

Constructor & Destructor Documentation

CTF_int::algstrct::algstrct ( )
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

Parameters
[in]el_sizenumber of bytes in each element in the algstrct set

Definition at line 68 of file algstrct.cxx.

CTF_int::algstrct::~algstrct ( )
inlinepure virtual

destructor

Definition at line 427 of file algstrct.h.

References CTF_int::depin().

Member Function Documentation

void CTF_int::algstrct::acc ( char *  b,
char const *  beta,
char const *  a,
char const *  alpha 
) const
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.

void CTF_int::algstrct::accum ( char const *  a,
char *  b 
) const
virtual

b+=a

Reimplemented from CTF_int::accumulatable.

Definition at line 115 of file algstrct.cxx.

void CTF_int::algstrct::addinv ( char const *  a,
char *  b 
) const
virtual
char * CTF_int::algstrct::alloc ( int64_t  n) const
virtual

allocate space for n items, necessary for object types

Parameters
[in]nnumber of items
Returns
array containing n 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().

void CTF_int::algstrct::axpy ( int  n,
char const *  alpha,
char const *  X,
int  incX,
char *  Y,
int  incY 
) const
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().

double CTF_int::algstrct::cast_to_double ( char const *  c) const
virtual
int64_t CTF_int::algstrct::cast_to_int ( char const *  c) const
virtual
void CTF_int::algstrct::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
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().

void CTF_int::algstrct::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
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().

void CTF_int::algstrct::copy ( char *  a,
char const *  b,
int64_t  n 
) const
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().

void CTF_int::algstrct::copy ( int64_t  n,
char const *  a,
int  inc_a,
char *  b,
int  inc_b 
) const
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().

void CTF_int::algstrct::copy ( int64_t  m,
int64_t  n,
char const *  a,
int64_t  lda_a,
char *  b,
int64_t  lda_b 
) const
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().

void CTF_int::algstrct::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
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().

void CTF_int::algstrct::copy_pair ( char *  a,
char const *  b 
) const
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().

void CTF_int::algstrct::copy_pairs ( char *  a,
char const *  b,
int64_t  n 
) const
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().

char * CTF_int::algstrct::csr_add ( char *  cA,
char *  cB 
) const
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().

char * CTF_int::algstrct::csr_reduce ( char *  cA,
int  root,
MPI_Comm  cm 
) const
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().

void CTF_int::algstrct::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
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().

void CTF_int::algstrct::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
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().

void CTF_int::algstrct::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

Reimplemented in CTF::Semiring< dtype, is_ord >.

Definition at line 733 of file algstrct.cxx.

References ASSERT.

Referenced by CTF_int::CSR_Matrix::csrmultcsr().

void CTF_int::algstrct::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
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().

void CTF_int::algstrct::dealloc ( char *  ptr) const
virtual

deallocate given pointer containing contiguous array of values

Parameters
[in]ptrarray 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().

void CTF_int::algstrct::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

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.

void CTF_int::algstrct::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
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().

char const * CTF_int::algstrct::get_const_value ( char const *  a) const
virtual

Reimplemented in CTF::Set< dtype, is_ord >.

Definition at line 677 of file algstrct.cxx.

int64_t CTF_int::algstrct::get_key ( char const *  a) const
virtual

gets key from pair

Reimplemented in CTF::Set< dtype, is_ord >.

Definition at line 669 of file algstrct.cxx.

References ctf.core::a.

char * CTF_int::algstrct::get_value ( char *  a) const
virtual

gets pair to value from pair

Reimplemented in CTF::Set< dtype, is_ord >.

Definition at line 673 of file algstrct.cxx.

virtual bool CTF_int::algstrct::has_mul ( ) const
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=().

void CTF_int::algstrct::init ( int64_t  n,
char *  arr 
) const
virtual

initialize n objects to zero

Parameters
[in]nnumber of items
[in]arrarray 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 bool CTF_int::algstrct::is_ordered ( ) const
pure virtual
void CTF_int::algstrct::max ( char const *  a,
char const *  b,
char *  c 
) const
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().

void CTF_int::algstrct::max ( char *  c) const
virtual

c = maximum possible value

Reimplemented in CTF::Set< dtype, is_ord >.

Definition at line 182 of file algstrct.cxx.

References ASSERT.

void CTF_int::algstrct::min ( char const *  a,
char const *  b,
char *  c 
) const
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().

void CTF_int::algstrct::min ( char *  c) const
virtual

c = minimum possible value

Reimplemented in CTF::Set< dtype, is_ord >.

Definition at line 176 of file algstrct.cxx.

References ASSERT.

char const * CTF_int::algstrct::mulid ( ) const
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().

void CTF_int::algstrct::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
char * CTF_int::algstrct::pair_alloc ( int64_t  n) const
virtual

allocate space for n (int64_t,dtype) pairs, necessary for object types

Parameters
[in]nnumber of pairs
Returns
array containing n pair items

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().

void CTF_int::algstrct::safeaddinv ( char const *  a,
char *&  b 
) const
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::safemul ( char const *  a,
char const *  b,
char *&  c 
) const
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-=().

void CTF_int::algstrct::scal ( int  n,
char const *  alpha,
char *  X,
int  incX 
) const
virtual
void CTF_int::algstrct::set_pair ( char *  a,
int64_t  key,
char const *  vb 
) const
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().

void CTF_int::algstrct::set_pairs ( char *  a,
char const *  b,
int64_t  n 
) const
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.

void CTF_int::algstrct::sort ( int64_t  n,
char *  pairs 
) const
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().

Field Documentation

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().


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