-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathmain.h
executable file
·73 lines (52 loc) · 1.46 KB
/
main.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
70
71
72
73
#ifndef __MAIN_H
#define __MAIN_H
#include <stdio.h>
#include <stdint.h>
#include <stdlib.h>
#include <string.h>
#include <malloc.h>
#include <algorithm>
#include <math.h>
#include <cfloat>
typedef uint64_t IntT;
typedef double FloatT;
typedef struct Graph {
IntT num_nodes;
IntT node_feat_dim;
FloatT* node_feats;
IntT num_edges;
IntT edge_feat_dim;
FloatT* edge_feats;
IntT* srcs;
IntT* dsts;
IntT* srcs_r;
IntT* dsts_r;
IntT* map_r;
} Graph;
namespace ac {
namespace host {
void SortEdges(
IntT*, IntT*, IntT*, IntT*, IntT*, IntT);
void ColumnMax(
IntT, IntT, FloatT*, FloatT*);
void ColumnSoftmax(
IntT, IntT, FloatT*);
void EdgeMaxReduce(
IntT, IntT, IntT, FloatT*, FloatT*, FloatT*, IntT*, IntT*);
void ComputeMU(
Graph*, IntT, FloatT*, FloatT*, FloatT*, FloatT*);
}
namespace device {
__global__ void NodePairwiseNorm(
IntT, IntT, FloatT*, FloatT*, FloatT*, FloatT*, IntT);
__global__ void EdgePairwiseNorm(
IntT, IntT, FloatT*, FloatT*, FloatT*, FloatT*, FloatT*, IntT);
__global__ void RepeatColumnsByPatternEdges(
IntT, IntT, IntT, FloatT*, FloatT*, FloatT*, IntT*, IntT*);
__global__ void RepeatColumnsByPatternEdgesSubtract(
IntT, IntT, IntT, FloatT*, FloatT*, FloatT*, FloatT*, FloatT*, IntT*, IntT*);
__global__ void RepeatColumnsByDataEdges(
IntT, IntT, FloatT*, FloatT*, FloatT*, FloatT*, FloatT*, IntT*);
}
}
#endif