Cyclops Tensor Framework
parallel arithmetic on multidimensional arrays
CTF::Bivar_Transform< dtype_A, dtype_B, dtype_C > Class Template Reference

custom function f : (X * Y * Z) -> Z applied on three tensors as contraction: e.g. f(A["ij"],B["ij"],C["ij"]) More...

#include <functions.h>

Inheritance diagram for CTF::Bivar_Transform< dtype_A, dtype_B, dtype_C >:
Collaboration diagram for CTF::Bivar_Transform< dtype_A, dtype_B, dtype_C >:

Public Member Functions

 Bivar_Transform (std::function< void(dtype_A, dtype_B, dtype_C &)> f_)
 constructor takes function pointers to compute B=f(A)); More...
 
 Bivar_Transform (std::function< void(dtype_A, dtype_B, dtype_C &)> f_, bool is_comm)
 constructor takes function pointers to compute C=f(A,B); More...
 
void acc_f (char const *a, char const *b, char *c, CTF_int::algstrct const *sr_B) const
 compute f(a,b) More...
 
void apply_f (char const *a, char const *b, char *c) const
 apply function f to value stored at a, for an accumulator, this is the same as acc_f below More...
 
bool is_accumulator () const
 
- Public Member Functions inherited from CTF_int::bivar_function
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 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

std::function< void(dtype_A, dtype_B, dtype_C &)> f
 function signature for element-wise multiplication, compute b=f(a) More...
 
- Data Fields inherited from CTF_int::bivar_function
bool has_kernel
 
bool has_off_gemm
 
bool commutative
 
bool left_distributive
 
bool right_distributive
 

Detailed Description

template<typename dtype_A = double, typename dtype_B = dtype_A, typename dtype_C = dtype_A>
class CTF::Bivar_Transform< dtype_A, dtype_B, dtype_C >

custom function f : (X * Y * Z) -> Z applied on three tensors as contraction: e.g. f(A["ij"],B["ij"],C["ij"])

Definition at line 385 of file functions.h.

Constructor & Destructor Documentation

template<typename dtype_A = double, typename dtype_B = dtype_A, typename dtype_C = dtype_A>
CTF::Bivar_Transform< dtype_A, dtype_B, dtype_C >::Bivar_Transform ( std::function< void(dtype_A, dtype_B, dtype_C &)>  f_)
inline

constructor takes function pointers to compute B=f(A));

Parameters
[in]f_linear function (type_A)->(type_B)

Definition at line 397 of file functions.h.

template<typename dtype_A = double, typename dtype_B = dtype_A, typename dtype_C = dtype_A>
CTF::Bivar_Transform< dtype_A, dtype_B, dtype_C >::Bivar_Transform ( std::function< void(dtype_A, dtype_B, dtype_C &)>  f_,
bool  is_comm 
)
inline

constructor takes function pointers to compute C=f(A,B);

Parameters
[in]f_bivariate function (type_A,type_B)->(type_C)
[in]is_commwhether function is commutative

Definition at line 407 of file functions.h.

Member Function Documentation

template<typename dtype_A = double, typename dtype_B = dtype_A, typename dtype_C = dtype_A>
void CTF::Bivar_Transform< dtype_A, dtype_B, dtype_C >::acc_f ( char const *  a,
char const *  b,
char *  c,
CTF_int::algstrct const *  sr_B 
) const
inlinevirtual

compute f(a,b)

Parameters
[in]apointer to first operand
[in]bpointer to second operand
[in,out]cvalue that is accumulated to
[in]sr_Balgebraic structure for b, here is ignored

Implements CTF_int::bivar_function.

Definition at line 420 of file functions.h.

References CTF::Endomorphism< dtype >::f.

template<typename dtype_A = double, typename dtype_B = dtype_A, typename dtype_C = dtype_A>
void CTF::Bivar_Transform< dtype_A, dtype_B, dtype_C >::apply_f ( char const *  a,
char const *  b,
char *  c 
) const
inlinevirtual

apply function f to value stored at a, for an accumulator, this is the same as acc_f below

Parameters
[in]apointer to operand that will be cast to dtype
[in]bpointer to second operand that will be cast to dtype
[in,out]cresult &f(*a,*b) of applying f on value of (different type) on a

Implements CTF_int::bivar_function.

Definition at line 430 of file functions.h.

template<typename dtype_A = double, typename dtype_B = dtype_A, typename dtype_C = dtype_A>
bool CTF::Bivar_Transform< dtype_A, dtype_B, dtype_C >::is_accumulator ( ) const
inlinevirtual

Reimplemented from CTF_int::bivar_function.

Definition at line 433 of file functions.h.

Field Documentation

template<typename dtype_A = double, typename dtype_B = dtype_A, typename dtype_C = dtype_A>
std::function<void(dtype_A, dtype_B, dtype_C &)> CTF::Bivar_Transform< dtype_A, dtype_B, dtype_C >::f

function signature for element-wise multiplication, compute b=f(a)

Definition at line 391 of file functions.h.


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