Neko 1.99.3
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
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_cfill(a_d, c, n, strm) &
182 bind(c, name = 'cuda_cfill')
183 use, intrinsic :: iso_c_binding, only : c_int, c_ptr
184 import c_rp
185 type(c_ptr), value :: a_d, strm
186 real(c_rp) :: c
187 integer(c_int) :: n
188 end subroutine cuda_cfill
189
190 subroutine cuda_rzero(a_d, n, strm) &
191 bind(c, name = 'cuda_rzero')
192 use, intrinsic :: iso_c_binding, only : c_int, c_ptr
193 type(c_ptr), value :: a_d, strm
194 integer(c_int) :: n
195 end subroutine cuda_rzero
196
197 subroutine cuda_add2(a_d, b_d, n, strm) &
198 bind(c, name = 'cuda_add2')
199 use, intrinsic :: iso_c_binding, only : c_int, c_ptr
200 import c_rp
201 type(c_ptr), value :: a_d, b_d, strm
202 integer(c_int) :: n
203 end subroutine cuda_add2
204
205 subroutine cuda_add4(a_d, b_d, c_d, d_d, n, strm) &
206 bind(c, name = 'cuda_add4')
207 use, intrinsic :: iso_c_binding, only : c_int, c_ptr
208 import c_rp
209 type(c_ptr), value :: a_d, b_d, c_d, d_d, strm
210 integer(c_int) :: n
211 end subroutine cuda_add4
212
213 subroutine cuda_add2s1(a_d, b_d, c1, n, strm) &
214 bind(c, name = 'cuda_add2s1')
215 use, intrinsic :: iso_c_binding, only : c_int, c_ptr
216 import c_rp
217 type(c_ptr), value :: a_d, b_d, strm
218 real(c_rp) :: c1
219 integer(c_int) :: n
220 end subroutine cuda_add2s1
221
222 subroutine cuda_add2s2(a_d, b_d, c1, n, strm) &
223 bind(c, name = 'cuda_add2s2')
224 use, intrinsic :: iso_c_binding, only : c_int, c_ptr
225 import c_rp
226 type(c_ptr), value :: a_d, b_d, strm
227 real(c_rp) :: c1
228 integer(c_int) :: n
229 end subroutine cuda_add2s2
230
231 subroutine cuda_addsqr2s2(a_d, b_d, c1, n, strm) &
232 bind(c, name = 'cuda_addsqr2s2')
233 use, intrinsic :: iso_c_binding, only : c_int, c_ptr
234 import c_rp
235 type(c_ptr), value :: a_d, b_d, strm
236 real(c_rp) :: c1
237 integer(c_int) :: n
238 end subroutine cuda_addsqr2s2
239
240 subroutine cuda_add3s2(a_d, b_d, c_d, c1, c2, n, strm) &
241 bind(c, name = 'cuda_add3s2')
242 use, intrinsic :: iso_c_binding, only : c_int, c_ptr
243 import c_rp
244 type(c_ptr), value :: a_d, b_d, c_d, strm
245 real(c_rp) :: c1, c2
246 integer(c_int) :: n
247 end subroutine cuda_add3s2
248
249 subroutine cuda_add4s3(a_d, b_d, c_d, d_d, c1, c2, c3, n, strm) &
250 bind(c, name = 'cuda_add4s3')
251 use, intrinsic :: iso_c_binding, only : c_int, c_ptr
252 import c_rp
253 type(c_ptr), value :: a_d, b_d, c_d, d_d, strm
254 real(c_rp) :: c1, c2, c3
255 integer(c_int) :: n
256 end subroutine cuda_add4s3
257
258 subroutine cuda_add5s4(a_d, b_d, c_d, d_d, e_d, c1, c2, c3, c4, n, strm) &
259 bind(c, name = 'cuda_add5s4')
260 use, intrinsic :: iso_c_binding, only : c_int, c_ptr
261 import c_rp
262 type(c_ptr), value :: a_d, b_d, c_d, d_d, e_d, strm
263 real(c_rp) :: c1, c2, c3, c4
264 integer(c_int) :: n
265 end subroutine cuda_add5s4
266
267 subroutine cuda_invcol1(a_d, n, strm) &
268 bind(c, name = 'cuda_invcol1')
269 use, intrinsic :: iso_c_binding, only : c_int, c_ptr
270 type(c_ptr), value :: a_d, strm
271 integer(c_int) :: n
272 end subroutine cuda_invcol1
273
274 subroutine cuda_invcol2(a_d, b_d, n, strm) &
275 bind(c, name = 'cuda_invcol2')
276 use, intrinsic :: iso_c_binding, only : c_int, c_ptr
277 type(c_ptr), value :: a_d, b_d, strm
278 integer(c_int) :: n
279 end subroutine cuda_invcol2
280
281 subroutine cuda_invcol3(a_d, b_d, c_d, n, strm) &
282 bind(c, name = 'cuda_invcol3')
283 use, intrinsic :: iso_c_binding, only : c_int, c_ptr
284 type(c_ptr), value :: a_d, b_d, c_d, strm
285 integer(c_int) :: n
286 end subroutine cuda_invcol3
287
288 subroutine cuda_col2(a_d, b_d, n, strm) &
289 bind(c, name = 'cuda_col2')
290 use, intrinsic :: iso_c_binding, only : c_int, c_ptr
291 type(c_ptr), value :: a_d, b_d, strm
292 integer(c_int) :: n
293 end subroutine cuda_col2
294
295 subroutine cuda_col3(a_d, b_d, c_d, n, strm) &
296 bind(c, name = 'cuda_col3')
297 use, intrinsic :: iso_c_binding, only : c_int, c_ptr
298 type(c_ptr), value :: a_d, b_d, c_d, strm
299 integer(c_int) :: n
300 end subroutine cuda_col3
301
302 subroutine cuda_subcol3(a_d, b_d, c_d, n, strm) &
303 bind(c, name = 'cuda_subcol3')
304 use, intrinsic :: iso_c_binding, only : c_int, c_ptr
305 type(c_ptr), value :: a_d, b_d, c_d, strm
306 integer(c_int) :: n
307 end subroutine cuda_subcol3
308
309 subroutine cuda_sub2(a_d, b_d, n, strm) &
310 bind(c, name = 'cuda_sub2')
311 use, intrinsic :: iso_c_binding, only : c_int, c_ptr
312 type(c_ptr), value :: a_d, b_d, strm
313 integer(c_int) :: n
314 end subroutine cuda_sub2
315
316 subroutine cuda_sub3(a_d, b_d, c_d, n, strm) &
317 bind(c, name = 'cuda_sub3')
318 use, intrinsic :: iso_c_binding, only : c_int, c_ptr
319 type(c_ptr), value :: a_d, b_d, c_d, strm
320 integer(c_int) :: n
321 end subroutine cuda_sub3
322
323 subroutine cuda_add3(a_d, b_d, c_d, n, strm) &
324 bind(c, name = 'cuda_add3')
325 use, intrinsic :: iso_c_binding, only : c_int, c_ptr
326 type(c_ptr), value :: a_d, b_d, c_d, strm
327 integer(c_int) :: n
328 end subroutine cuda_add3
329
330 subroutine cuda_addcol3(a_d, b_d, c_d, n, strm) &
331 bind(c, name = 'cuda_addcol3')
332 use, intrinsic :: iso_c_binding, only : c_int, c_ptr
333 type(c_ptr), value :: a_d, b_d, c_d, strm
334 integer(c_int) :: n
335 end subroutine cuda_addcol3
336
337 subroutine cuda_addcol4(a_d, b_d, c_d, d_d, n, strm) &
338 bind(c, name = 'cuda_addcol4')
339 use, intrinsic :: iso_c_binding, only : c_int, c_ptr
340 type(c_ptr), value :: a_d, b_d, c_d, d_d, strm
341 integer(c_int) :: n
342 end subroutine cuda_addcol4
343
344 subroutine cuda_addcol3s2(a_d, b_d, c_d, s, n, strm) &
345 bind(c, name = 'cuda_addcol3s2')
346 use, intrinsic :: iso_c_binding, only : c_int, c_ptr
347 import c_rp
348 type(c_ptr), value :: a_d, b_d, c_d, strm
349 real(c_rp) :: s
350 integer(c_int) :: n
351 end subroutine cuda_addcol3s2
352
353 subroutine cuda_vdot3(dot_d, u1_d, u2_d, u3_d, v1_d, v2_d, v3_d, n, strm) &
354 bind(c, name = 'cuda_vdot3')
355 use, intrinsic :: iso_c_binding, only : c_int, c_ptr
356 type(c_ptr), value :: dot_d, u1_d, u2_d, u3_d, v1_d, v2_d, v3_d, strm
357 integer(c_int) :: n
358 end subroutine cuda_vdot3
359
360 subroutine cuda_vcross(u1_d, u2_d, u3_d, v1_d, v2_d, v3_d, &
361 w1_d, w2_d, w3_d, n, strm) &
362 bind(c, name = 'cuda_vcross')
363 use, intrinsic :: iso_c_binding, only : c_int, c_ptr
364 type(c_ptr), value :: u1_d, u2_d, u3_d
365 type(c_ptr), value :: v1_d, v2_d, v3_d
366 type(c_ptr), value :: w1_d, w2_d, w3_d
367 type(c_ptr), value :: strm
368 integer(c_int) :: n
369 end subroutine cuda_vcross
370
371 real(c_rp) function cuda_vlsc3(u_d, v_d, w_d, n, strm) &
372 bind(c, name = 'cuda_vlsc3')
373 use, intrinsic :: iso_c_binding, only : c_int, c_ptr
374 import c_rp
375 type(c_ptr), value :: u_d, v_d, w_d, strm
376 integer(c_int) :: n
377 end function cuda_vlsc3
378
379 subroutine cuda_add2s2_many(y_d, x_d_d, a_d, j, n, strm) &
380 bind(c, name = 'cuda_add2s2_many')
381 use, intrinsic :: iso_c_binding, only : c_int, c_ptr
382 import c_rp
383 type(c_ptr), value :: y_d, x_d_d, a_d, strm
384 integer(c_int) :: j, n
385 end subroutine cuda_add2s2_many
386
387 real(c_rp) function cuda_glsc3(a_d, b_d, c_d, n, strm) &
388 bind(c, name = 'cuda_glsc3')
389 use, intrinsic :: iso_c_binding, only : c_int, c_ptr
390 import c_rp
391 type(c_ptr), value :: a_d, b_d, c_d, strm
392 integer(c_int) :: n
393 end function cuda_glsc3
394
395 subroutine cuda_glsc3_many(h, w_d, v_d_d, mult_d, j, n, strm) &
396 bind(c, name = 'cuda_glsc3_many')
397 use, intrinsic :: iso_c_binding, only : c_int, c_ptr
398 import c_rp
399 type(c_ptr), value :: w_d, v_d_d, mult_d, strm
400 integer(c_int) :: j, n
401 real(c_rp) :: h(j)
402 end subroutine cuda_glsc3_many
403
404 real(c_rp) function cuda_glsc2(a_d, b_d, n, strm) &
405 bind(c, name = 'cuda_glsc2')
406 use, intrinsic :: iso_c_binding, only : c_int, c_ptr
407 import c_rp
408 type(c_ptr), value :: a_d, b_d, strm
409 integer(c_int) :: n
410 end function cuda_glsc2
411
412 real(c_rp) function cuda_glsubnorm2(a_d, b_d, n, strm) &
413 bind(c, name = 'cuda_glsubnorm2')
414 use, intrinsic :: iso_c_binding, only : c_int, c_ptr
415 import c_rp
416 type(c_ptr), value :: a_d, b_d, strm
417 integer(c_int) :: n
418 end function cuda_glsubnorm2
419
420 real(c_rp) function cuda_glsum(a_d, n, strm) &
421 bind(c, name = 'cuda_glsum')
422 use, intrinsic :: iso_c_binding, only : c_int, c_ptr
423 import c_rp
424 type(c_ptr), value :: a_d, strm
425 integer(c_int) :: n
426 end function cuda_glsum
427
428 real(c_rp) function cuda_glmax(a_d, ninf, n, strm) &
429 bind(c, name = 'cuda_glmax')
430 use, intrinsic :: iso_c_binding, only: c_int, c_ptr
431 import c_rp
432 type(c_ptr), value :: a_d, strm
433 real(c_rp) :: ninf
434 integer(c_int) :: n
435 end function cuda_glmax
436
437 real(c_rp) function cuda_glmin(a_d, pinf, n, strm) &
438 bind(c, name = 'cuda_glmin')
439 use, intrinsic :: iso_c_binding, only: c_int, c_ptr
440 import c_rp
441 type(c_ptr), value :: a_d, strm
442 real(c_rp) :: pinf
443 integer(c_int) :: n
444 end function cuda_glmin
445
446 subroutine cuda_absval(a_d, n, strm) &
447 bind(c, name = 'cuda_absval')
448 use, intrinsic :: iso_c_binding, only : c_int, c_ptr
449 import c_rp
450 type(c_ptr), value :: a_d, strm
451 integer(c_int) :: n
452 end subroutine cuda_absval
453 end interface
454
455 ! ========================================================================== !
456 ! Interfaces for the pointwise operations.
457
458 interface
459 subroutine cuda_pwmax_vec2(a_d, b_d, n, strm) &
460 bind(c, name = 'cuda_pwmax_vec2')
461 use, intrinsic :: iso_c_binding, only : c_int, c_ptr
462 type(c_ptr), value :: a_d, b_d, strm
463 integer(c_int) :: n
464 end subroutine cuda_pwmax_vec2
465
466 subroutine cuda_pwmax_vec3(a_d, b_d, c_d, n, strm) &
467 bind(c, name = 'cuda_pwmax_vec3')
468 use, intrinsic :: iso_c_binding, only : c_int, c_ptr
469 type(c_ptr), value :: a_d, b_d, c_d, strm
470 integer(c_int) :: n
471 end subroutine cuda_pwmax_vec3
472
473 subroutine cuda_pwmax_sca2(a_d, c_d, n, strm) &
474 bind(c, name = 'cuda_pwmax_sca2')
475 use, intrinsic :: iso_c_binding, only : c_int, c_ptr
476 import c_rp
477 type(c_ptr), value :: a_d, strm
478 real(c_rp) :: c_d
479 integer(c_int) :: n
480 end subroutine cuda_pwmax_sca2
481
482 subroutine cuda_pwmax_sca3(a_d, b_d, c_d, n, strm) &
483 bind(c, name = 'cuda_pwmax_sca3')
484 use, intrinsic :: iso_c_binding, only : c_int, c_ptr
485 import c_rp
486 type(c_ptr), value :: a_d, b_d, strm
487 real(c_rp) :: c_d
488 integer(c_int) :: n
489 end subroutine cuda_pwmax_sca3
490
491 subroutine cuda_pwmin_vec2(a_d, b_d, n, strm) &
492 bind(c, name = 'cuda_pwmin_vec2')
493 use, intrinsic :: iso_c_binding, only : c_int, c_ptr
494 type(c_ptr), value :: a_d, b_d, strm
495 integer(c_int) :: n
496 end subroutine cuda_pwmin_vec2
497
498 subroutine cuda_pwmin_vec3(a_d, b_d, c_d, n, strm) &
499 bind(c, name = 'cuda_pwmin_vec3')
500 use, intrinsic :: iso_c_binding, only : c_int, c_ptr
501 type(c_ptr), value :: a_d, b_d, c_d, strm
502 integer(c_int) :: n
503 end subroutine cuda_pwmin_vec3
504
505 subroutine cuda_pwmin_sca2(a_d, c_d, n, strm) &
506 bind(c, name = 'cuda_pwmin_sca2')
507 use, intrinsic :: iso_c_binding, only : c_int, c_ptr
508 import c_rp
509 type(c_ptr), value :: a_d, strm
510 real(c_rp) :: c_d
511 integer(c_int) :: n
512 end subroutine cuda_pwmin_sca2
513
514 subroutine cuda_pwmin_sca3(a_d, b_d, c_d, n, strm) &
515 bind(c, name = 'cuda_pwmin_sca3')
516 use, intrinsic :: iso_c_binding, only : c_int, c_ptr
517 import c_rp
518 type(c_ptr), value :: a_d, b_d, strm
519 real(c_rp) :: c_d
520 integer(c_int) :: n
521 end subroutine cuda_pwmin_sca3
522
523 end interface
524
525 ! ========================================================================== !
526 ! Interfaces for integer operations.
527
528 interface
529
530 subroutine cuda_iadd(a_d, c, n, strm) &
531 bind(c, name = 'cuda_iadd')
532 use, intrinsic :: iso_c_binding, only : c_int, c_ptr
533 import c_rp
534 type(c_ptr), value :: a_d, strm
535 integer(c_int) :: c
536 integer(c_int) :: n
537 end subroutine cuda_iadd
538
539 end interface
540end module cuda_math
integer, parameter, public c_rp
Definition num_types.f90:13
integer, parameter, public rp
Global precision used in computations.
Definition num_types.f90:12