2 #include "../shared/blas_symbs.h" 3 #include "../shared/mkl_symbs.h" 4 #include "../shared/util.h" 14 MPI_Datatype MPI_CTF_BOOL = MPI_CXX_BOOL;
15 MPI_Datatype MPI_CTF_DOUBLE_COMPLEX = MPI_CXX_DOUBLE_COMPLEX;
16 MPI_Datatype MPI_CTF_LONG_DOUBLE_COMPLEX = MPI_CXX_LONG_DOUBLE_COMPLEX;
20 void def_coo_to_csr_fl(int64_t nz,
int nrow,
float * csr_vs,
int * csr_ja,
int * csr_ia,
float * coo_vs,
int * coo_rs,
int * coo_cs,
bool to_csr){
25 int job[8]={2,1,1,0,inz,0,0,0};
26 CTF_BLAS::MKL_SCSRCOO(job, &nrow, csr_vs, csr_ja, csr_ia, &inz, (
float*)coo_vs, coo_rs, coo_cs, &info);
28 int job[8]={0,1,1,0,inz,3,0,0};
29 CTF_BLAS::MKL_SCSRCOO(job, &nrow, csr_vs, csr_ja, csr_ia, &inz, (
float*)coo_vs, coo_rs, coo_cs, &info);
32 void def_coo_to_csr_dbl(int64_t nz,
int nrow,
double * csr_vs,
int * csr_ja,
int * csr_ia,
double * coo_vs,
int * coo_rs,
int * coo_cs,
bool to_csr){
37 int job[8]={2,1,1,0,inz,0,0,0};
38 CTF_BLAS::MKL_DCSRCOO(job, &nrow, csr_vs, csr_ja, csr_ia, &inz, (
double*)coo_vs, coo_rs, coo_cs, &info);
42 int job[8]={0,1,1,0,inz,3,0,0};
43 CTF_BLAS::MKL_DCSRCOO(job, &nrow, csr_vs, csr_ja, csr_ia, &inz, (
double*)coo_vs, coo_rs, coo_cs, &info);
56 void def_coo_to_csr_cdbl(int64_t nz,
int nrow, std::complex<double> * csr_vs,
int * csr_ja,
int * csr_ia, std::complex<double> * coo_vs,
int * coo_rs,
int * coo_cs,
bool to_csr){
61 int job[8]={2,1,1,0,inz,0,0,0};
62 CTF_BLAS::MKL_ZCSRCOO(job, &nrow, csr_vs, csr_ja, csr_ia, &inz, (std::complex<double>*)coo_vs, coo_rs, coo_cs, &info);
64 int job[8]={0,1,1,0,inz,3,0,0};
65 CTF_BLAS::MKL_ZCSRCOO(job, &nrow, csr_vs, csr_ja, csr_ia, &inz, (std::complex<double>*)coo_vs, coo_rs, coo_cs, &info);
70 bool try_mkl_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,
int el_size){
74 def_coo_to_csr_fl(nz,nrow,(
float*)csr_vs,csr_ja,csr_ia,(
float*)coo_vs,(
int*)coo_rs,(
int*)coo_cs,1);
78 def_coo_to_csr_dbl(nz,nrow,(
double*)csr_vs,csr_ja,csr_ia,(
double*)coo_vs,(
int*)coo_rs,(
int*)coo_cs,1);
82 def_coo_to_csr_cdbl(nz,nrow,(std::complex<double>*)csr_vs,csr_ja,csr_ia,(std::complex<double>*)coo_vs,(
int*)coo_rs,(
int*)coo_cs,1);
91 bool try_mkl_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,
int el_size){
95 def_coo_to_csr_fl(nz,nrow,(
float*)csr_vs,(
int*)csr_ja,(
int*)csr_ia,(
float*)coo_vs,coo_rs,coo_cs,0);
99 def_coo_to_csr_dbl(nz,nrow,(
double*)csr_vs,(
int*)csr_ja,(
int*)csr_ia,(
double*)coo_vs,coo_rs,coo_cs,0);
103 def_coo_to_csr_cdbl(nz,nrow,(std::complex<double>*)csr_vs,(
int*)csr_ja,(
int*)csr_ia,(std::complex<double>*)coo_vs,coo_rs,coo_cs,0);
131 CTF_BLAS::ZCOPY(&n, (std::complex<double>
const*)a, &inc_a, (std::complex<double>*)b, &inc_b);
Set class defined by a datatype and a min/max function (if it is partially ordered i...
void MKL_SCSRCOO(int const *job, int *n, float *acsr, int const *ja, int const *ia, int *nnz, float *acoo, int const *rowind, int const *colind, int *info)
bool try_mkl_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, int el_size)
void copy(char *a, char const *b) const
copies element b to element a
void MKL_ZCSRCOO(int const *job, int *n, std::complex< double > *acsr, int const *ja, int const *ia, int *nnz, std::complex< double > *acoo, int const *rowind, int const *colind, int *info)
void SCOPY(const int *n, const float *dX, const int *incX, float *dY, const int *incY)
void MKL_DCSRCOO(int const *job, int *n, double *acsr, int const *ja, int const *ia, int *nnz, double *acoo, int const *rowind, int const *colind, int *info)
bool try_mkl_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, int el_size)
void DCOPY(const int *n, const double *dX, const int *incX, double *dY, const int *incY)
MPI_Datatype MPI_CTF_LONG_DOUBLE_COMPLEX
void ZCOPY(const int *n, const std::complex< double > *dX, const int *incX, std::complex< double > *dY, const int *incY)
MPI_Datatype MPI_CTF_BOOL
MPI_Datatype MPI_CTF_DOUBLE_COMPLEX