-
Notifications
You must be signed in to change notification settings - Fork 0
/
meshTopo16.c
58 lines (54 loc) · 1.14 KB
/
meshTopo16.c
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
#include "coreId16.inc"
void initMesh(unsigned int *NORTH, unsigned int *SOUTH, unsigned int *EAST, unsigned int *WEST)
{
unsigned int gid = get_global_id(0);
unsigned int coreId = LOCAL_MEM_ADDRESS_BASE(gid);
(*NORTH) = coreId - 0xfffc0000;
(*SOUTH) = coreId + 0xfffc0000;
(*EAST) = coreId + 0xffff0000;
(*WEST) = coreId - 0xffff0000;
switch(coreId)
{
case core00:
(*NORTH) = 0x0;
(*WEST) = 0x0;
break;
case core10:
(*NORTH) = 0x0;
break;
case core20:
(*NORTH) = 0x0;
break;
case core30:
(*NORTH) = 0x0;
(*EAST) = 0x0;
break;
case core31:
(*EAST) = 0x0;
break;
case core32:
(*EAST) = 0x0;
break;
case core33:
(*EAST) = 0x0;
(*SOUTH) = 0x0;
break;
case core23:
(*SOUTH) = 0x0;
break;
case core13:
(*SOUTH) = 0x0;
break;
case core03:
(*SOUTH) = 0x0;
(*WEST) = 0x0;
break;
case core02:
(*WEST) = 0x0;
break;
case core01:
(*WEST) = 0x0;
break;
default: ;
}
}