Cyclops Tensor Framework
parallel arithmetic on multidimensional arrays
semiring.cxx File Reference
#include "set.h"
#include "../shared/blas_symbs.h"
#include "../shared/offload.h"
#include "../sparse_formats/csr.h"
Include dependency graph for semiring.cxx:

Go to the source code of this file.

Namespaces

 CTF_int
 
 CTF
 

Macros

#define INST_GEMM_BATCH(dtype)
 
#define INST_GEMM(dtype)
 
#define DEF_COOMM_KERNEL()
 
#define CSR_MULTD_DEF(dtype, is_ord, MKL_name)
 
#define CSR_MULTCSR_DEF(dtype, is_ord, MKL_name)
 

Functions

template<typename dtype >
void CTF_int::gemm_batch (char taA, char taB, int l, int m, int n, int k, dtype alpha, dtype const *A, dtype const *B, dtype beta, dtype *C)
 
template<typename dtype >
void CTF_int::gemm (char tA, char tB, int m, int n, int k, dtype alpha, dtype const *A, dtype const *B, dtype beta, dtype *C)
 
template<>
void CTF_int::default_axpy< float > (int n, float alpha, float const *X, int incX, float *Y, int incY)
 
template<>
void CTF_int::default_axpy< double > (int n, double alpha, double const *X, int incX, double *Y, int incY)
 
template<>
void CTF_int::default_axpy< std::complex< float > > (int n, std::complex< float > alpha, std::complex< float > const *X, int incX, std::complex< float > *Y, int incY)
 
template<>
void CTF_int::default_axpy< std::complex< double > > (int n, std::complex< double > alpha, std::complex< double > const *X, int incX, std::complex< double > *Y, int incY)
 
template<>
void CTF_int::default_scal< float > (int n, float alpha, float *X, int incX)
 
template<>
void CTF_int::default_scal< double > (int n, double alpha, double *X, int incX)
 
template<>
void CTF_int::default_scal< std::complex< float > > (int n, std::complex< float > alpha, std::complex< float > *X, int incX)
 
template<>
void CTF_int::default_scal< std::complex< double > > (int n, std::complex< double > alpha, std::complex< double > *X, int incX)
 
template<>
void CTF_int::default_coomm< float > (int m, int n, int k, float alpha, float const *A, int const *rows_A, int const *cols_A, int nnz_A, float const *B, float beta, float *C)
 
template<>
void CTF_int::default_coomm< double > (int m, int n, int k, double alpha, double const *A, int const *rows_A, int const *cols_A, int nnz_A, double const *B, double beta, double *C)
 
template<>
void CTF_int::default_coomm< std::complex< float > > (int m, int n, int k, std::complex< float > alpha, std::complex< float > const *A, int const *rows_A, int const *cols_A, int nnz_A, std::complex< float > const *B, std::complex< float > beta, std::complex< float > *C)
 
template<>
void CTF_int::default_coomm< std::complex< double > > (int m, int n, int k, std::complex< double > alpha, std::complex< double > const *A, int const *rows_A, int const *cols_A, int nnz_A, std::complex< double > const *B, std::complex< double > beta, std::complex< double > *C)
 
template<typename dtype >
void CTF_int::muladd_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)
 
template<typename dtype >
void CTF_int::muladd_csrmultd (int m, int n, int k, 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 *C)
 

Macro Definition Documentation

#define CSR_MULTCSR_DEF (   dtype,
  is_ord,
  MKL_name 
)
Value:
template<> \
(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 { \
this->gen_csrmultcsr(m,n,k,alpha,A,JA,IA,nnz_A,B,JB,IB,nnz_B,beta,C_CSR); \
}
Semiring is a Monoid with an addition multiplicaton function addition must have an identity and be as...
Definition: semiring.h:359
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
Definition: semiring.h:723

Definition at line 625 of file semiring.cxx.

#define CSR_MULTD_DEF (   dtype,
  is_ord,
  MKL_name 
)
Value:
template<> \
(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 { \
if (alpha == this->taddid){ \
if (beta != this->tmulid) \
CTF_int::default_scal<dtype>(m*n, beta, C, 1); \
return; \
} \
if (alpha != this->tmulid || beta != this->tmulid){ \
CTF_int::default_scal<dtype>(m*n, beta/alpha, C, 1); \
} \
CTF_int::muladd_csrmultd<dtype>(m,n,k,A,JA,IA,nnz_A,B,JB,IB,nnz_B,C); \
if (alpha != this->tmulid){ \
CTF_int::default_scal<dtype>(m*n, alpha, C, 1); \
} \
}
Semiring is a Monoid with an addition multiplicaton function addition must have an identity and be as...
Definition: semiring.h:359

Definition at line 534 of file semiring.cxx.

#define DEF_COOMM_KERNEL ( )
Value:
for (int j=0; j<n; j++){ \
for (int i=0; i<m; i++){ \
C[j*m+i] *= beta; \
} \
} \
for (int i=0; i<nnz_A; i++){ \
int row_A = rows_A[i]-1; \
int col_A = cols_A[i]-1; \
for (int col_C=0; col_C<n; col_C++){ \
C[col_C*m+row_A] += alpha*A[i]*B[col_C*k+col_A]; \
} \
}

Definition at line 192 of file semiring.cxx.

Referenced by CTF_int::default_coomm< double >(), CTF_int::default_coomm< float >(), CTF_int::default_coomm< std::complex< double > >(), and CTF_int::default_coomm< std::complex< float > >().

#define INST_GEMM (   dtype)
Value:
template void gemm<dtype>( char , \
char , \
int , \
int , \
int , \
dtype , \
dtype const *, \
dtype const *, \
dtype , \
dtype *);

Definition at line 107 of file semiring.cxx.

#define INST_GEMM_BATCH (   dtype)
Value:
template void gemm_batch<dtype>( char , \
char , \
int , \
int , \
int , \
int , \
dtype , \
dtype const *, \
dtype const *, \
dtype , \
dtype *);

Definition at line 63 of file semiring.cxx.