Neko  0.9.0
A portable framework for high-order spectral element flow simulations
prgm_lib.F90
Go to the documentation of this file.
1 
3  use opencl_intf
4  use utils, only : neko_error
5  use, intrinsic :: iso_c_binding, only : c_ptr, c_null_ptr
6  implicit none
7 
8 #ifdef HAVE_OPENCL
9 
11  type(c_ptr), bind(c) :: math_program = c_null_ptr
12 
14  type(c_ptr), bind(c) :: mathops_program = c_null_ptr
15 
17  type(c_ptr), bind(c) :: dirichlet_program = c_null_ptr
18 
20  type(c_ptr), bind(c) :: inflow_program = c_null_ptr
21 
23  type(c_ptr), bind(c) :: no_slip_wall_program = c_null_ptr
24 
26  type(c_ptr), bind(c) :: symmetry_program = c_null_ptr
27 
29  type(c_ptr), bind(c) :: facet_normal_program = c_null_ptr
30 
32  type(c_ptr), bind(c) :: inhom_dirichlet_program = c_null_ptr
33 
35  type(c_ptr), bind(c) :: dudxyz_program = c_null_ptr
36 
38  type(c_ptr), bind(c) :: cdtp_program = c_null_ptr
39 
41  type(c_ptr), bind(c) :: conv1_program = c_null_ptr
42 
44  type(c_ptr), bind(c) :: cfl_program = c_null_ptr
45 
47  type(c_ptr), bind(c) :: opgrad_program = c_null_ptr
48 
50  type(c_ptr), bind(c) :: gs_program = c_null_ptr
51 
53  type(c_ptr), bind(c) :: ax_helm_program = c_null_ptr
54 
56  type(c_ptr), bind(c) :: jacobi_program = c_null_ptr
57 
59  type(c_ptr), bind(c) :: rhs_maker_program = c_null_ptr
60 
62  type(c_ptr), bind(c) :: pnpn_res_program = c_null_ptr
63 
65  type(c_ptr), bind(c) :: fdm_program = c_null_ptr
66 
68  type(c_ptr), bind(c) :: tensor_program = c_null_ptr
69 
71  type(c_ptr), bind(c) :: schwarz_program = c_null_ptr
72 
74  type(c_ptr), bind(c) :: dong_program = c_null_ptr
75 
77  type(c_ptr), bind(c) :: coef_program = c_null_ptr
78 
80  type(c_ptr), bind(c) :: scalar_residual_program = c_null_ptr
81 
83  type(c_ptr), bind(c) :: lambda2_program = c_null_ptr
84 
86  type(c_ptr), bind(c) :: filter_program = c_null_ptr
87 
88 contains
89 
91 
92  if (c_associated(math_program)) then
93  if(clreleaseprogram(math_program) .ne. cl_success) then
94  call neko_error('Failed to release program')
95  end if
96  math_program = c_null_ptr
97  end if
98 
99  if (c_associated(mathops_program)) then
100  if(clreleaseprogram(mathops_program) .ne. cl_success) then
101  call neko_error('Failed to release program')
102  end if
103  mathops_program = c_null_ptr
104  end if
105 
106  if (c_associated(dirichlet_program)) then
107  if(clreleaseprogram(dirichlet_program) .ne. cl_success) then
108  call neko_error('Failed to release program')
109  end if
110  dirichlet_program = c_null_ptr
111  end if
112 
113  if (c_associated(inflow_program)) then
114  if(clreleaseprogram(inflow_program) .ne. cl_success) then
115  call neko_error('Failed to release program')
116  end if
117  inflow_program = c_null_ptr
118  end if
119 
120  if (c_associated(no_slip_wall_program)) then
121  if(clreleaseprogram(no_slip_wall_program) .ne. cl_success) then
122  call neko_error('Failed to release program')
123  end if
124  no_slip_wall_program = c_null_ptr
125  end if
126 
127  if (c_associated(symmetry_program)) then
128  if(clreleaseprogram(symmetry_program) .ne. cl_success) then
129  call neko_error('Failed to release program')
130  end if
131  symmetry_program = c_null_ptr
132  end if
133 
134  if (c_associated(facet_normal_program)) then
135  if(clreleaseprogram(facet_normal_program) .ne. cl_success) then
136  call neko_error('Failed to release program')
137  end if
138  facet_normal_program = c_null_ptr
139  end if
140 
141  if (c_associated(inhom_dirichlet_program)) then
142  if(clreleaseprogram(inhom_dirichlet_program) .ne. cl_success) then
143  call neko_error('Failed to release program')
144  end if
145  inhom_dirichlet_program = c_null_ptr
146  end if
147 
148  if (c_associated(dudxyz_program)) then
149  if(clreleaseprogram(dudxyz_program) .ne. cl_success) then
150  call neko_error('Failed to release program')
151  end if
152  dudxyz_program = c_null_ptr
153  end if
154 
155  if (c_associated(cdtp_program)) then
156  if(clreleaseprogram(cdtp_program) .ne. cl_success) then
157  call neko_error('Failed to release program')
158  end if
159  cdtp_program = c_null_ptr
160  end if
161 
162  if (c_associated(conv1_program)) then
163  if(clreleaseprogram(conv1_program) .ne. cl_success) then
164  call neko_error('Failed to release program')
165  end if
166  conv1_program = c_null_ptr
167  end if
168 
169  if (c_associated(cfl_program)) then
170  if(clreleaseprogram(cfl_program) .ne. cl_success) then
171  call neko_error('Failed to release program')
172  end if
173  cfl_program = c_null_ptr
174  end if
175 
176  if (c_associated(opgrad_program)) then
177  if(clreleaseprogram(opgrad_program) .ne. cl_success) then
178  call neko_error('Failed to release program')
179  end if
180  opgrad_program = c_null_ptr
181  end if
182 
183  if (c_associated(gs_program)) then
184  if(clreleaseprogram(gs_program) .ne. cl_success) then
185  call neko_error('Failed to release program')
186  end if
187  gs_program = c_null_ptr
188  end if
189 
190  if (c_associated(ax_helm_program)) then
191  if(clreleaseprogram(ax_helm_program) .ne. cl_success) then
192  call neko_error('Failed to release program')
193  end if
194  ax_helm_program = c_null_ptr
195  end if
196 
197  if (c_associated(jacobi_program)) then
198  if(clreleaseprogram(jacobi_program) .ne. cl_success) then
199  call neko_error('Failed to release program')
200  end if
201  jacobi_program = c_null_ptr
202  end if
203 
204  if (c_associated(rhs_maker_program)) then
205  if(clreleaseprogram(rhs_maker_program) .ne. cl_success) then
206  call neko_error('Failed to release program')
207  end if
208  rhs_maker_program = c_null_ptr
209  end if
210 
211  if (c_associated(pnpn_res_program)) then
212  if(clreleaseprogram(pnpn_res_program) .ne. cl_success) then
213  call neko_error('Failed to release program')
214  end if
215  pnpn_res_program = c_null_ptr
216  end if
217 
218  if (c_associated(fdm_program)) then
219  if(clreleaseprogram(fdm_program) .ne. cl_success) then
220  call neko_error('Failed to release program')
221  end if
222  fdm_program = c_null_ptr
223  end if
224 
225  if (c_associated(tensor_program)) then
226  if(clreleaseprogram(tensor_program) .ne. cl_success) then
227  call neko_error('Failed to release program')
228  end if
229  tensor_program = c_null_ptr
230  end if
231 
232  if (c_associated(schwarz_program)) then
233  if(clreleaseprogram(schwarz_program) .ne. cl_success) then
234  call neko_error('Failed to release program')
235  end if
236  schwarz_program = c_null_ptr
237  end if
238 
239  if (c_associated(dong_program)) then
240  if(clreleaseprogram(dong_program) .ne. cl_success) then
241  call neko_error('Failed to release program')
242  end if
243  dong_program = c_null_ptr
244  end if
245 
246  if (c_associated(coef_program)) then
247  if(clreleaseprogram(coef_program) .ne. cl_success) then
248  call neko_error('Failed to release program')
249  end if
250  coef_program = c_null_ptr
251  end if
252 
253  if (c_associated(scalar_residual_program)) then
254  if(clreleaseprogram(scalar_residual_program) .ne. cl_success) then
255  call neko_error('Failed to release program')
256  end if
257  scalar_residual_program = c_null_ptr
258  end if
259 
260  if (c_associated(lambda2_program)) then
261  if(clreleaseprogram(lambda2_program) .ne. cl_success) then
262  call neko_error('Failed to release program')
263  end if
264  lambda2_program = c_null_ptr
265  end if
266 
267  if (c_associated(filter_program)) then
268  if(clreleaseprogram(filter_program) .ne. cl_success) then
269  call neko_error('Failed to release program')
270  end if
271  filter_program = c_null_ptr
272  end if
273 
274  end subroutine opencl_prgm_lib_release
275 
276 #endif
277 
278 end module opencl_prgm_lib
Fortran OpenCL interface.
Definition: opencl_intf.F90:34
OpenCL JIT program library.
Definition: prgm_lib.F90:2
type(c_ptr), bind(C) scalar_residual_program
Device scalar residual kernels.
Definition: prgm_lib.F90:80
type(c_ptr), bind(C) ax_helm_program
Device Ax helm kernels.
Definition: prgm_lib.F90:53
type(c_ptr), bind(C) symmetry_program
Device Symmetry kernels.
Definition: prgm_lib.F90:26
type(c_ptr), bind(C) cfl_program
Device CFL kernels.
Definition: prgm_lib.F90:44
type(c_ptr), bind(C) mathops_program
Device mathops kernels.
Definition: prgm_lib.F90:14
type(c_ptr), bind(C) no_slip_wall_program
Device No-slip wall kernels.
Definition: prgm_lib.F90:23
type(c_ptr), bind(C) lambda2_program
Device lambda2 kernels.
Definition: prgm_lib.F90:83
subroutine opencl_prgm_lib_release
Definition: prgm_lib.F90:91
type(c_ptr), bind(C) conv1_program
Device onvective kernels.
Definition: prgm_lib.F90:41
type(c_ptr), bind(C) jacobi_program
Device jacobi kernels.
Definition: prgm_lib.F90:56
type(c_ptr), bind(C) coef_program
Device coef kernels.
Definition: prgm_lib.F90:77
type(c_ptr), bind(C) gs_program
Device Gather-Scatter kernels.
Definition: prgm_lib.F90:50
type(c_ptr), bind(C) rhs_maker_program
Device rhs_maker kernels.
Definition: prgm_lib.F90:59
type(c_ptr), bind(C) dudxyz_program
Device Derivative kernels.
Definition: prgm_lib.F90:35
type(c_ptr), bind(C) cdtp_program
Device kernels.
Definition: prgm_lib.F90:38
type(c_ptr), bind(C) facet_normal_program
Device Facet normal kernels.
Definition: prgm_lib.F90:29
type(c_ptr), bind(C) schwarz_program
Device schwarz kernels.
Definition: prgm_lib.F90:71
type(c_ptr), bind(C) fdm_program
Device fdm kernels.
Definition: prgm_lib.F90:65
type(c_ptr), bind(C) dirichlet_program
Device Dirichlet kernels.
Definition: prgm_lib.F90:17
type(c_ptr), bind(C) inflow_program
Device Inflow kernels.
Definition: prgm_lib.F90:20
type(c_ptr), bind(C) tensor_program
Device tensor kernels.
Definition: prgm_lib.F90:68
type(c_ptr), bind(C) opgrad_program
Device Velocity gradient kernels.
Definition: prgm_lib.F90:47
type(c_ptr), bind(C) math_program
Device math kernels.
Definition: prgm_lib.F90:11
type(c_ptr), bind(C) inhom_dirichlet_program
Device Blasius profile kernel.
Definition: prgm_lib.F90:32
type(c_ptr), bind(C) filter_program
Device filter kernels.
Definition: prgm_lib.F90:86
type(c_ptr), bind(C) pnpn_res_program
Device pnpn residual kernels.
Definition: prgm_lib.F90:62
type(c_ptr), bind(C) dong_program
Device dong kernels.
Definition: prgm_lib.F90:74
Utilities.
Definition: utils.f90:35