-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path5.txt
52 lines (43 loc) · 1.79 KB
/
5.txt
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
rollback_kernel_1 (32 x 32 x 1, warp i):
v[o][j][i] = 0.5 * myVarY[i][j] * myDyy[i][0..2] `dot` myResult[o][i][j-1..j+1]
u[o][j][i] = dtInv * myResult[o][i][j] +
0.5 * 0.5 * myVarX[i][j] * myDxx[0..2][i] `dot` myResult[o][i-1..i+1][j] +
v[o][j][i]
a[j][i] = - 0.5 * 0.5 * myVarX[j][i] * myDxx[0][i]
b[j][i] = dtInv - 0.5 * 0.5 * myVarX[j][i] * myDxx[1][i]
c[j][i] = - 0.5 * 0.5 * myVarX[j][i] * myDxx[2][i]
tridag_kernel_0 (1 x 32 x 1, warp j):
yy[j][i] = -a[j][i] * c[j][i-1]
tridag_kernel_1 (1 x 32 x 1, warp j):
yy[j][0] = 1.0 / b[j][0]
for i = 1..N:
yy[j][i] = 1.0 / (b[j][i] - yy[j][i] * yy[j][i-1])
tridag_kernel_2 (64 x 1 x 1, warp i):
a[j][i] = 1.0 / (c[j][i-1] * yy[j][i-1] - b[j][i] / a[j][i])
b[j][i] = - c[j][i] * yy[j][i]
u[o][j][i] = u[o][j][i] * yy[j][i]
tridag_kernel_3 (1 x 32 x 1, warp j):
loop i = 1..N:
u[o][j][i] += a[j][i] * u[o][j][i-1]
loop i = N-1..0:
u[o][j][i] += b[j][i] * u[o][j][i+1]
rollback_kernel_4 (1 x 32 x 1, warp j):
a[i][j] = - 0.5 * 0.5 * myVarY[i][j] * myDyy[0][j]
b[i][j] = dtInv - 0.5 * 0.5 * myVarY[i][j] * myDyy[1][j]
c[i][j] = - 0.5 * 0.5 * myVarY[i][j] * myDyy[2][j]
y[o][i][j] = dtInv * u[o][j][i] - 0.5 * v[o][j][i]
tridag_kernel_4 (1 x 32 x 1, warp j):
yy[i][j] = -a[i][j] * c[i][j-1]
tridag_kernel_5 (32 x 1 x 1, warp i):
yy[i][0] = 1.0 / b[i][0]
for j = 1..N:
yy[i][j] = 1.0 / (b[i][j] - yy[i][j] * yy[i][j-1])
tridag_kernel_6 (1 x 32 x 1, warp j):
a[i][j] = 1.0 / (c[i][j-1] * yy[i][j-1] - b[i][j] / a[i][j])
b[i][j] = - c[i][j] * yy[i][j]
myResults[o][i][j] = y[o][i][j] * yy[i][j]
tridag_kernel_7 (32 x 1 x 1, warp i):
loop j = 1..N:
myResults[o][i][j] += a[i][j] * myResults[o][i][j-1]
loop j = N-1..0:
myResults[o][i][j] += b[i][j] * myResults[o][i][j+1]