-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathGraphRep.hpp
74 lines (61 loc) · 1.19 KB
/
GraphRep.hpp
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
#ifndef GRAPHREP_HPP
#define GRAPHREP_HPP
#include <cstdint>
#ifndef __OPENCL_VERSION__
template<typename EDGE>
#endif
struct edge {
EDGE in, out;
#ifndef __OPENCL_VERSION__
edge(EDGE i, EDGE o) : in(i), out(o) {}
#endif
};
#ifndef __OPENCL_VERSION__
template<typename EDGE>
#endif
struct EdgeList {
uint64_t vertex_count, edge_count;
EDGE *inEdges;
EDGE *outEdges;
};
#ifndef __OPENCL_VERSION__
template<typename EDGE>
#endif
struct StructEdgeList {
uint64_t vertex_count, edge_count;
#ifdef __OPENCL_VERSION__
edge *edges;
#else
edge<EDGE> *edges;
#endif
};
#ifndef __OPENCL_VERSION__
template<typename VERTEX, typename EDGE>
#endif
struct EdgeListCSR {
uint64_t vertex_count, edge_count;
VERTEX *vertices;
EDGE *inEdges;
EDGE *outEdges;
};
#ifndef __OPENCL_VERSION__
template<typename VERTEX, typename EDGE>
#endif
struct StructEdgeListCSR {
uint64_t vertex_count, edge_count;
VERTEX *vertices;
#ifdef __OPENCL_VERSION__
edge *edges;
#else
edge<EDGE> *edges;
#endif
};
#ifndef __OPENCL_VERSION__
template<typename VERTEX, typename EDGE>
#endif
struct CSR {
uint64_t vertex_count, edge_count;
VERTEX *vertices;
EDGE *edges;
};
#endif