1 #include "../sparse_formats/csr.h" 3 #include "../shared/blas_symbs.h" 4 #include "../shared/mkl_symbs.h" 5 #include "../shared/util.h" 32 if (fadd != &default_add<double>){
40 alloc_ptr(
sizeof(
int)*(m+1), (
void**)&ic);
46 CTF_BLAS::MKL_DCSRADD(&tA, &job, &sort, &m, &n, (
double*)A.
vals(), A.
JA(), A.
IA(), &mlid, (
double*)B.
vals(), B.
JA(), B.
IA(), NULL, NULL, ic, NULL, &info);
48 memcpy(C.IA(), ic,
sizeof(int)*(m+1));
51 CTF_BLAS::MKL_DCSRADD(&tA, &job, &sort, &m, &n, (
double*)A.
vals(), A.
JA(), A.
IA(), &mlid, (
double*)B.
vals(), B.
JA(), B.
IA(), (
double*)C.vals(), C.JA(), C.IA(), NULL, &info);
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...
int * IA() const
retrieves prefix sum of number of nonzeros for each row (of size nrow()+1) out of all_data ...
int ncol() const
retrieves number of columns out of all_data
int * JA() const
retrieves column indices of each value in vals stored in sorted form by row
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...
int alloc_ptr(int64_t len, void **const ptr)
alloc abstraction
abstraction for a serialized sparse matrix stored in column-sparse-row (CSR) layout ...
int nrow() const
retrieves number of rows out of all_data
char * vals() const
retrieves array of values out of all_data
int cdealloc(void *ptr)
free abstraction
void MKL_DCSRADD(char const *transa, int const *job, int const *sort, int const *n, int const *k, double const *a, int const *ja, int const *ia, double const *beta, double const *b, int const *jb, int const *ib, double *c, int *jc, int *ic, int const *nnzmax, int const *ierr)