-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCSR.cuh
49 lines (44 loc) · 1.24 KB
/
CSR.cuh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#ifndef CSR_CUH
#define CSR_CUH
//#include "SparseMatrix.h"
#include <cstdlib> /* rand */
#include <vector>
#include <string>
#include <iostream>
#include <cuda.h>
#include <thrust/host_vector.h>
#include <thrust/device_vector.h>
#include <thrust/generate.h>
#include <thrust/sort.h>
#include <thrust/functional.h>
#include <cstdlib>
#include <iostream>
#include <string>
#include <sstream>
#include "COO.cuh" // std::stringstream
// We'll use a 3-tuple to store our 3d vector type
// rows, cols, vals
class CSR
{
public:
CSR(const COO & c);
std::string toString();
//void sortMyself();
//bool getIsSorted() const { return isSorted; }
//void insertElements(COO & c);
//COO& SpMV(COO & c);
//int * column_indices, * row_indices, * values;
int dimensions, numberOfEntries;
thrust::host_vector<int> col_vec;
thrust::host_vector<int> row_offset;
thrust::host_vector<int> val_vec;
thrust::host_vector<int> dimensions_vec;
thrust::host_vector<int> ones;
thrust::device_vector<int> col_vec_dev;
thrust::device_vector<int> row_offset_dev;
thrust::device_vector<int> val_vec_dev;
private:
//void wrapperFunction(int * column_indices, int * row_indices, int * values, int size);
//bool isSorted;
};
#endif