5 template <
typename dtype>
10 template <
typename dtype,
void (*fxpy)(
int, dtype const *, dtype *)>
18 template <
typename dtype>
22 for (
int i=0; i<n; i++){
27 template <
typename dtype>
46 template <>
inline MPI_Op get_default_maddop< std::complex<float> >(){
return MPI_SUM; }
47 template <>
inline MPI_Op get_default_maddop< std::complex<double> >(){
return MPI_SUM; }
49 template <
typename dtype>
53 MPI_Op_create(&default_mxpy<dtype, fxpy>, 1, &newop);
68 template <
typename dtype=
double,
bool is_ord=CTF_
int::get_default_is_ord<dtype>()>
82 fadd = &CTF_int::default_add<dtype>;
83 taddmop = CTF_int::get_default_maddop<dtype>();
87 fadd = &CTF_int::default_add<dtype>;
88 taddmop = CTF_int::get_default_maddop<dtype>();
96 :
Set<
dtype, is_ord>(), taddid(taddid_) {
108 return (
char const *)&
taddid;
115 void init(int64_t n,
char * arr)
const {
116 std::fill((
dtype*)arr,((
dtype*)arr)+n,taddid);
126 for (int64_t i=0; i<n; i++){
Set class defined by a datatype and a min/max function (if it is partially ordered i...
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 retur...
MPI_Op get_default_maddop< float >()
void init(int64_t n, char *arr) const
initialize n objects to zero
MPI_Op get_default_maddop< char >()
Monoid(dtype taddid_, dtype(*fadd_)(dtype a, dtype b), MPI_Op addmop_)
MPI_Op get_default_maddop< int64_t >()
MPI_Op get_default_maddop< double >()
MPI_Op get_default_maddop< unsigned int >()
MPI_Op get_maddop(void(*fxpy)(int, dtype const *, dtype *))
MPI_Op get_default_maddop< uint64_t >()
MPI_Op get_default_maddop< int >()
void add(char const *a, char const *b, char *c) const
c = a+b
virtual CTF_int::algstrct * clone() const
''copy constructor''
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 retur...
MPI_Op get_default_maddop< bool >()
char const * addid() const
MPI datatype for pairs.
Monoid(Monoid const &other)
MPI_Op addmop() const
MPI addition operation for reductions.
MPI_Op get_default_maddop()
void axpy(int n, char const *alpha, char const *X, int incX, char *Y, int incY) const
Y["i"]+=alpha*X["i"];.
dtype default_add(dtype a, dtype b)
MPI_Op get_default_maddop< long double >()
algstrct (algebraic structure) defines the elementwise operations computed in each tensor contraction...
A Monoid is a Set equipped with a binary addition operator '+' or a custom function addition must hav...
void default_mxpy(void *X, void *Y, int *n, MPI_Datatype *d)
dtype(* fadd)(dtype a, dtype b)
void default_fxpy(int n, dtype const *X, dtype *Y)