Skip to content

Commit e1bfa9f

Browse files
committed
Fix Cray compiler GPU routine macros: INLINENEVER directive and cray_inline flag
1 parent d513442 commit e1bfa9f

2 files changed

Lines changed: 5 additions & 3 deletions

File tree

src/common/include/parallel_macros.fpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,10 +67,11 @@
6767
#:if not isinstance(function_name, str)
6868
#:stop "When using cray_noinline, function name must be given and given as a string"
6969
#:endif
70-
#:set cray_noinline_directive = ('!DIR$ NOINLINE ' + function_name).strip('\n')
70+
#:set cray_noinline_directive = ('!DIR$ INLINENEVER ' + function_name).strip('\n')
7171
#ifdef _CRAYFTN
7272
#if MFC_OpenACC
7373
$:acc_directive
74+
$:cray_noinline_directive
7475
#elif MFC_OpenMP
7576
$:omp_directive
7677
#else
@@ -91,13 +92,15 @@
9192
#ifdef _CRAYFTN
9293
#if MFC_OpenACC
9394
$:acc_directive
95+
$:cray_directive
9496
#elif MFC_OpenMP
9597
$:omp_directive
9698
#else
9799
$:cray_directive
98100
#endif
99101
#elif MFC_OpenACC
100102
$:acc_directive
103+
$:cray_directive
101104
#elif MFC_OpenMP
102105
$:omp_directive
103106
#endif

src/common/m_variables_conversion.fpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ contains
8080
!> Compute the pressure from the appropriate equation of state
8181
subroutine s_compute_pressure(energy, alf, dyn_p, pi_inf, gamma, rho, qv, rhoYks, pres, T, stress, mom, G, pres_mag)
8282

83-
$:GPU_ROUTINE(function_name='s_compute_pressure',parallelism='[seq]', cray_noinline=True)
83+
$:GPU_ROUTINE(function_name='s_compute_pressure',parallelism='[seq]', cray_inline=True)
8484

8585
real(stp), intent(in) :: energy, alf
8686
real(wp), intent(in) :: dyn_p
@@ -499,7 +499,6 @@ contains
499499
real(wp) :: E, D !< Prim/Cons variables within Newton-Raphson iteration
500500
real(wp) :: f, dGa_dW, dp_dW, df_dW !< Functions within Newton-Raphson iteration
501501
integer :: iter !< Newton-Raphson iteration counter
502-
503502
$:GPU_PARALLEL_LOOP(collapse=3, private='[alpha_K, alpha_rho_K, Re_K, nRtmp, rho_K, gamma_K, pi_inf_K, qv_K, dyn_pres_K, &
504503
& rhoYks, B, pres, vftmp, nbub_sc, G_K, T, pres_mag, Ga, B2, m2, S, W, dW, E, D, f, dGa_dW, dp_dW, &
505504
& df_dW, iter]')

0 commit comments

Comments
 (0)