Skip to content
commonmm.h 1.11 KiB
Newer Older
#ifndef __COMMONMM_H__
#define __COMMONMM_H_

#define FIELD_LENGTH 128
//char filename[FIELD_LENGTH];

enum spmv_target { use_cpu, use_mkl, use_mic, use_mkl_mic, use_mic_rowcyclic };
char *target_str[] = { "CPU", "MKL", "MIC", "MKL_MIC", "MIC_ROWCYCLIC" };
enum enum_datastructure  { DS_ICSR, DS_CSR };
char *str_datastructure[] = { "ICSR", "CSR" };
char *str_algorithm[] = { "OUTER", "INNER" };

__declspec(target(mic)) int datastructure;

typedef int csi;
typedef double csv;
__declspec(target(mic)) csv zero = 0.0;

__declspec(target(mic)) int use_sparse_c;
__declspec(target(mic)) int size_dacc;
__declspec(target(mic)) csv* dacc;




typedef struct csr_t {
  csi  m; 
  csi  n; 
  csi  nzmax;
  csi  nr; 
  csi* r; 
  csi* p; 
  csi* j; 
  csv* x; 
  int  numInMats;    // number of input matrices stored in this struct
  int  numRows;
  int  nnonempty_rows;
  int  numCols;
  int  totalnnz;
 // int  totalnnzmax;
  int* nItems;       // nnz of each matrix
  int* pirow;
  int  size_pirow;
  int* pnr;
  int* h_rowDelimiters;
  int  size_h_rowDelimiters;
  int* h_cols;
  csv* h_val;
  char filename[FIELD_LENGTH];
} csr;


#endif