Cyclops Tensor Framework
parallel arithmetic on multidimensional arrays
|
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>
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 |
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.
|
inline |
constructor takes function pointers to compute B=f(A));
[in] | f_ | linear function (type_A)->(type_B) |
Definition at line 397 of file functions.h.
|
inline |
constructor takes function pointers to compute C=f(A,B);
[in] | f_ | bivariate function (type_A,type_B)->(type_C) |
[in] | is_comm | whether function is commutative |
Definition at line 407 of file functions.h.
|
inlinevirtual |
compute f(a,b)
[in] | a | pointer to first operand |
[in] | b | pointer to second operand |
[in,out] | c | value that is accumulated to |
[in] | sr_B | algebraic structure for b, here is ignored |
Implements CTF_int::bivar_function.
Definition at line 420 of file functions.h.
References CTF::Endomorphism< dtype >::f.
|
inlinevirtual |
apply function f to value stored at a, for an accumulator, this is the same as acc_f below
[in] | a | pointer to operand that will be cast to dtype |
[in] | b | pointer to second operand that will be cast to dtype |
[in,out] | c | result &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.
|
inlinevirtual |
Reimplemented from CTF_int::bivar_function.
Definition at line 433 of file functions.h.
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.