Neko 1.99.6
A portable framework for high-order spectral element flow simulations
Loading...
Searching...
No Matches
cuda_math.f90
Go to the documentation of this file.
1! Copyright (c) 2025, The Neko Authors
2! All rights reserved.
3!
4! Redistribution and use in source and binary forms, with or without
5! modification, are permitted provided that the following conditions
6! are met:
7!
8! * Redistributions of source code must retain the above copyright
9! notice, this list of conditions and the following disclaimer.
10!
11! * Redistributions in binary form must reproduce the above
12! copyright notice, this list of conditions and the following
13! disclaimer in the documentation and/or other materials provided
14! with the distribution.
15!
16! * Neither the name of the authors nor the names of its
17! contributors may be used to endorse or promote products derived
18! from this software without specific prior written permission.
19!
20! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
21! "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
22! LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
23! FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
24! COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
25! INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
26! BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
27! LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
28! CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
29! LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
30! ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
31! POSSIBILITY OF SUCH DAMAGE.
32!
34 use num_types, only : rp, c_rp, c_xp
35 implicit none
36 public
37
38 interface
39 subroutine cuda_copy(a_d, b_d, n, strm) &
40 bind(c, name = 'cuda_copy')
41 use, intrinsic :: iso_c_binding, only : c_int, c_ptr
42 type(c_ptr), value :: a_d, b_d, strm
43 integer(c_int) :: n
44 end subroutine cuda_copy
45
46 subroutine cuda_masked_copy_0(a_d, b_d, mask_d, n, n_mask, strm) &
47 bind(c, name = 'cuda_masked_copy_0')
48 use, intrinsic :: iso_c_binding, only : c_int, c_ptr
49 type(c_ptr), value :: a_d, b_d, mask_d, strm
50 integer(c_int) :: n, n_mask
51 end subroutine cuda_masked_copy_0
52
53 subroutine cuda_masked_copy_aligned(a_d, b_d, mask_d, n, n_mask, strm) &
54 bind(c, name = 'cuda_masked_copy_aligned')
55 use, intrinsic :: iso_c_binding, only : c_int, c_ptr
56 type(c_ptr), value :: a_d, b_d, mask_d, strm
57 integer(c_int) :: n, n_mask
58 end subroutine cuda_masked_copy_aligned
59
60 subroutine cuda_masked_gather_copy(a_d, b_d, mask_d, n, n_mask, strm) &
61 bind(c, name = 'cuda_masked_gather_copy')
62 use, intrinsic :: iso_c_binding, only : c_int, c_ptr
63 type(c_ptr), value :: a_d, b_d, mask_d, strm
64 integer(c_int) :: n, n_mask
65 end subroutine cuda_masked_gather_copy
66
67 subroutine cuda_masked_gather_copy_aligned(a_d, b_d, mask_d, n, n_mask, &
68 strm) bind(c, name = 'cuda_masked_gather_copy_aligned')
69 use, intrinsic :: iso_c_binding, only : c_int, c_ptr
70 type(c_ptr), value :: a_d, b_d, mask_d, strm
71 integer(c_int) :: n, n_mask
73
74 subroutine cuda_face_masked_gather_copy(a_d, b_d, mask_d, facet_d, n1, &
75 n2, lx, ly, lz, n_mask, strm) &
76 bind(c, name = 'cuda_face_masked_gather_copy')
77 use, intrinsic :: iso_c_binding, only : c_int, c_ptr
78 type(c_ptr), value :: a_d, b_d, mask_d, facet_d, strm
79 integer(c_int) :: n1, n2, lx, ly, lz, n_mask
80 end subroutine cuda_face_masked_gather_copy
81
82 subroutine cuda_masked_scatter_copy(a_d, b_d, mask_d, n, n_mask, strm) &
83 bind(c, name = 'cuda_masked_scatter_copy')
84 use, intrinsic :: iso_c_binding, only : c_int, c_ptr
85 type(c_ptr), value :: a_d, b_d, mask_d, strm
86 integer(c_int) :: n, n_mask
87 end subroutine cuda_masked_scatter_copy
88
89 subroutine cuda_masked_scatter_copy_aligned(a_d, b_d, mask_d, n, n_mask, strm) &
90 bind(c, name = 'cuda_masked_scatter_copy_aligned')
91 use, intrinsic :: iso_c_binding, only : c_int, c_ptr
92 type(c_ptr), value :: a_d, b_d, mask_d, strm
93 integer(c_int) :: n, n_mask
95
96 subroutine cuda_masked_atomic_reduction(a_d, b_d, mask_d, n, m, strm) &
97 bind(c, name = 'cuda_masked_atomic_reduction')
98 use, intrinsic :: iso_c_binding, only : c_ptr, c_int
99 type(c_ptr), value :: a_d, b_d, mask_d, strm
100 integer(c_int) :: n, m
101 end subroutine cuda_masked_atomic_reduction
102
103 subroutine cuda_cfill_mask(a_d, c, n, mask_d, n_mask, strm) &
104 bind(c, name = 'cuda_cfill_mask')
105 use, intrinsic :: iso_c_binding, only : c_int, c_ptr
106 import c_rp
107 type(c_ptr), value :: a_d, strm
108 real(c_rp) :: c
109 integer(c_int) :: n
110 type(c_ptr), value :: mask_d
111 integer(c_int) :: n_mask
112 end subroutine cuda_cfill_mask
113
114 subroutine cuda_cmult(a_d, c, n, strm) &
115 bind(c, name = 'cuda_cmult')
116 use, intrinsic :: iso_c_binding, only : c_int, c_ptr
117 import c_rp
118 type(c_ptr), value :: a_d, strm
119 real(c_rp) :: c
120 integer(c_int) :: n
121 end subroutine cuda_cmult
122
123 subroutine cuda_cmult2(a_d, b_d, c, n, strm) &
124 bind(c, name = 'cuda_cmult2')
125 use, intrinsic :: iso_c_binding, only : c_int, c_ptr
126 import c_rp
127 type(c_ptr), value :: a_d, b_d, strm
128 real(c_rp) :: c
129 integer(c_int) :: n
130 end subroutine cuda_cmult2
131
132 subroutine cuda_cdiv(a_d, c, n, strm) &
133 bind(c, name = 'cuda_cdiv')
134 use, intrinsic :: iso_c_binding, only : c_int, c_ptr
135 import c_rp
136 type(c_ptr), value :: a_d, strm
137 real(c_rp) :: c
138 integer(c_int) :: n
139 end subroutine cuda_cdiv
140
141 subroutine cuda_cdiv2(a_d, b_d, c, n, strm) &
142 bind(c, name = 'cuda_cdiv2')
143 use, intrinsic :: iso_c_binding, only : c_int, c_ptr
144 import c_rp
145 type(c_ptr), value :: a_d, b_d, strm
146 real(c_rp) :: c
147 integer(c_int) :: n
148 end subroutine cuda_cdiv2
149
150 subroutine cuda_radd(a_d, c, n, strm) &
151 bind(c, name = 'cuda_radd')
152 use, intrinsic :: iso_c_binding, only : c_int, c_ptr
153 import c_rp
154 type(c_ptr), value :: a_d, strm
155 real(c_rp) :: c
156 integer(c_int) :: n
157 end subroutine cuda_radd
158
159 subroutine cuda_cadd2(a_d, b_d, c, n, strm) &
160 bind(c, name = 'cuda_cadd2')
161 use, intrinsic :: iso_c_binding, only : c_int, c_ptr
162 import c_rp
163 type(c_ptr), value :: a_d
164 type(c_ptr), value :: b_d
165 type(c_ptr), value :: strm
166 real(c_rp) :: c
167 integer(c_int) :: n
168 end subroutine cuda_cadd2
169
170 subroutine cuda_cwrap(a_d, min_val, max_val, n, strm) &
171 bind(c, name = 'cuda_cwrap')
172 use, intrinsic :: iso_c_binding, only : c_int, c_ptr
173 import c_rp
174 type(c_ptr), value :: a_d
175 type(c_ptr), value :: strm
176 real(c_rp) :: min_val
177 real(c_rp) :: max_val
178 integer(c_int) :: n
179 end subroutine cuda_cwrap
180
181 subroutine cuda_sqrt_inplace(a_d, n, strm) &
182 bind(c, name = 'cuda_sqrt_inplace')
183 use, intrinsic :: iso_c_binding, only : c_int, c_ptr
184 type(c_ptr), value :: a_d
185 type(c_ptr), value :: strm
186 integer(c_int) :: n
187 end subroutine cuda_sqrt_inplace
188
189 subroutine cuda_power(ap_d, a_d, p, n, strm) &
190 bind(c, name = 'cuda_power')
191 use, intrinsic :: iso_c_binding, only : c_int, c_ptr
192 import c_rp
193 type(c_ptr), value :: ap_d
194 type(c_ptr), value :: a_d
195 type(c_ptr), value :: strm
196 real(c_rp) :: p
197 integer(c_int) :: n
198 end subroutine cuda_power
199
200 subroutine cuda_cfill(a_d, c, n, strm) &
201 bind(c, name = 'cuda_cfill')
202 use, intrinsic :: iso_c_binding, only : c_int, c_ptr
203 import c_rp
204 type(c_ptr), value :: a_d, strm
205 real(c_rp) :: c
206 integer(c_int) :: n
207 end subroutine cuda_cfill
208
209 subroutine cuda_rzero(a_d, n, strm) &
210 bind(c, name = 'cuda_rzero')
211 use, intrinsic :: iso_c_binding, only : c_int, c_ptr
212 type(c_ptr), value :: a_d, strm
213 integer(c_int) :: n
214 end subroutine cuda_rzero
215
216 subroutine cuda_add2(a_d, b_d, n, strm) &
217 bind(c, name = 'cuda_add2')
218 use, intrinsic :: iso_c_binding, only : c_int, c_ptr
219 import c_rp
220 type(c_ptr), value :: a_d, b_d, strm
221 integer(c_int) :: n
222 end subroutine cuda_add2
223
224 subroutine cuda_add4(a_d, b_d, c_d, d_d, n, strm) &
225 bind(c, name = 'cuda_add4')
226 use, intrinsic :: iso_c_binding, only : c_int, c_ptr
227 import c_rp
228 type(c_ptr), value :: a_d, b_d, c_d, d_d, strm
229 integer(c_int) :: n
230 end subroutine cuda_add4
231
232 subroutine cuda_add2s1(a_d, b_d, c1, n, strm) &
233 bind(c, name = 'cuda_add2s1')
234 use, intrinsic :: iso_c_binding, only : c_int, c_ptr
235 import c_rp
236 type(c_ptr), value :: a_d, b_d, strm
237 real(c_rp) :: c1
238 integer(c_int) :: n
239 end subroutine cuda_add2s1
240
241 subroutine cuda_add2s2(a_d, b_d, c1, n, strm) &
242 bind(c, name = 'cuda_add2s2')
243 use, intrinsic :: iso_c_binding, only : c_int, c_ptr
244 import c_rp
245 type(c_ptr), value :: a_d, b_d, strm
246 real(c_rp) :: c1
247 integer(c_int) :: n
248 end subroutine cuda_add2s2
249
250 subroutine cuda_addsqr2s2(a_d, b_d, c1, n, strm) &
251 bind(c, name = 'cuda_addsqr2s2')
252 use, intrinsic :: iso_c_binding, only : c_int, c_ptr
253 import c_rp
254 type(c_ptr), value :: a_d, b_d, strm
255 real(c_rp) :: c1
256 integer(c_int) :: n
257 end subroutine cuda_addsqr2s2
258
259 subroutine cuda_add3s2(a_d, b_d, c_d, c1, c2, n, strm) &
260 bind(c, name = 'cuda_add3s2')
261 use, intrinsic :: iso_c_binding, only : c_int, c_ptr
262 import c_rp
263 type(c_ptr), value :: a_d, b_d, c_d, strm
264 real(c_rp) :: c1, c2
265 integer(c_int) :: n
266 end subroutine cuda_add3s2
267
268 subroutine cuda_add4s3(a_d, b_d, c_d, d_d, c1, c2, c3, n, strm) &
269 bind(c, name = 'cuda_add4s3')
270 use, intrinsic :: iso_c_binding, only : c_int, c_ptr
271 import c_rp
272 type(c_ptr), value :: a_d, b_d, c_d, d_d, strm
273 real(c_rp) :: c1, c2, c3
274 integer(c_int) :: n
275 end subroutine cuda_add4s3
276
277 subroutine cuda_add5s4(a_d, b_d, c_d, d_d, e_d, c1, c2, c3, c4, n, strm) &
278 bind(c, name = 'cuda_add5s4')
279 use, intrinsic :: iso_c_binding, only : c_int, c_ptr
280 import c_rp
281 type(c_ptr), value :: a_d, b_d, c_d, d_d, e_d, strm
282 real(c_rp) :: c1, c2, c3, c4
283 integer(c_int) :: n
284 end subroutine cuda_add5s4
285
286 subroutine cuda_invcol1(a_d, n, strm) &
287 bind(c, name = 'cuda_invcol1')
288 use, intrinsic :: iso_c_binding, only : c_int, c_ptr
289 type(c_ptr), value :: a_d, strm
290 integer(c_int) :: n
291 end subroutine cuda_invcol1
292
293 subroutine cuda_invcol2(a_d, b_d, n, strm) &
294 bind(c, name = 'cuda_invcol2')
295 use, intrinsic :: iso_c_binding, only : c_int, c_ptr
296 type(c_ptr), value :: a_d, b_d, strm
297 integer(c_int) :: n
298 end subroutine cuda_invcol2
299
300 subroutine cuda_invcol3(a_d, b_d, c_d, n, strm) &
301 bind(c, name = 'cuda_invcol3')
302 use, intrinsic :: iso_c_binding, only : c_int, c_ptr
303 type(c_ptr), value :: a_d, b_d, c_d, strm
304 integer(c_int) :: n
305 end subroutine cuda_invcol3
306
307 subroutine cuda_col2(a_d, b_d, n, strm) &
308 bind(c, name = 'cuda_col2')
309 use, intrinsic :: iso_c_binding, only : c_int, c_ptr
310 type(c_ptr), value :: a_d, b_d, strm
311 integer(c_int) :: n
312 end subroutine cuda_col2
313
314 subroutine cuda_col3(a_d, b_d, c_d, n, strm) &
315 bind(c, name = 'cuda_col3')
316 use, intrinsic :: iso_c_binding, only : c_int, c_ptr
317 type(c_ptr), value :: a_d, b_d, c_d, strm
318 integer(c_int) :: n
319 end subroutine cuda_col3
320
321 subroutine cuda_subcol3(a_d, b_d, c_d, n, strm) &
322 bind(c, name = 'cuda_subcol3')
323 use, intrinsic :: iso_c_binding, only : c_int, c_ptr
324 type(c_ptr), value :: a_d, b_d, c_d, strm
325 integer(c_int) :: n
326 end subroutine cuda_subcol3
327
328 subroutine cuda_sub2(a_d, b_d, n, strm) &
329 bind(c, name = 'cuda_sub2')
330 use, intrinsic :: iso_c_binding, only : c_int, c_ptr
331 type(c_ptr), value :: a_d, b_d, strm
332 integer(c_int) :: n
333 end subroutine cuda_sub2
334
335 subroutine cuda_sub3(a_d, b_d, c_d, n, strm) &
336 bind(c, name = 'cuda_sub3')
337 use, intrinsic :: iso_c_binding, only : c_int, c_ptr
338 type(c_ptr), value :: a_d, b_d, c_d, strm
339 integer(c_int) :: n
340 end subroutine cuda_sub3
341
342 subroutine cuda_add3(a_d, b_d, c_d, n, strm) &
343 bind(c, name = 'cuda_add3')
344 use, intrinsic :: iso_c_binding, only : c_int, c_ptr
345 type(c_ptr), value :: a_d, b_d, c_d, strm
346 integer(c_int) :: n
347 end subroutine cuda_add3
348
349 subroutine cuda_addcol3(a_d, b_d, c_d, n, strm) &
350 bind(c, name = 'cuda_addcol3')
351 use, intrinsic :: iso_c_binding, only : c_int, c_ptr
352 type(c_ptr), value :: a_d, b_d, c_d, strm
353 integer(c_int) :: n
354 end subroutine cuda_addcol3
355
356 subroutine cuda_addcol4(a_d, b_d, c_d, d_d, n, strm) &
357 bind(c, name = 'cuda_addcol4')
358 use, intrinsic :: iso_c_binding, only : c_int, c_ptr
359 type(c_ptr), value :: a_d, b_d, c_d, d_d, strm
360 integer(c_int) :: n
361 end subroutine cuda_addcol4
362
363 subroutine cuda_addcol3s2(a_d, b_d, c_d, s, n, strm) &
364 bind(c, name = 'cuda_addcol3s2')
365 use, intrinsic :: iso_c_binding, only : c_int, c_ptr
366 import c_rp
367 type(c_ptr), value :: a_d, b_d, c_d, strm
368 real(c_rp) :: s
369 integer(c_int) :: n
370 end subroutine cuda_addcol3s2
371
372 subroutine cuda_vdot3(dot_d, u1_d, u2_d, u3_d, v1_d, v2_d, v3_d, n, strm) &
373 bind(c, name = 'cuda_vdot3')
374 use, intrinsic :: iso_c_binding, only : c_int, c_ptr
375 type(c_ptr), value :: dot_d, u1_d, u2_d, u3_d, v1_d, v2_d, v3_d, strm
376 integer(c_int) :: n
377 end subroutine cuda_vdot3
378
379 subroutine cuda_vcross(u1_d, u2_d, u3_d, v1_d, v2_d, v3_d, &
380 w1_d, w2_d, w3_d, n, strm) &
381 bind(c, name = 'cuda_vcross')
382 use, intrinsic :: iso_c_binding, only : c_int, c_ptr
383 type(c_ptr), value :: u1_d, u2_d, u3_d
384 type(c_ptr), value :: v1_d, v2_d, v3_d
385 type(c_ptr), value :: w1_d, w2_d, w3_d
386 type(c_ptr), value :: strm
387 integer(c_int) :: n
388 end subroutine cuda_vcross
389
390 real(c_rp) function cuda_vlsc3(u_d, v_d, w_d, n, strm) &
391 bind(c, name = 'cuda_vlsc3')
392 use, intrinsic :: iso_c_binding, only : c_int, c_ptr
393 import c_rp
394 type(c_ptr), value :: u_d, v_d, w_d, strm
395 integer(c_int) :: n
396 end function cuda_vlsc3
397
398 subroutine cuda_add2s2_many(y_d, x_d_d, a_d, j, n, strm) &
399 bind(c, name = 'cuda_add2s2_many')
400 use, intrinsic :: iso_c_binding, only : c_int, c_ptr
401 import c_rp
402 type(c_ptr), value :: y_d, x_d_d, a_d, strm
403 integer(c_int) :: j, n
404 end subroutine cuda_add2s2_many
405
406 real(c_xp) function cuda_glsc3(a_d, b_d, c_d, n, strm) &
407 bind(c, name = 'cuda_glsc3')
408 use, intrinsic :: iso_c_binding, only : c_int, c_ptr
409 import c_xp
410 type(c_ptr), value :: a_d, b_d, c_d, strm
411 integer(c_int) :: n
412 end function cuda_glsc3
413
414 subroutine cuda_glsc3_many(h, w_d, v_d_d, mult_d, j, n, strm) &
415 bind(c, name = 'cuda_glsc3_many')
416 use, intrinsic :: iso_c_binding, only : c_int, c_ptr
417 import c_xp
418 type(c_ptr), value :: w_d, v_d_d, mult_d, strm
419 integer(c_int) :: j, n
420 real(c_xp) :: h(j)
421 end subroutine cuda_glsc3_many
422
423 real(c_xp) function cuda_glsc2(a_d, b_d, n, strm) &
424 bind(c, name = 'cuda_glsc2')
425 use, intrinsic :: iso_c_binding, only : c_int, c_ptr
426 import c_xp
427 type(c_ptr), value :: a_d, b_d, strm
428 integer(c_int) :: n
429 end function cuda_glsc2
430
431 real(c_xp) function cuda_glsubnorm2(a_d, b_d, n, strm) &
432 bind(c, name = 'cuda_glsubnorm2')
433 use, intrinsic :: iso_c_binding, only : c_int, c_ptr
434 import c_xp
435 type(c_ptr), value :: a_d, b_d, strm
436 integer(c_int) :: n
437 end function cuda_glsubnorm2
438
439 real(c_xp) function cuda_glsum(a_d, n, strm) &
440 bind(c, name = 'cuda_glsum')
441 use, intrinsic :: iso_c_binding, only : c_int, c_ptr
442 import c_xp
443 type(c_ptr), value :: a_d, strm
444 integer(c_int) :: n
445 end function cuda_glsum
446
447 real(c_rp) function cuda_glmax(a_d, ninf, n, strm) &
448 bind(c, name = 'cuda_glmax')
449 use, intrinsic :: iso_c_binding, only: c_int, c_ptr
450 import c_rp
451 type(c_ptr), value :: a_d, strm
452 real(c_rp) :: ninf
453 integer(c_int) :: n
454 end function cuda_glmax
455
456 real(c_rp) function cuda_glmin(a_d, pinf, n, strm) &
457 bind(c, name = 'cuda_glmin')
458 use, intrinsic :: iso_c_binding, only: c_int, c_ptr
459 import c_rp
460 type(c_ptr), value :: a_d, strm
461 real(c_rp) :: pinf
462 integer(c_int) :: n
463 end function cuda_glmin
464
465 subroutine cuda_absval(a_d, n, strm) &
466 bind(c, name = 'cuda_absval')
467 use, intrinsic :: iso_c_binding, only : c_int, c_ptr
468 import c_rp
469 type(c_ptr), value :: a_d, strm
470 integer(c_int) :: n
471 end subroutine cuda_absval
472 end interface
473
474 ! ========================================================================== !
475 ! Interfaces for the pointwise operations.
476
477 interface
478 subroutine cuda_pwmax_vec2(a_d, b_d, n, strm) &
479 bind(c, name = 'cuda_pwmax_vec2')
480 use, intrinsic :: iso_c_binding, only : c_int, c_ptr
481 type(c_ptr), value :: a_d, b_d, strm
482 integer(c_int) :: n
483 end subroutine cuda_pwmax_vec2
484
485 subroutine cuda_pwmax_vec3(a_d, b_d, c_d, n, strm) &
486 bind(c, name = 'cuda_pwmax_vec3')
487 use, intrinsic :: iso_c_binding, only : c_int, c_ptr
488 type(c_ptr), value :: a_d, b_d, c_d, strm
489 integer(c_int) :: n
490 end subroutine cuda_pwmax_vec3
491
492 subroutine cuda_pwmax_sca2(a_d, c_d, n, strm) &
493 bind(c, name = 'cuda_pwmax_sca2')
494 use, intrinsic :: iso_c_binding, only : c_int, c_ptr
495 import c_rp
496 type(c_ptr), value :: a_d, strm
497 real(c_rp) :: c_d
498 integer(c_int) :: n
499 end subroutine cuda_pwmax_sca2
500
501 subroutine cuda_pwmax_sca3(a_d, b_d, c_d, n, strm) &
502 bind(c, name = 'cuda_pwmax_sca3')
503 use, intrinsic :: iso_c_binding, only : c_int, c_ptr
504 import c_rp
505 type(c_ptr), value :: a_d, b_d, strm
506 real(c_rp) :: c_d
507 integer(c_int) :: n
508 end subroutine cuda_pwmax_sca3
509
510 subroutine cuda_pwmin_vec2(a_d, b_d, n, strm) &
511 bind(c, name = 'cuda_pwmin_vec2')
512 use, intrinsic :: iso_c_binding, only : c_int, c_ptr
513 type(c_ptr), value :: a_d, b_d, strm
514 integer(c_int) :: n
515 end subroutine cuda_pwmin_vec2
516
517 subroutine cuda_pwmin_vec3(a_d, b_d, c_d, n, strm) &
518 bind(c, name = 'cuda_pwmin_vec3')
519 use, intrinsic :: iso_c_binding, only : c_int, c_ptr
520 type(c_ptr), value :: a_d, b_d, c_d, strm
521 integer(c_int) :: n
522 end subroutine cuda_pwmin_vec3
523
524 subroutine cuda_pwmin_sca2(a_d, c_d, n, strm) &
525 bind(c, name = 'cuda_pwmin_sca2')
526 use, intrinsic :: iso_c_binding, only : c_int, c_ptr
527 import c_rp
528 type(c_ptr), value :: a_d, strm
529 real(c_rp) :: c_d
530 integer(c_int) :: n
531 end subroutine cuda_pwmin_sca2
532
533 subroutine cuda_pwmin_sca3(a_d, b_d, c_d, n, strm) &
534 bind(c, name = 'cuda_pwmin_sca3')
535 use, intrinsic :: iso_c_binding, only : c_int, c_ptr
536 import c_rp
537 type(c_ptr), value :: a_d, b_d, strm
538 real(c_rp) :: c_d
539 integer(c_int) :: n
540 end subroutine cuda_pwmin_sca3
541
542 end interface
543
544 ! ========================================================================== !
545 ! Interfaces for integer operations.
546
547 interface
548
549 subroutine cuda_iadd(a_d, c, n, strm) &
550 bind(c, name = 'cuda_iadd')
551 use, intrinsic :: iso_c_binding, only : c_int, c_ptr
552 import c_rp
553 type(c_ptr), value :: a_d, strm
554 integer(c_int) :: c
555 integer(c_int) :: n
556 end subroutine cuda_iadd
557
558 end interface
559end module cuda_math
integer, parameter, public c_xp
Definition num_types.f90:15
integer, parameter, public c_rp
Definition num_types.f90:13
integer, parameter, public rp
Global precision used in computations.
Definition num_types.f90:12