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

untyped internal class for triply-typed bivariate function More...

#include <ctr_comm.h>

Inheritance diagram for CTF_int::bivar_function:

Public Member Functions

virtual void apply_f (char const *a, char const *b, char *c) const =0
 apply function f to values stored at a and b More...
 
virtual void acc_f (char const *a, char const *b, char *c, CTF_int::algstrct const *sr_C) const =0
 compute c = c+f(a,b) More...
 
void operator() (Term const &A, Term const &B, Term const &C) const
 evaluate C+=f(A,B) or f(A,B,C) if transform More...
 
Bifun_Term operator() (Term const &A, Term const &B) const
 evaluate f(A,B) More...
 
 bivar_function (bool is_comm=false, bool is_left_dist=false, bool is_right_dist=false)
 constructor sets function properties, pessimistic defaults More...
 
virtual ~bivar_function ()
 
virtual bool is_accumulator () const
 
virtual void cgemm (char tA, char tB, int m, int n, int k, char const *A, char const *B, char *C) const
 
virtual void coffload_gemm (char tA, char tB, int m, int n, int k, char const *A, char const *B, char *C) const
 
virtual void ccoomm (int m, int n, int k, char const *A, int const *rows_A, int const *cols_A, int64_t nnz_A, char const *B, char *C) const
 
virtual void ccsrmm (int m, int n, int k, char const *A, int const *JA, int const *IA, int64_t nnz_A, char const *B, char *C, algstrct const *sr_C) const
 
virtual void ccsrmultd (int m, int n, int k, char const *A, int const *JA, int const *IA, int nnz_A, char const *B, int const *JB, int const *IB, int nnz_B, char *C, algstrct const *sr_C) const
 
virtual void ccsrmultcsr (int m, int n, int k, char const *A, int const *JA, int const *IA, int nnz_A, char const *B, int const *JB, int const *IB, int nnz_B, char *&C_CSR, algstrct const *sr_C) const
 
virtual void coffload_csrmm (int m, int n, int k, char const *all_data, char const *B, char *C) const
 

Data Fields

bool has_kernel
 
bool has_off_gemm
 
bool commutative
 
bool left_distributive
 
bool right_distributive
 

Detailed Description

untyped internal class for triply-typed bivariate function

Definition at line 16 of file ctr_comm.h.

Constructor & Destructor Documentation

CTF_int::bivar_function::bivar_function ( bool  is_comm = false,
bool  is_left_dist = false,
bool  is_right_dist = false 
)
inline

constructor sets function properties, pessimistic defaults

Parameters
[in]is_commf(a,b)=f(b,a)?
[in]is_left_distf(a_i,b)=f( a_i,b)?
[in]is_right_distf(a,b_i)=f(a, b_i)?

Definition at line 64 of file ctr_comm.h.

virtual CTF_int::bivar_function::~bivar_function ( )
inlinevirtual

Definition at line 74 of file ctr_comm.h.

Member Function Documentation

virtual void CTF_int::bivar_function::acc_f ( char const *  a,
char const *  b,
char *  c,
CTF_int::algstrct const *  sr_C 
) const
pure virtual

compute c = c+f(a,b)

Parameters
[in]apointer to operand that will be cast to dtype
[in]bpointer to operand that will be cast to dtype
[in,out]cresult c+f(*a,b) of applying f on value of (different type) on a
[in]sr_Calgebraic structure for b, needed to do add

Implemented in CTF::Bivar_Transform< dtype_A, dtype_B, dtype_C >, and CTF::Bivar_Function< dtype_A, dtype_B, dtype_C >.

Referenced by CTF_int::sym_seq_ctr_cust().

virtual void CTF_int::bivar_function::apply_f ( char const *  a,
char const *  b,
char *  c 
) const
pure virtual

apply function f to values stored at a and b

Parameters
[in]apointer to first operand that will be cast to type by extending class
[in]bpointer to second operand that will be cast to type by extending class
[in,out]cresult: c=&f(*a,*b)

Implemented in CTF::Bivar_Transform< dtype_A, dtype_B, dtype_C >, and CTF::Bivar_Function< dtype_A, dtype_B, dtype_C >.

virtual void CTF_int::bivar_function::ccoomm ( int  m,
int  n,
int  k,
char const *  A,
int const *  rows_A,
int const *  cols_A,
int64_t  nnz_A,
char const *  B,
char *  C 
) const
inlinevirtual

Reimplemented in CTF::Bivar_Kernel< dtype_A, dtype_B, dtype_C, f, g >.

Definition at line 96 of file ctr_comm.h.

References ccsrmm().

Referenced by CTF_int::COO_Matrix::coomm().

virtual void CTF_int::bivar_function::ccsrmm ( int  m,
int  n,
int  k,
char const *  A,
int const *  JA,
int const *  IA,
int64_t  nnz_A,
char const *  B,
char *  C,
algstrct const *  sr_C 
) const
inlinevirtual
virtual void CTF_int::bivar_function::ccsrmultcsr ( int  m,
int  n,
int  k,
char const *  A,
int const *  JA,
int const *  IA,
int  nnz_A,
char const *  B,
int const *  JB,
int const *  IB,
int  nnz_B,
char *&  C_CSR,
algstrct const *  sr_C 
) const
inlinevirtual
virtual void CTF_int::bivar_function::ccsrmultd ( int  m,
int  n,
int  k,
char const *  A,
int const *  JA,
int const *  IA,
int  nnz_A,
char const *  B,
int const *  JB,
int const *  IB,
int  nnz_B,
char *  C,
algstrct const *  sr_C 
) const
inlinevirtual
virtual void CTF_int::bivar_function::cgemm ( char  tA,
char  tB,
int  m,
int  n,
int  k,
char const *  A,
char const *  B,
char *  C 
) const
inlinevirtual

Reimplemented in CTF::Bivar_Kernel< dtype_A, dtype_B, dtype_C, f, g >.

Definition at line 78 of file ctr_comm.h.

Referenced by CTF_int::sym_seq_ctr_inr().

virtual void CTF_int::bivar_function::coffload_csrmm ( int  m,
int  n,
int  k,
char const *  all_data,
char const *  B,
char *  C 
) const
inlinevirtual

Reimplemented in CTF::Bivar_Kernel< dtype_A, dtype_B, dtype_C, f, g >.

Definition at line 150 of file ctr_comm.h.

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

virtual void CTF_int::bivar_function::coffload_gemm ( char  tA,
char  tB,
int  m,
int  n,
int  k,
char const *  A,
char const *  B,
char *  C 
) const
inlinevirtual

Reimplemented in CTF::Bivar_Kernel< dtype_A, dtype_B, dtype_C, f, g >.

Definition at line 87 of file ctr_comm.h.

Referenced by CTF_int::sym_seq_ctr_inr().

virtual bool CTF_int::bivar_function::is_accumulator ( ) const
inlinevirtual

Reimplemented in CTF::Bivar_Transform< dtype_A, dtype_B, dtype_C >.

Definition at line 76 of file ctr_comm.h.

void CTF_int::bivar_function::operator() ( Term const &  A,
Term const &  B,
Term const &  C 
) const

evaluate C+=f(A,B) or f(A,B,C) if transform

Parameters
[in]Aoperand tensor with pre-defined indices
[in]Boperand tensor with pre-defined indices
[in]Coutput tensor with pre-defined indices

Definition at line 15 of file ctr_comm.cxx.

References CTF_int::Term::clone(), CTF_int::Term::execute(), CTF_int::Bifun_Term::execute(), and CTF_int::Term::get_uniq_inds().

Bifun_Term CTF_int::bivar_function::operator() ( Term const &  A,
Term const &  B 
) const

evaluate f(A,B)

Parameters
[in]Aoperand tensor with pre-defined indices
[in]Boperand tensor with pre-defined indices
Returns
Bifun_Term that evaluates f(A)

Definition at line 11 of file ctr_comm.cxx.

References CTF_int::Term::clone().

Field Documentation

bool CTF_int::bivar_function::commutative

Definition at line 20 of file ctr_comm.h.

bool CTF_int::bivar_function::has_kernel

Definition at line 18 of file ctr_comm.h.

bool CTF_int::bivar_function::has_off_gemm
bool CTF_int::bivar_function::left_distributive

Definition at line 21 of file ctr_comm.h.

bool CTF_int::bivar_function::right_distributive

Definition at line 22 of file ctr_comm.h.


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