Cyclops Tensor Framework
parallel arithmetic on multidimensional arrays
CTF::Semiring< dtype, is_ord > Class Template Reference

Semiring is a Monoid with an addition multiplicaton function addition must have an identity and be associative, does not need to be commutative multiplications must have an identity as well as be distributive and associative special case (parent) of a Ring (which also has an additive inverse) More...

#include <semiring.h>

Inheritance diagram for CTF::Semiring< dtype, is_ord >:
Collaboration diagram for CTF::Semiring< dtype, is_ord >:

Public Member Functions

 Semiring (Semiring const &other)
 
virtual CTF_int::algstrctclone () const
 ''copy constructor'' More...
 
 Semiring (dtype addid_, dtype(*fadd_)(dtype a, dtype b), MPI_Op addmop_, dtype mulid_, dtype(*fmul_)(dtype a, dtype b), void(*gemm_)(char, char, int, int, int, dtype, dtype const *, dtype const *, dtype, dtype *)=NULL, void(*axpy_)(int, dtype, dtype const *, int, dtype *, int)=NULL, void(*scal_)(int, dtype, dtype *, int)=NULL, void(*coomm_)(int, int, int, dtype, dtype const *, int const *, int const *, int, dtype const *, dtype, dtype *)=NULL, void(*fgemm_batch_)(char, char, int, int, int, int, dtype, dtype const *, dtype const *, dtype, dtype *)=NULL)
 constructor for algstrct equipped with * and + More...
 
 Semiring ()
 constructor for algstrct equipped with + only More...
 
void mul (char const *a, char const *b, char *c) const
 c = a*b More...
 
void safemul (char const *a, char const *b, char *&c) const
 c = a*b, with NULL treated as mulid More...
 
char const * mulid () const
 identity element for multiplication i.e. 1 More...
 
bool has_mul () const
 
void scal (int n, char const *alpha, char *X, int incX) const
 X["i"]=alpha*X["i"];. More...
 
void axpy (int n, char const *alpha, char const *X, int incX, char *Y, int incY) const
 Y["i"]+=alpha*X["i"];. More...
 
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...
 
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...
 
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
 
bool is_offloadable () const
 
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, CTF_int::bivar_function const *func) const
 sparse version of gemm using coordinate format for A More...
 
void default_csrmm (int m, int n, int k, dtype alpha, dtype const *A, int const *JA, int const *IA, int nnz_A, dtype const *B, dtype beta, dtype *C) const
 
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, CTF_int::bivar_function const *func) const
 sparse version of gemm using CSR format for A More...
 
void default_csrmultd (int m, int n, int k, dtype alpha, dtype const *A, int const *JA, int const *IA, int nnz_A, dtype const *B, int const *JB, int const *IB, int nnz_B, dtype beta, dtype *C) const
 
void gen_csrmultcsr (int m, int n, int k, dtype alpha, dtype const *A, int const *JA, int const *IA, int nnz_A, dtype const *B, int const *JB, int const *IB, int nnz_B, dtype beta, char *&C_CSR) const
 
void default_csrmultcsr (int m, int n, int k, dtype alpha, dtype const *A, int const *JA, int const *IA, int nnz_A, dtype const *B, int const *JB, int const *IB, int nnz_B, dtype beta, char *&C_CSR) const
 
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...
 
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
 
template<>
void default_csrmm (int m, int n, int k, float alpha, float const *A, int const *JA, int const *IA, int nnz_A, float const *B, float beta, float *C) const
 
template<>
void default_csrmm (int m, int n, int k, double alpha, double const *A, int const *JA, int const *IA, int nnz_A, double const *B, double beta, double *C) const
 
template<>
void default_csrmm (int m, int n, int k, std::complex< float > alpha, std::complex< float > const *A, int const *JA, int const *IA, int nnz_A, std::complex< float > const *B, std::complex< float > beta, std::complex< float > *C) const
 
template<>
void default_csrmm (int m, int n, int k, std::complex< double > alpha, std::complex< double > const *A, int const *JA, int const *IA, int nnz_A, std::complex< double > const *B, std::complex< double > beta, std::complex< double > *C) const
 
template<>
bool is_offloadable () const
 
template<>
bool is_offloadable () const
 
template<>
bool is_offloadable () const
 
template<>
bool is_offloadable () const
 
template<>
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
 
template<>
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
 
template<>
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
 
template<>
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
 
template<>
void default_csrmm (int, int, int, float, float const *, int const *, int const *, int, float const *, float, float *) const
 
template<>
void default_csrmm (int, int, int, double, double const *, int const *, int const *, int, double const *, double, double *) const
 
template<>
void default_csrmm (int, int, int, std::complex< float >, std::complex< float > const *, int const *, int const *, int, std::complex< float > const *, std::complex< float >, std::complex< float > *) const
 
template<>
void default_csrmm (int, int, int, std::complex< double >, std::complex< double > const *, int const *, int const *, int, std::complex< double > const *, std::complex< double >, std::complex< double > *) const
 
template<>
void default_csrmultd (int, int, int, float, float const *, int const *, int const *, int, float const *, int const *, int const *, int, float, float *) const
 
template<>
void default_csrmultd (int, int, int, double, double const *, int const *, int const *, int, double const *, int const *, int const *, int, double, double *) const
 
template<>
void default_csrmultd (int, int, int, std::complex< float >, std::complex< float > const *, int const *, int const *, int, std::complex< float > const *, int const *, int const *, int, std::complex< float >, std::complex< float > *) const
 
template<>
void default_csrmultd (int, int, int, std::complex< double >, std::complex< double > const *, int const *, int const *, int, std::complex< double > const *, int const *, int const *, int, std::complex< double >, std::complex< double > *) const
 
template<>
void default_csrmultcsr (int, int, int, float, float const *, int const *, int const *, int, float const *, int const *, int const *, int, float, char *&) const
 
template<>
void default_csrmultcsr (int, int, int, double, double const *, int const *, int const *, int, double const *, int const *, int const *, int, double, char *&) const
 
template<>
void default_csrmultcsr (int, int, int, std::complex< float >, std::complex< float > const *, int const *, int const *, int, std::complex< float > const *, int const *, int const *, int, std::complex< float >, char *&) const
 
template<>
void default_csrmultcsr (int, int, int, std::complex< double >, std::complex< double > const *, int const *, int const *, int, std::complex< double > const *, int const *, int const *, int, std::complex< double >, char *&) const
 
template<>
bool is_offloadable () const
 
template<>
bool is_offloadable () const
 
template<>
bool is_offloadable () const
 
template<>
bool is_offloadable () const
 
template<>
void offload_gemm (char, char, int, int, int, char const *, char const *, char const *, char const *, char *) const
 
template<>
void offload_gemm (char, char, int, int, int, char const *, char const *, char const *, char const *, char *) const
 
template<>
void offload_gemm (char, char, int, int, int, char const *, char const *, char const *, char const *, char *) const
 
template<>
void offload_gemm (char, char, int, int, int, char const *, char const *, char const *, char const *, char *) const
 
- Public Member Functions inherited from CTF::Monoid< dtype, is_ord >
 Monoid (Monoid const &other)
 
 Monoid ()
 
 Monoid (dtype taddid_)
 
 Monoid (dtype taddid_, dtype(*fadd_)(dtype a, dtype b), MPI_Op addmop_)
 
void add (char const *a, char const *b, char *c) const
 c = a+b More...
 
char const * addid () const
 MPI datatype for pairs. More...
 
MPI_Op addmop () const
 MPI addition operation for reductions. More...
 
void init (int64_t n, char *arr) const
 initialize n objects to zero More...
 
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...
 
template<>
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...
 
template<>
char * csr_add (char *, char *) 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...
 
- Public Member Functions inherited from CTF::Set< dtype, is_ord >
 ~Set ()
 
 Set (Set const &other)
 
int pair_size () const
 gets pair size el_size plus the key size More...
 
int64_t get_key (char const *a) const
 gets key from pair More...
 
char * get_value (char *a) const
 gets pair to value from pair More...
 
char const * get_const_value (char const *a) const
 
bool is_ordered () const
 
 Set ()
 
void set_abs_to_default ()
 
MPI_Datatype mdtype () const
 MPI datatype. More...
 
void min (char const *a, char const *b, char *c) const
 c = min(a,b) More...
 
void max (char const *a, char const *b, char *c) const
 c = max(a,b) More...
 
void min (char *c) const
 c = minimum possible value More...
 
void max (char *c) const
 c = maximum possible value More...
 
void cast_double (double d, char *c) const
 c = &d More...
 
void cast_int (int64_t i, char *c) const
 c = &i More...
 
double cast_to_double (char const *c) const
 return (double)*c More...
 
int64_t cast_to_int (char const *c) const
 return (int64_t)*c More...
 
void print (char const *a, FILE *fp=stdout) const
 prints the value More...
 
bool isequal (char const *a, char const *b) const
 returns true if algstrct elements a and b are equal More...
 
void coo_to_csr (int64_t nz, int nrow, char *csr_vs, int *csr_ja, int *csr_ia, char const *coo_vs, int const *coo_rs, int const *coo_cs) const
 converts coordinate sparse matrix layout to CSR layout More...
 
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...
 
char * pair_alloc (int64_t n) const
 allocate space for n (int64_t,dtype) pairs, necessary for object types More...
 
char * alloc (int64_t n) const
 allocate space for n items, necessary for object types More...
 
void dealloc (char *ptr) const
 deallocate given pointer containing contiguous array of values More...
 
void pair_dealloc (char *ptr) const
 deallocate given pointer containing contiguous array of pairs More...
 
void sort (int64_t n, char *pairs) const
 sorts n sets of pairs using std::sort More...
 
void copy (char *a, char const *b) const
 copies element b to element a More...
 
void copy (char *a, char const *b, int64_t n) const
 copies n elements from array b to array a More...
 
void copy_pair (char *a, char const *b) const
 copies pair b to element a More...
 
void copy_pairs (char *a, char const *b, int64_t n) const
 copies n pair from array b to array a More...
 
void set (char *a, char const *b, int64_t n) const
 sets n elements of array a to value b More...
 
void set_pair (char *a, int64_t key, char const *b) const
 sets 1 elements of pair a to value and key More...
 
void set_pairs (char *a, char const *b, int64_t n) const
 sets n elements of array of pairs a to value b More...
 
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...
 
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...
 
void init (int64_t n, char *arr) const
 initialize n objects to zero More...
 
virtual void init_shell (int64_t n, char *arr) const
 initialize n objects to zero More...
 
template<>
void print (char const *a, FILE *fp) const
 prints the value More...
 
template<>
void print (char const *a, FILE *fp) const
 prints the value More...
 
template<>
void print (char const *a, FILE *fp) const
 prints the value More...
 
template<>
void print (char const *a, FILE *fp) const
 prints the value More...
 
template<>
void print (char const *a, FILE *fp) const
 prints the value More...
 
template<>
void print (char const *a, FILE *fp) const
 prints the value More...
 
template<>
void print (char const *p, FILE *fp) const
 prints the value More...
 
template<>
void copy (int64_t nn, 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...
 
template<>
void copy (int64_t nn, 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...
 
template<>
void copy (int64_t nn, 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...
 
template<>
void copy (int64_t nn, 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...
 
template<>
void cast_double (double d, char *c) const
 c = &d More...
 
template<>
void cast_double (double d, char *c) const
 c = &d More...
 
template<>
void cast_double (double d, char *c) const
 c = &d More...
 
template<>
void cast_double (double d, char *c) const
 c = &d More...
 
template<>
void cast_double (double d, char *c) const
 c = &d More...
 
template<>
void cast_double (double d, char *c) const
 c = &d More...
 
template<>
void cast_double (double d, char *c) const
 c = &d More...
 
template<>
void cast_double (double d, char *c) const
 c = &d More...
 
template<>
void cast_double (double d, char *c) const
 c = &d More...
 
template<>
void cast_int (int64_t d, char *c) const
 c = &i More...
 
template<>
void cast_int (int64_t d, char *c) const
 c = &i More...
 
template<>
void cast_int (int64_t d, char *c) const
 c = &i More...
 
template<>
void cast_int (int64_t d, char *c) const
 c = &i More...
 
template<>
void cast_int (int64_t d, char *c) const
 c = &i More...
 
template<>
void cast_int (int64_t d, char *c) const
 c = &i More...
 
template<>
void cast_int (int64_t d, char *c) const
 c = &i More...
 
template<>
void cast_int (int64_t d, char *c) const
 c = &i More...
 
template<>
void cast_int (int64_t d, char *c) const
 c = &i More...
 
template<>
double cast_to_double (char const *c) const
 return (double)*c More...
 
template<>
double cast_to_double (char const *c) const
 return (double)*c More...
 
template<>
double cast_to_double (char const *c) const
 return (double)*c More...
 
template<>
double cast_to_double (char const *c) const
 return (double)*c More...
 
template<>
double cast_to_double (char const *c) const
 return (double)*c More...
 
template<>
int64_t cast_to_int (char const *c) const
 return (int64_t)*c More...
 
template<>
int64_t cast_to_int (char const *c) const
 return (int64_t)*c More...
 
template<>
int64_t cast_to_int (char const *c) const
 return (int64_t)*c More...
 
template<>
int64_t cast_to_int (char const *c) const
 return (int64_t)*c More...
 
template<>
int64_t cast_to_int (char const *c) const
 return (int64_t)*c More...
 
template<>
void print (char const *a, FILE *fp) const
 prints the value More...
 
template<>
void print (char const *a, FILE *fp) const
 prints the value More...
 
template<>
void print (char const *a, FILE *fp) const
 prints the value More...
 
template<>
void print (char const *a, FILE *fp) const
 prints the value More...
 
template<>
void print (char const *a, FILE *fp) const
 prints the value More...
 
template<>
void print (char const *a, FILE *fp) const
 prints the value More...
 
template<>
void print (char const *a, FILE *fp) const
 prints the value More...
 
template<>
bool isequal (char const *a, char const *b) const
 returns true if algstrct elements a and b are equal More...
 
template<>
bool isequal (char const *a, char const *b) const
 returns true if algstrct elements a and b are equal More...
 
template<>
bool isequal (char const *a, char const *b) const
 returns true if algstrct elements a and b are equal More...
 
template<>
bool isequal (char const *a, char const *b) const
 returns true if algstrct elements a and b are equal More...
 
template<>
bool isequal (char const *a, char const *b) const
 returns true if algstrct elements a and b are equal More...
 
template<>
bool isequal (char const *a, char const *b) const
 returns true if algstrct elements a and b are equal More...
 
template<>
bool isequal (char const *a, char const *b) const
 returns true if algstrct elements a and b are equal More...
 
template<>
bool isequal (char const *a, char const *b) const
 returns true if algstrct elements a and b are equal More...
 
template<>
bool isequal (char const *a, char const *b) const
 returns true if algstrct elements a and b are equal More...
 
- Public Member Functions inherited from CTF_int::algstrct
 algstrct ()
 default constructor More...
 
 algstrct (int el_size)
 constructor creates algstrct with all parameters More...
 
virtual ~algstrct ()=0
 destructor 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 accum (char const *a, char *b) const
 b+=a 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...
 
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...
 
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 (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...
 

Data Fields

bool is_def
 
dtype tmulid
 
void(* fscal )(int, dtype, dtype *, int)
 
void(* faxpy )(int, dtype, dtype const *, int, dtype *, int)
 
dtype(* fmul )(dtype a, dtype b)
 
void(* fgemm )(char, char, int, int, int, dtype, dtype const *, dtype const *, dtype, dtype *)
 
void(* fcoomm )(int, int, int, dtype, dtype const *, int const *, int const *, int, dtype const *, dtype, dtype *)
 
void(* fgemm_batch )(char, char, int, int, int, int, dtype, dtype const *, dtype const *, dtype, dtype *)
 
- Data Fields inherited from CTF::Monoid< dtype, is_ord >
dtype taddid
 
dtype(* fadd )(dtype a, dtype b)
 
MPI_Op taddmop
 
- Data Fields inherited from CTF::Set< dtype, is_ord >
int pair_sz
 
bool is_custom_mdtype
 
MPI_Datatype tmdtype
 
- Data Fields inherited from CTF_int::algstrct
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

template<typename dtype = double, bool is_ord = CTF_int::get_default_is_ord<dtype>()>
class CTF::Semiring< dtype, is_ord >

Semiring is a Monoid with an addition multiplicaton function addition must have an identity and be associative, does not need to be commutative multiplications must have an identity as well as be distributive and associative special case (parent) of a Ring (which also has an additive inverse)

Definition at line 359 of file semiring.h.

Constructor & Destructor Documentation

template<typename dtype = double, bool is_ord = CTF_int::get_default_is_ord<dtype>()>
CTF::Semiring< dtype, is_ord >::Semiring ( dtype  addid_,
dtype(*)(dtype a, dtype b)  fadd_,
MPI_Op  addmop_,
dtype  mulid_,
dtype(*)(dtype a, dtype b)  fmul_,
void(*)(char, char, int, int, int, dtype, dtype const *, dtype const *, dtype, dtype *)  gemm_ = NULL,
void(*)(int, dtype, dtype const *, int, dtype *, int)  axpy_ = NULL,
void(*)(int, dtype, dtype *, int)  scal_ = NULL,
void(*)(int, int, int, dtype, dtype const *, int const *, int const *, int, dtype const *, dtype, dtype *)  coomm_ = NULL,
void(*)(char, char, int, int, int, int, dtype, dtype const *, dtype const *, dtype, dtype *)  fgemm_batch_ = NULL 
)
inline

constructor for algstrct equipped with * and +

Parameters
[in]addid_additive identity
[in]fadd_binary addition function
[in]addmop_MPI_Op operation for addition
[in]mulid_multiplicative identity
[in]fmul_binary multiplication function
[in]gemm_block matrix multiplication function
[in]axpy_vector sum function
[in]scal_vector scale function
[in]coomm_kernel for multiplying sparse matrix in coordinate format with dense matrix

Definition at line 400 of file semiring.h.

template<typename dtype = double, bool is_ord = CTF_int::get_default_is_ord<dtype>()>
CTF::Semiring< dtype, is_ord >::Semiring ( )
inline

constructor for algstrct equipped with + only

Definition at line 426 of file semiring.h.

References ctf.core::dtype.

Member Function Documentation

template<typename dtype = double, bool is_ord = CTF_int::get_default_is_ord<dtype>()>
void CTF::Semiring< dtype, is_ord >::axpy ( int  n,
char const *  alpha,
char const *  X,
int  incX,
char *  Y,
int  incY 
) const
inlinevirtual

Y["i"]+=alpha*X["i"];.

Reimplemented from CTF::Monoid< dtype, is_ord >.

Definition at line 483 of file semiring.h.

template<typename dtype = double, bool is_ord = CTF_int::get_default_is_ord<dtype>()>
virtual CTF_int::algstrct* CTF::Semiring< dtype, is_ord >::clone ( ) const
inlinevirtual

''copy constructor''

Reimplemented from CTF::Monoid< dtype, is_ord >.

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

Definition at line 384 of file semiring.h.

template<typename dtype = double, bool is_ord = CTF_int::get_default_is_ord<dtype>()>
void CTF::Semiring< dtype, is_ord >::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,
CTF_int::bivar_function const *  func 
) const
inlinevirtual

sparse version of gemm using coordinate format for A

Reimplemented from CTF_int::algstrct.

Definition at line 605 of file semiring.h.

template<typename dtype = double, bool is_ord = CTF_int::get_default_is_ord<dtype>()>
void CTF::Semiring< dtype, is_ord >::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,
CTF_int::bivar_function const *  func 
) const
inlinevirtual

sparse version of gemm using CSR format for A

Reimplemented from CTF_int::algstrct.

Definition at line 669 of file semiring.h.

template<typename dtype = double, bool is_ord = CTF_int::get_default_is_ord<dtype>()>
void CTF::Semiring< dtype, is_ord >::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
inlinevirtual
template<typename dtype = double, bool is_ord = CTF_int::get_default_is_ord<dtype>()>
void CTF::Semiring< dtype, is_ord >::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
inlinevirtual

sparse version of gemm using CSR format for A and B

Reimplemented from CTF_int::algstrct.

Definition at line 931 of file semiring.h.

template<>
void CTF::Semiring< float, 1 >::default_csrmm ( int  m,
int  n,
int  k,
float  alpha,
float const *  A,
int const *  JA,
int const *  IA,
int  nnz_A,
float const *  B,
float  beta,
float *  C 
) const
template<>
void CTF::Semiring< double, 1 >::default_csrmm ( int  m,
int  n,
int  k,
double  alpha,
double const *  A,
int const *  JA,
int const *  IA,
int  nnz_A,
double const *  B,
double  beta,
double *  C 
) const

Definition at line 427 of file semiring.cxx.

References CTF_BLAS::MKL_DCSRMM().

template<>
void CTF::Semiring< std::complex< float >, 0 >::default_csrmm ( int  m,
int  n,
int  k,
std::complex< float >  alpha,
std::complex< float > const *  A,
int const *  JA,
int const *  IA,
int  nnz_A,
std::complex< float > const *  B,
std::complex< float >  beta,
std::complex< float > *  C 
) const

Definition at line 452 of file semiring.cxx.

References CTF_BLAS::MKL_CCSRMM().

template<>
void CTF::Semiring< std::complex< double >, 0 >::default_csrmm ( int  m,
int  n,
int  k,
std::complex< double >  alpha,
std::complex< double > const *  A,
int const *  JA,
int const *  IA,
int  nnz_A,
std::complex< double > const *  B,
std::complex< double >  beta,
std::complex< double > *  C 
) const

Definition at line 475 of file semiring.cxx.

References CTF_BLAS::MKL_ZCSRMM().

template<typename dtype = double, bool is_ord = CTF_int::get_default_is_ord<dtype>()>
void CTF::Semiring< dtype, is_ord >::default_csrmm ( int  m,
int  n,
int  k,
dtype  alpha,
dtype const *  A,
int const *  JA,
int const *  IA,
int  nnz_A,
dtype const *  B,
dtype  beta,
dtype *  C 
) const
inline
template<>
void CTF::Semiring< float, 1 >::default_csrmm ( int  ,
int  ,
int  ,
float  ,
float const *  ,
int const *  ,
int const *  ,
int  ,
float const *  ,
float  ,
float *   
) const
template<>
void CTF::Semiring< double, 1 >::default_csrmm ( int  ,
int  ,
int  ,
double  ,
double const *  ,
int const *  ,
int const *  ,
int  ,
double const *  ,
double  ,
double *   
) const
template<>
void CTF::Semiring< std::complex< float >, 0 >::default_csrmm ( int  ,
int  ,
int  ,
std::complex< float >  ,
std::complex< float > const *  ,
int const *  ,
int const *  ,
int  ,
std::complex< float > const *  ,
std::complex< float >  ,
std::complex< float > *   
) const
template<>
void CTF::Semiring< std::complex< double >, 0 >::default_csrmm ( int  ,
int  ,
int  ,
std::complex< double >  ,
std::complex< double > const *  ,
int const *  ,
int const *  ,
int  ,
std::complex< double > const *  ,
std::complex< double >  ,
std::complex< double > *   
) const
template<typename dtype = double, bool is_ord = CTF_int::get_default_is_ord<dtype>()>
void CTF::Semiring< dtype, is_ord >::default_csrmultcsr ( int  m,
int  n,
int  k,
dtype  alpha,
dtype const *  A,
int const *  JA,
int const *  IA,
int  nnz_A,
dtype const *  B,
int const *  JB,
int const *  IB,
int  nnz_B,
dtype  beta,
char *&  C_CSR 
) const
inline

Definition at line 912 of file semiring.h.

Referenced by CTF::Semiring< dtype, is_ord >::csrmultcsr().

template<>
void CTF::Semiring< float, 1 >::default_csrmultcsr ( int  ,
int  ,
int  ,
float  ,
float const *  ,
int const *  ,
int const *  ,
int  ,
float const *  ,
int const *  ,
int const *  ,
int  ,
float  ,
char *&   
) const
template<>
void CTF::Semiring< double, 1 >::default_csrmultcsr ( int  ,
int  ,
int  ,
double  ,
double const *  ,
int const *  ,
int const *  ,
int  ,
double const *  ,
int const *  ,
int const *  ,
int  ,
double  ,
char *&   
) const
template<>
void CTF::Semiring< std::complex< float >, 0 >::default_csrmultcsr ( int  ,
int  ,
int  ,
std::complex< float >  ,
std::complex< float > const *  ,
int const *  ,
int const *  ,
int  ,
std::complex< float > const *  ,
int const *  ,
int const *  ,
int  ,
std::complex< float >  ,
char *&   
) const
template<>
void CTF::Semiring< std::complex< double >, 0 >::default_csrmultcsr ( int  ,
int  ,
int  ,
std::complex< double >  ,
std::complex< double > const *  ,
int const *  ,
int const *  ,
int  ,
std::complex< double > const *  ,
int const *  ,
int const *  ,
int  ,
std::complex< double >  ,
char *&   
) const
template<typename dtype = double, bool is_ord = CTF_int::get_default_is_ord<dtype>()>
void CTF::Semiring< dtype, is_ord >::default_csrmultd ( int  m,
int  n,
int  k,
dtype  alpha,
dtype const *  A,
int const *  JA,
int const *  IA,
int  nnz_A,
dtype const *  B,
int const *  JB,
int const *  IB,
int  nnz_B,
dtype  beta,
dtype *  C 
) const
inline

Definition at line 687 of file semiring.h.

Referenced by CTF::Semiring< dtype, is_ord >::csrmultcsr().

template<>
void CTF::Semiring< float, 1 >::default_csrmultd ( int  ,
int  ,
int  ,
float  ,
float const *  ,
int const *  ,
int const *  ,
int  ,
float const *  ,
int const *  ,
int const *  ,
int  ,
float  ,
float *   
) const
template<>
void CTF::Semiring< double, 1 >::default_csrmultd ( int  ,
int  ,
int  ,
double  ,
double const *  ,
int const *  ,
int const *  ,
int  ,
double const *  ,
int const *  ,
int const *  ,
int  ,
double  ,
double *   
) const
template<>
void CTF::Semiring< std::complex< float >, 0 >::default_csrmultd ( int  ,
int  ,
int  ,
std::complex< float >  ,
std::complex< float > const *  ,
int const *  ,
int const *  ,
int  ,
std::complex< float > const *  ,
int const *  ,
int const *  ,
int  ,
std::complex< float >  ,
std::complex< float > *   
) const
template<>
void CTF::Semiring< std::complex< double >, 0 >::default_csrmultd ( int  ,
int  ,
int  ,
std::complex< double >  ,
std::complex< double > const *  ,
int const *  ,
int const *  ,
int  ,
std::complex< double > const *  ,
int const *  ,
int const *  ,
int  ,
std::complex< double >  ,
std::complex< double > *   
) const
template<typename dtype = double, bool is_ord = CTF_int::get_default_is_ord<dtype>()>
void CTF::Semiring< dtype, is_ord >::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
inlinevirtual

beta*C["ij"]=alpha*A^tA["ik"]*B^tB["kj"];

Reimplemented from CTF_int::algstrct.

Definition at line 503 of file semiring.h.

template<typename dtype = double, bool is_ord = CTF_int::get_default_is_ord<dtype>()>
void CTF::Semiring< dtype, is_ord >::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
inlinevirtual

beta*C["ijl"]=alpha*A^tA["ikl"]*B^tB["kjl"];

Reimplemented from CTF_int::algstrct.

Definition at line 566 of file semiring.h.

References CTF_int::gemm().

template<typename dtype = double, bool is_ord = CTF_int::get_default_is_ord<dtype>()>
void CTF::Semiring< dtype, is_ord >::gen_csrmultcsr ( int  m,
int  n,
int  k,
dtype  alpha,
dtype const *  A,
int const *  JA,
int const *  IA,
int  nnz_A,
dtype const *  B,
int const *  JB,
int const *  IB,
int  nnz_B,
dtype  beta,
char *&  C_CSR 
) const
inline
template<typename dtype = double, bool is_ord = CTF_int::get_default_is_ord<dtype>()>
bool CTF::Semiring< dtype, is_ord >::has_mul ( ) const
inlinevirtual

returns whether multiplication operator is present

Reimplemented from CTF_int::algstrct.

Definition at line 465 of file semiring.h.

template<typename dtype = double, bool is_ord = CTF_int::get_default_is_ord<dtype>()>
bool CTF::Semiring< dtype, is_ord >::is_offloadable ( ) const
inlinevirtual

Reimplemented from CTF_int::algstrct.

Definition at line 600 of file semiring.h.

Referenced by CTF::Semiring< dtype, is_ord >::csrmultcsr().

template<>
bool CTF::Semiring< float, 1 >::is_offloadable ( ) const
virtual

Reimplemented from CTF_int::algstrct.

Definition at line 656 of file semiring.cxx.

References CTF_int::default_gemm< float >().

template<>
bool CTF::Semiring< std::complex< float >, 0 >::is_offloadable ( ) const
virtual

Reimplemented from CTF_int::algstrct.

Definition at line 661 of file semiring.cxx.

template<>
bool CTF::Semiring< double, 1 >::is_offloadable ( ) const
virtual

Reimplemented from CTF_int::algstrct.

Definition at line 667 of file semiring.cxx.

References CTF_int::default_gemm< double >().

template<>
bool CTF::Semiring< std::complex< double >, 0 >::is_offloadable ( ) const
virtual

Reimplemented from CTF_int::algstrct.

Definition at line 672 of file semiring.cxx.

template<>
bool CTF::Semiring< double, 1 >::is_offloadable ( ) const
virtual

Reimplemented from CTF_int::algstrct.

template<>
bool CTF::Semiring< float, 1 >::is_offloadable ( ) const
virtual

Reimplemented from CTF_int::algstrct.

template<>
bool CTF::Semiring< std::complex< float >, 0 >::is_offloadable ( ) const
virtual

Reimplemented from CTF_int::algstrct.

template<>
bool CTF::Semiring< std::complex< double >, 0 >::is_offloadable ( ) const
virtual

Reimplemented from CTF_int::algstrct.

template<typename dtype = double, bool is_ord = CTF_int::get_default_is_ord<dtype>()>
void CTF::Semiring< dtype, is_ord >::mul ( char const *  a,
char const *  b,
char *  c 
) const
inlinevirtual

c = a*b

Reimplemented from CTF_int::algstrct.

Definition at line 437 of file semiring.h.

template<typename dtype = double, bool is_ord = CTF_int::get_default_is_ord<dtype>()>
char const* CTF::Semiring< dtype, is_ord >::mulid ( ) const
inlinevirtual

identity element for multiplication i.e. 1

Reimplemented from CTF_int::algstrct.

Definition at line 461 of file semiring.h.

template<typename dtype = double, bool is_ord = CTF_int::get_default_is_ord<dtype>()>
void CTF::Semiring< dtype, is_ord >::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
inlinevirtual

Reimplemented from CTF_int::algstrct.

Definition at line 586 of file semiring.h.

Referenced by CTF::Semiring< dtype, is_ord >::csrmultcsr().

template<>
void CTF::Semiring< float, 1 >::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

Reimplemented from CTF_int::algstrct.

Definition at line 677 of file semiring.cxx.

template<>
void CTF::Semiring< std::complex< float >, 0 >::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

Reimplemented from CTF_int::algstrct.

Definition at line 696 of file semiring.cxx.

template<>
void CTF::Semiring< double, 1 >::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

Reimplemented from CTF_int::algstrct.

Definition at line 715 of file semiring.cxx.

template<>
void CTF::Semiring< std::complex< double >, 0 >::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

Reimplemented from CTF_int::algstrct.

Definition at line 734 of file semiring.cxx.

template<>
void CTF::Semiring< double, 1 >::offload_gemm ( char  ,
char  ,
int  ,
int  ,
int  ,
char const *  ,
char const *  ,
char const *  ,
char const *  ,
char *   
) const
virtual

Reimplemented from CTF_int::algstrct.

template<>
void CTF::Semiring< double, 1 >::offload_gemm ( char  ,
char  ,
int  ,
int  ,
int  ,
char const *  ,
char const *  ,
char const *  ,
char const *  ,
char *   
) const
virtual

Reimplemented from CTF_int::algstrct.

template<>
void CTF::Semiring< std::complex< float >, 0 >::offload_gemm ( char  ,
char  ,
int  ,
int  ,
int  ,
char const *  ,
char const *  ,
char const *  ,
char const *  ,
char *   
) const
virtual

Reimplemented from CTF_int::algstrct.

template<>
void CTF::Semiring< std::complex< double >, 0 >::offload_gemm ( char  ,
char  ,
int  ,
int  ,
int  ,
char const *  ,
char const *  ,
char const *  ,
char const *  ,
char *   
) const
virtual

Reimplemented from CTF_int::algstrct.

template<typename dtype = double, bool is_ord = CTF_int::get_default_is_ord<dtype>()>
void CTF::Semiring< dtype, is_ord >::safemul ( char const *  a,
char const *  b,
char *&  c 
) const
inlinevirtual

c = a*b, with NULL treated as mulid

Reimplemented from CTF_int::algstrct.

Definition at line 443 of file semiring.h.

References CTF_int::alloc(), and CTF_int::cdealloc().

template<typename dtype = double, bool is_ord = CTF_int::get_default_is_ord<dtype>()>
void CTF::Semiring< dtype, is_ord >::scal ( int  n,
char const *  alpha,
char *  X,
int  incX 
) const
inlinevirtual

X["i"]=alpha*X["i"];.

Reimplemented from CTF_int::algstrct.

Definition at line 468 of file semiring.h.

Field Documentation

template<typename dtype = double, bool is_ord = CTF_int::get_default_is_ord<dtype>()>
void(* CTF::Semiring< dtype, is_ord >::faxpy) (int, dtype, dtype const *, int, dtype *, int)

Definition at line 364 of file semiring.h.

Referenced by CTF::Semiring< dtype, is_ord >::Semiring().

template<typename dtype = double, bool is_ord = CTF_int::get_default_is_ord<dtype>()>
void(* CTF::Semiring< dtype, is_ord >::fcoomm) (int, int, int, dtype, dtype const *, int const *, int const *, int, dtype const *, dtype, dtype *)

Definition at line 367 of file semiring.h.

Referenced by CTF::Semiring< dtype, is_ord >::Semiring().

template<typename dtype = double, bool is_ord = CTF_int::get_default_is_ord<dtype>()>
void(* CTF::Semiring< dtype, is_ord >::fgemm) (char, char, int, int, int, dtype, dtype const *, dtype const *, dtype, dtype *)

Definition at line 366 of file semiring.h.

Referenced by CTF::Semiring< dtype, is_ord >::Semiring().

template<typename dtype = double, bool is_ord = CTF_int::get_default_is_ord<dtype>()>
void(* CTF::Semiring< dtype, is_ord >::fgemm_batch) (char, char, int, int, int, int, dtype, dtype const *, dtype const *, dtype, dtype *)

Definition at line 368 of file semiring.h.

Referenced by CTF::Semiring< dtype, is_ord >::Semiring().

template<typename dtype = double, bool is_ord = CTF_int::get_default_is_ord<dtype>()>
dtype(* CTF::Semiring< dtype, is_ord >::fmul) (dtype a, dtype b)

Definition at line 365 of file semiring.h.

Referenced by CTF::Semiring< dtype, is_ord >::Semiring().

template<typename dtype = double, bool is_ord = CTF_int::get_default_is_ord<dtype>()>
void(* CTF::Semiring< dtype, is_ord >::fscal) (int, dtype, dtype *, int)

Definition at line 363 of file semiring.h.

Referenced by CTF::Semiring< dtype, is_ord >::Semiring().

template<typename dtype = double, bool is_ord = CTF_int::get_default_is_ord<dtype>()>
bool CTF::Semiring< dtype, is_ord >::is_def

Definition at line 361 of file semiring.h.

Referenced by CTF::Semiring< dtype, is_ord >::Semiring().

template<typename dtype = double, bool is_ord = CTF_int::get_default_is_ord<dtype>()>
dtype CTF::Semiring< dtype, is_ord >::tmulid

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