-
Notifications
You must be signed in to change notification settings - Fork 3
/
tea_leaf_cg.f90
89 lines (54 loc) · 1.33 KB
/
tea_leaf_cg.f90
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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
MODULE tea_leaf_cg_module
USE definitions_module
IMPLICIT NONE
CONTAINS
SUBROUTINE tea_leaf_cg_init(rro)
IMPLICIT NONE
INTEGER :: t
REAL(KIND=8) :: rro, tile_rro
rro = 0.0_8
IF (use_cuda_kernels) THEN
DO t=1,tiles_per_task
tile_rro = 0.0_8
CALL tea_leaf_cg_init_kernel_cuda(tile_rro)
rro = rro + tile_rro
ENDDO
ENDIF
END SUBROUTINE tea_leaf_cg_init
SUBROUTINE tea_leaf_cg_calc_w(pw)
IMPLICIT NONE
INTEGER :: t
REAL(KIND=8) :: pw, tile_pw
pw = 0.0_08
IF (use_cuda_kernels) THEN
DO t=1,tiles_per_task
tile_pw = 0.0_8
CALL tea_leaf_cg_calc_w_kernel_cuda(tile_pw)
pw = pw + tile_pw
ENDDO
ENDIF
END SUBROUTINE tea_leaf_cg_calc_w
SUBROUTINE tea_leaf_cg_calc_ur(alpha, rrn)
IMPLICIT NONE
INTEGER :: t
REAL(KIND=8) :: alpha, rrn, tile_rrn
rrn = 0.0_8
IF (use_cuda_kernels) THEN
DO t=1,tiles_per_task
tile_rrn = 0.0_8
CALL tea_leaf_cg_calc_ur_kernel_cuda(alpha, tile_rrn)
rrn = rrn + tile_rrn
ENDDO
ENDIF
END SUBROUTINE tea_leaf_cg_calc_ur
SUBROUTINE tea_leaf_cg_calc_p(beta)
IMPLICIT NONE
INTEGER :: t
REAL(KIND=8) :: beta
IF (use_cuda_kernels) THEN
DO t=1,tiles_per_task
CALL tea_leaf_cg_calc_p_kernel_cuda(beta)
ENDDO
ENDIF
END SUBROUTINE tea_leaf_cg_calc_p
END MODULE tea_leaf_cg_module