-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patharchitecture_independent_api.h
70 lines (59 loc) · 3.12 KB
/
architecture_independent_api.h
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
#pragma once
#if defined(__USE_NEC_SX_AURORA__) || defined(__USE_MULTICORE__)
#define __VGL_COMPUTE_ARGS__ (int src_id, int connections_count, int vector_index)
#define __VGL_SCATTER_ARGS__ (int src_id, int dst_id, int local_edge_pos, long long int global_edge_pos, int vector_index)
#define __VGL_GATHER_ARGS__ (int src_id, int dst_id, int local_edge_pos, long long int global_edge_pos, int vector_index)
#define __VGL_ADVANCE_ARGS__ (int src_id, int dst_id, int local_edge_pos, long long int global_edge_pos, int vector_index)
#define __VGL_ADVANCE_PREPROCESS_ARGS__ (int src_id, int connections_count, int vector_index)
#define __VGL_ADVANCE_POSTPROCESS_ARGS__ (int src_id, int connections_count, int vector_index)
#define __VGL_GNF_ARGS__ (int src_id, int connections_count)->int
#define __VGL_REDUCE_ANY_ARGS__ (int src_id, int connections_count, int vector_index)
#define __VGL_REDUCE_INT_ARGS__ (int src_id, int connections_count, int vector_index)->int
#define __VGL_REDUCE_FLT_ARGS__ (int src_id, int connections_count, int vector_index)->float
#define __VGL_REDUCE_DBL_ARGS__ (int src_id, int connections_count, int vector_index)->double
#define __VGL_COPY_IF_INDEXES_ARGS__ (int idx)
#endif
#ifdef __USE_GPU__
#define __VGL_COMPUTE_ARGS__ __device__ (int src_id, int connections_count, int vector_index)
#define __VGL_SCATTER_ARGS__ __device__ (int src_id, int dst_id, int local_edge_pos, long long int global_edge_pos, int vector_index)
#define __VGL_GATHER_ARGS__ __device__ (int src_id, int dst_id, int local_edge_pos, long long int global_edge_pos, int vector_index)
#define __VGL_ADVANCE_ARGS__ __device__ (int src_id, int dst_id, int local_edge_pos, long long int global_edge_pos, int vector_index)
#define __VGL_ADVANCE_PREPROCESS_ARGS__ __device__ (int src_id, int connections_count, int vector_index)
#define __VGL_ADVANCE_POSTPROCESS_ARGS__ __device__ (int src_id, int connections_count, int vector_index)
#define __VGL_GNF_ARGS__ __device__ (int src_id, int connections_count)->int
#define __VGL_REDUCE_ANY_ARGS__ __device__ (int src_id, int connections_count, int vector_index)
#define __VGL_REDUCE_INT_ARGS__ __device__ (int src_id, int connections_count, int vector_index)->int
#define __VGL_REDUCE_FLT_ARGS__ __device__ (int src_id, int connections_count, int vector_index)->float
#define __VGL_REDUCE_DBL_ARGS__ __device__ (int src_id, int connections_count, int vector_index)->double
#define __VGL_COPY_IF_INDEXES_ARGS__ __device__ (int idx)
#endif
#ifdef __USE_NEC_SX_AURORA__
#define VGL_GRAPH_ABSTRACTIONS GraphAbstractionsNEC
#endif
#ifdef __USE_MULTICORE__
#define VGL_GRAPH_ABSTRACTIONS GraphAbstractionsMulticore
#endif
#ifdef __USE_GPU__
#define VGL_GRAPH_ABSTRACTIONS GraphAbstractionsGPU
#endif
#define VGL_FRONTIER VGL_Frontier
#ifdef __USE_GPU__
#define VGL_SRC_ID_ADD(a, b) (atomicAdd(&(a), (b)))
#else
#define VGL_SRC_ID_ADD(a, b) ((a) += (b))
#endif
#ifdef __USE_GPU__
#define VGL_INC(a) (atomicAdd(&(a), 1))
#else
#define VGL_INC(a) ((a) += 1)
#endif
#ifdef __USE_GPU__
#define VGL_DEC(a) (atomicSub(&(a), 1))
#else
#define VGL_DEC(a) ((a) += 1)
#endif
#ifdef __USE_GPU__
#define VGL_LAMBDA_CAP(a) a
#else
#define VGL_LAMBDA_CAP(a) &a
#endif