libgomp updates.
[official-gcc.git] / libgomp / openacc.f90
blobc2952e7661c35270dc75c87c2b12799d3f4eba51
1 ! OpenACC Runtime Library Definitions.
3 ! Copyright (C) 2014 Free Software Foundation, Inc.
5 ! Contributed by Tobias Burnus <burnus@net-b.de>
6 ! and Mentor Embedded.
8 ! This file is part of the GNU Offloading and Multi Processing Library
9 ! (libgomp).
11 ! Libgomp is free software; you can redistribute it and/or modify it
12 ! under the terms of the GNU General Public License as published by
13 ! the Free Software Foundation; either version 3, or (at your option)
14 ! any later version.
16 ! Libgomp is distributed in the hope that it will be useful, but WITHOUT ANY
17 ! WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
18 ! FOR A PARTICULAR PURPOSE. See the GNU General Public License for
19 ! more details.
21 ! Under Section 7 of GPL version 3, you are granted additional
22 ! permissions described in the GCC Runtime Library Exception, version
23 ! 3.1, as published by the Free Software Foundation.
25 ! You should have received a copy of the GNU General Public License and
26 ! a copy of the GCC Runtime Library Exception along with this program;
27 ! see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
28 ! <http://www.gnu.org/licenses/>.
30 module openacc_kinds
31 use iso_fortran_env, only: int32
32 implicit none
34 private :: int32
35 public :: acc_device_kind
37 integer, parameter :: acc_device_kind = int32
39 public :: acc_device_none, acc_device_default, acc_device_host
40 public :: acc_device_not_host, acc_device_nvidia
42 integer (acc_device_kind), parameter :: acc_device_none = 0
43 integer (acc_device_kind), parameter :: acc_device_default = 1
44 integer (acc_device_kind), parameter :: acc_device_host = 2
45 integer (acc_device_kind), parameter :: acc_device_host_nonshm = 3
46 integer (acc_device_kind), parameter :: acc_device_not_host = 4
47 integer (acc_device_kind), parameter :: acc_device_nvidia = 5
49 public :: acc_handle_kind
51 integer, parameter :: acc_handle_kind = int32
53 public :: acc_async_noval, acc_async_sync
55 integer (acc_handle_kind), parameter :: acc_async_noval = -1
56 integer (acc_handle_kind), parameter :: acc_async_sync = -2
58 end module
60 module openacc_internal
61 use openacc_kinds
62 implicit none
64 interface
65 function acc_get_num_devices_h (d)
66 import
67 integer acc_get_num_devices_h
68 integer (acc_device_kind) d
69 end function
71 subroutine acc_set_device_type_h (d)
72 import
73 integer (acc_device_kind) d
74 end subroutine
76 function acc_get_device_type_h ()
77 import
78 integer (acc_device_kind) acc_get_device_type_h
79 end function
81 subroutine acc_set_device_num_h (n, d)
82 import
83 integer n
84 integer (acc_device_kind) d
85 end subroutine
87 function acc_get_device_num_h (d)
88 import
89 integer acc_get_device_num_h
90 integer (acc_device_kind) d
91 end function
93 function acc_async_test_h (a)
94 logical acc_async_test_h
95 integer a
96 end function
98 function acc_async_test_all_h ()
99 logical acc_async_test_all_h
100 end function
102 subroutine acc_wait_h (a)
103 integer a
104 end subroutine
106 subroutine acc_wait_async_h (a1, a2)
107 integer a1, a2
108 end subroutine
110 subroutine acc_wait_all_h ()
111 end subroutine
113 subroutine acc_wait_all_async_h (a)
114 integer a
115 end subroutine
117 subroutine acc_init_h (d)
118 import
119 integer (acc_device_kind) d
120 end subroutine
122 subroutine acc_shutdown_h (d)
123 import
124 integer (acc_device_kind) d
125 end subroutine
127 function acc_on_device_h (d)
128 import
129 integer (acc_device_kind) d
130 logical acc_on_device_h
131 end function
133 subroutine acc_copyin_32_h (a, len)
134 use iso_c_binding, only: c_int32_t
135 !GCC$ ATTRIBUTES NO_ARG_CHECK :: a
136 type (*), dimension (*) :: a
137 integer (c_int32_t) len
138 end subroutine
140 subroutine acc_copyin_64_h (a, len)
141 use iso_c_binding, only: c_int64_t
142 !GCC$ ATTRIBUTES NO_ARG_CHECK :: a
143 type (*), dimension (*) :: a
144 integer (c_int64_t) len
145 end subroutine
147 subroutine acc_copyin_array_h (a)
148 type (*), dimension (..), contiguous :: a
149 end subroutine
151 subroutine acc_present_or_copyin_32_h (a, len)
152 use iso_c_binding, only: c_int32_t
153 !GCC$ ATTRIBUTES NO_ARG_CHECK :: a
154 type (*), dimension (*) :: a
155 integer (c_int32_t) len
156 end subroutine
158 subroutine acc_present_or_copyin_64_h (a, len)
159 use iso_c_binding, only: c_int64_t
160 !GCC$ ATTRIBUTES NO_ARG_CHECK :: a
161 type (*), dimension (*) :: a
162 integer (c_int64_t) len
163 end subroutine
165 subroutine acc_present_or_copyin_array_h (a)
166 type (*), dimension (..), contiguous :: a
167 end subroutine
169 subroutine acc_create_32_h (a, len)
170 use iso_c_binding, only: c_int32_t
171 !GCC$ ATTRIBUTES NO_ARG_CHECK :: a
172 type (*), dimension (*) :: a
173 integer (c_int32_t) len
174 end subroutine
176 subroutine acc_create_64_h (a, len)
177 use iso_c_binding, only: c_int64_t
178 !GCC$ ATTRIBUTES NO_ARG_CHECK :: a
179 type (*), dimension (*) :: a
180 integer (c_int64_t) len
181 end subroutine
183 subroutine acc_create_array_h (a)
184 type (*), dimension (..), contiguous :: a
185 end subroutine
187 subroutine acc_present_or_create_32_h (a, len)
188 use iso_c_binding, only: c_int32_t
189 !GCC$ ATTRIBUTES NO_ARG_CHECK :: a
190 type (*), dimension (*) :: a
191 integer (c_int32_t) len
192 end subroutine
194 subroutine acc_present_or_create_64_h (a, len)
195 use iso_c_binding, only: c_int64_t
196 !GCC$ ATTRIBUTES NO_ARG_CHECK :: a
197 type (*), dimension (*) :: a
198 integer (c_int64_t) len
199 end subroutine
201 subroutine acc_present_or_create_array_h (a)
202 type (*), dimension (..), contiguous :: a
203 end subroutine
205 subroutine acc_copyout_32_h (a, len)
206 use iso_c_binding, only: c_int32_t
207 !GCC$ ATTRIBUTES NO_ARG_CHECK :: a
208 type (*), dimension (*) :: a
209 integer (c_int32_t) len
210 end subroutine
212 subroutine acc_copyout_64_h (a, len)
213 use iso_c_binding, only: c_int64_t
214 !GCC$ ATTRIBUTES NO_ARG_CHECK :: a
215 type (*), dimension (*) :: a
216 integer (c_int64_t) len
217 end subroutine
219 subroutine acc_copyout_array_h (a)
220 type (*), dimension (..), contiguous :: a
221 end subroutine
223 subroutine acc_delete_32_h (a, len)
224 use iso_c_binding, only: c_int32_t
225 !GCC$ ATTRIBUTES NO_ARG_CHECK :: a
226 type (*), dimension (*) :: a
227 integer (c_int32_t) len
228 end subroutine
230 subroutine acc_delete_64_h (a, len)
231 use iso_c_binding, only: c_int64_t
232 !GCC$ ATTRIBUTES NO_ARG_CHECK :: a
233 type (*), dimension (*) :: a
234 integer (c_int64_t) len
235 end subroutine
237 subroutine acc_delete_array_h (a)
238 type (*), dimension (..), contiguous :: a
239 end subroutine
241 subroutine acc_update_device_32_h (a, len)
242 use iso_c_binding, only: c_int32_t
243 !GCC$ ATTRIBUTES NO_ARG_CHECK :: a
244 type (*), dimension (*) :: a
245 integer (c_int32_t) len
246 end subroutine
248 subroutine acc_update_device_64_h (a, len)
249 use iso_c_binding, only: c_int64_t
250 !GCC$ ATTRIBUTES NO_ARG_CHECK :: a
251 type (*), dimension (*) :: a
252 integer (c_int64_t) len
253 end subroutine
255 subroutine acc_update_device_array_h (a)
256 type (*), dimension (..), contiguous :: a
257 end subroutine
259 subroutine acc_update_self_32_h (a, len)
260 use iso_c_binding, only: c_int32_t
261 !GCC$ ATTRIBUTES NO_ARG_CHECK :: a
262 type (*), dimension (*) :: a
263 integer (c_int32_t) len
264 end subroutine
266 subroutine acc_update_self_64_h (a, len)
267 use iso_c_binding, only: c_int64_t
268 !GCC$ ATTRIBUTES NO_ARG_CHECK :: a
269 type (*), dimension (*) :: a
270 integer (c_int64_t) len
271 end subroutine
273 subroutine acc_update_self_array_h (a)
274 type (*), dimension (..), contiguous :: a
275 end subroutine
277 function acc_is_present_32_h (a, len)
278 use iso_c_binding, only: c_int32_t
279 logical acc_is_present_32_h
280 !GCC$ ATTRIBUTES NO_ARG_CHECK :: a
281 type (*), dimension (*) :: a
282 integer (c_int32_t) len
283 end function
285 function acc_is_present_64_h (a, len)
286 use iso_c_binding, only: c_int64_t
287 logical acc_is_present_64_h
288 !GCC$ ATTRIBUTES NO_ARG_CHECK :: a
289 type (*), dimension (*) :: a
290 integer (c_int64_t) len
291 end function
293 function acc_is_present_array_h (a)
294 logical acc_is_present_array_h
295 type (*), dimension (..), contiguous :: a
296 end function
297 end interface
299 interface
300 function acc_get_num_devices_l (d) &
301 bind (C, name = "acc_get_num_devices")
302 use iso_c_binding, only: c_int
303 integer (c_int) :: acc_get_num_devices_l
304 integer (c_int), value :: d
305 end function
307 subroutine acc_set_device_type_l (d) &
308 bind (C, name = "acc_set_device_type")
309 use iso_c_binding, only: c_int
310 integer (c_int), value :: d
311 end subroutine
313 function acc_get_device_type_l () &
314 bind (C, name = "acc_get_device_type")
315 use iso_c_binding, only: c_int
316 integer (c_int) :: acc_get_device_type_l
317 end function
319 subroutine acc_set_device_num_l (n, d) &
320 bind (C, name = "acc_set_device_num")
321 use iso_c_binding, only: c_int
322 integer (c_int), value :: n, d
323 end subroutine
325 function acc_get_device_num_l (d) &
326 bind (C, name = "acc_get_device_num")
327 use iso_c_binding, only: c_int
328 integer (c_int) :: acc_get_device_num_l
329 integer (c_int), value :: d
330 end function
332 function acc_async_test_l (a) &
333 bind (C, name = "acc_async_test")
334 use iso_c_binding, only: c_int
335 integer (c_int) :: acc_async_test_l
336 integer (c_int), value :: a
337 end function
339 function acc_async_test_all_l () &
340 bind (C, name = "acc_async_test_all")
341 use iso_c_binding, only: c_int
342 integer (c_int) :: acc_async_test_all_l
343 end function
345 subroutine acc_wait_l (a) &
346 bind (C, name = "acc_wait")
347 use iso_c_binding, only: c_int
348 integer (c_int), value :: a
349 end subroutine
351 subroutine acc_wait_async_l (a1, a2) &
352 bind (C, name = "acc_wait_async")
353 use iso_c_binding, only: c_int
354 integer (c_int), value :: a1, a2
355 end subroutine
357 subroutine acc_wait_all_l () &
358 bind (C, name = "acc_wait_all")
359 use iso_c_binding, only: c_int
360 end subroutine
362 subroutine acc_wait_all_async_l (a) &
363 bind (C, name = "acc_wait_all_async")
364 use iso_c_binding, only: c_int
365 integer (c_int), value :: a
366 end subroutine
368 subroutine acc_init_l (d) &
369 bind (C, name = "acc_init")
370 use iso_c_binding, only: c_int
371 integer (c_int), value :: d
372 end subroutine
374 subroutine acc_shutdown_l (d) &
375 bind (C, name = "acc_shutdown")
376 use iso_c_binding, only: c_int
377 integer (c_int), value :: d
378 end subroutine
380 function acc_on_device_l (d) &
381 bind (C, name = "acc_on_device")
382 use iso_c_binding, only: c_int
383 integer (c_int) :: acc_on_device_l
384 integer (c_int), value :: d
385 end function
387 subroutine acc_copyin_l (a, len) &
388 bind (C, name = "acc_copyin")
389 use iso_c_binding, only: c_size_t
390 !GCC$ ATTRIBUTES NO_ARG_CHECK :: a
391 type (*), dimension (*) :: a
392 integer (c_size_t), value :: len
393 end subroutine
395 subroutine acc_present_or_copyin_l (a, len) &
396 bind (C, name = "acc_present_or_copyin")
397 use iso_c_binding, only: c_size_t
398 !GCC$ ATTRIBUTES NO_ARG_CHECK :: a
399 type (*), dimension (*) :: a
400 integer (c_size_t), value :: len
401 end subroutine
403 subroutine acc_create_l (a, len) &
404 bind (C, name = "acc_create")
405 use iso_c_binding, only: c_size_t
406 !GCC$ ATTRIBUTES NO_ARG_CHECK :: a
407 type (*), dimension (*) :: a
408 integer (c_size_t), value :: len
409 end subroutine
411 subroutine acc_present_or_create_l (a, len) &
412 bind (C, name = "acc_present_or_create")
413 use iso_c_binding, only: c_size_t
414 !GCC$ ATTRIBUTES NO_ARG_CHECK :: a
415 type (*), dimension (*) :: a
416 integer (c_size_t), value :: len
417 end subroutine
419 subroutine acc_copyout_l (a, len) &
420 bind (C, name = "acc_copyout")
421 use iso_c_binding, only: c_size_t
422 !GCC$ ATTRIBUTES NO_ARG_CHECK :: a
423 type (*), dimension (*) :: a
424 integer (c_size_t), value :: len
425 end subroutine
427 subroutine acc_delete_l (a, len) &
428 bind (C, name = "acc_delete")
429 use iso_c_binding, only: c_size_t
430 !GCC$ ATTRIBUTES NO_ARG_CHECK :: a
431 type (*), dimension (*) :: a
432 integer (c_size_t), value :: len
433 end subroutine
435 subroutine acc_update_device_l (a, len) &
436 bind (C, name = "acc_update_device")
437 use iso_c_binding, only: c_size_t
438 !GCC$ ATTRIBUTES NO_ARG_CHECK :: a
439 type (*), dimension (*) :: a
440 integer (c_size_t), value :: len
441 end subroutine
443 subroutine acc_update_self_l (a, len) &
444 bind (C, name = "acc_update_self")
445 use iso_c_binding, only: c_size_t
446 !GCC$ ATTRIBUTES NO_ARG_CHECK :: a
447 type (*), dimension (*) :: a
448 integer (c_size_t), value :: len
449 end subroutine
451 function acc_is_present_l (a, len) &
452 bind (C, name = "acc_is_present")
453 use iso_c_binding, only: c_int32_t, c_size_t
454 !GCC$ ATTRIBUTES NO_ARG_CHECK :: a
455 integer (c_int32_t) :: acc_is_present_l
456 type (*), dimension (*) :: a
457 integer (c_size_t), value :: len
458 end function
459 end interface
460 end module
462 module openacc
463 use openacc_kinds
464 use openacc_internal
465 implicit none
467 public :: openacc_version
469 public :: acc_get_num_devices, acc_set_device_type, acc_get_device_type
470 public :: acc_set_device_num, acc_get_device_num, acc_async_test
471 public :: acc_async_test_all, acc_wait, acc_wait_async, acc_wait_all
472 public :: acc_wait_all_async, acc_init, acc_shutdown, acc_on_device
473 public :: acc_copyin, acc_present_or_copyin, acc_pcopyin, acc_create
474 public :: acc_present_or_create, acc_pcreate, acc_copyout, acc_delete
475 public :: acc_update_device, acc_update_self, acc_is_present
477 integer, parameter :: openacc_version = 201306
479 interface acc_get_num_devices
480 procedure :: acc_get_num_devices_h
481 end interface
483 interface acc_set_device_type
484 procedure :: acc_set_device_type_h
485 end interface
487 interface acc_get_device_type
488 procedure :: acc_get_device_type_h
489 end interface
491 interface acc_set_device_num
492 procedure :: acc_set_device_num_h
493 end interface
495 interface acc_get_device_num
496 procedure :: acc_get_device_num_h
497 end interface
499 interface acc_async_test
500 procedure :: acc_async_test_h
501 end interface
503 interface acc_async_test_all
504 procedure :: acc_async_test_all_h
505 end interface
507 interface acc_wait
508 procedure :: acc_wait_h
509 end interface
511 interface acc_wait_async
512 procedure :: acc_wait_async_h
513 end interface
515 interface acc_wait_all
516 procedure :: acc_wait_all_h
517 end interface
519 interface acc_wait_all_async
520 procedure :: acc_wait_all_async_h
521 end interface
523 interface acc_init
524 procedure :: acc_init_h
525 end interface
527 interface acc_shutdown
528 procedure :: acc_shutdown_h
529 end interface
531 interface acc_on_device
532 procedure :: acc_on_device_h
533 end interface
535 ! acc_malloc: Only available in C/C++
536 ! acc_free: Only available in C/C++
538 ! As vendor extension, the following code supports both 32bit and 64bit
539 ! arguments for "size"; the OpenACC standard only permits default-kind
540 ! integers, which are of kind 4 (i.e. 32 bits).
541 ! Additionally, the two-argument version also takes arrays as argument.
542 ! and the one argument version also scalars. Note that the code assumes
543 ! that the arrays are contiguous.
545 interface acc_copyin
546 procedure :: acc_copyin_32_h
547 procedure :: acc_copyin_64_h
548 procedure :: acc_copyin_array_h
549 end interface
551 interface acc_present_or_copyin
552 procedure :: acc_present_or_copyin_32_h
553 procedure :: acc_present_or_copyin_64_h
554 procedure :: acc_present_or_copyin_array_h
555 end interface
557 interface acc_pcopyin
558 procedure :: acc_present_or_copyin_32_h
559 procedure :: acc_present_or_copyin_64_h
560 procedure :: acc_present_or_copyin_array_h
561 end interface
563 interface acc_create
564 procedure :: acc_create_32_h
565 procedure :: acc_create_64_h
566 procedure :: acc_create_array_h
567 end interface
569 interface acc_present_or_create
570 procedure :: acc_present_or_create_32_h
571 procedure :: acc_present_or_create_64_h
572 procedure :: acc_present_or_create_array_h
573 end interface
575 interface acc_pcreate
576 procedure :: acc_present_or_create_32_h
577 procedure :: acc_present_or_create_64_h
578 procedure :: acc_present_or_create_array_h
579 end interface
581 interface acc_copyout
582 procedure :: acc_copyout_32_h
583 procedure :: acc_copyout_64_h
584 procedure :: acc_copyout_array_h
585 end interface
587 interface acc_delete
588 procedure :: acc_delete_32_h
589 procedure :: acc_delete_64_h
590 procedure :: acc_delete_array_h
591 end interface
593 interface acc_update_device
594 procedure :: acc_update_device_32_h
595 procedure :: acc_update_device_64_h
596 procedure :: acc_update_device_array_h
597 end interface
599 interface acc_update_self
600 procedure :: acc_update_self_32_h
601 procedure :: acc_update_self_64_h
602 procedure :: acc_update_self_array_h
603 end interface
605 ! acc_map_data: Only available in C/C++
606 ! acc_unmap_data: Only available in C/C++
607 ! acc_deviceptr: Only available in C/C++
608 ! acc_hostptr: Only available in C/C++
610 interface acc_is_present
611 procedure :: acc_is_present_32_h
612 procedure :: acc_is_present_64_h
613 procedure :: acc_is_present_array_h
614 end interface
616 ! acc_memcpy_to_device: Only available in C/C++
617 ! acc_memcpy_from_device: Only available in C/C++
619 end module
621 function acc_get_num_devices_h (d)
622 use openacc_internal, only: acc_get_num_devices_l
623 use openacc_kinds
624 integer acc_get_num_devices_h
625 integer (acc_device_kind) d
626 acc_get_num_devices_h = acc_get_num_devices_l (d)
627 end function
629 subroutine acc_set_device_type_h (d)
630 use openacc_internal, only: acc_set_device_type_l
631 use openacc_kinds
632 integer (acc_device_kind) d
633 call acc_set_device_type_l (d)
634 end subroutine
636 function acc_get_device_type_h ()
637 use openacc_internal, only: acc_get_device_type_l
638 use openacc_kinds
639 integer (acc_device_kind) acc_get_device_type_h
640 acc_get_device_type_h = acc_get_device_type_l ()
641 end function
643 subroutine acc_set_device_num_h (n, d)
644 use openacc_internal, only: acc_set_device_num_l
645 use openacc_kinds
646 integer n
647 integer (acc_device_kind) d
648 call acc_set_device_num_l (n, d)
649 end subroutine
651 function acc_get_device_num_h (d)
652 use openacc_internal, only: acc_get_device_num_l
653 use openacc_kinds
654 integer acc_get_device_num_h
655 integer (acc_device_kind) d
656 acc_get_device_num_h = acc_get_device_num_l (d)
657 end function
659 function acc_async_test_h (a)
660 use openacc_internal, only: acc_async_test_l
661 logical acc_async_test_h
662 integer a
663 if (acc_async_test_l (a) .eq. 1) then
664 acc_async_test_h = .TRUE.
665 else
666 acc_async_test_h = .FALSE.
667 end if
668 end function
670 function acc_async_test_all_h ()
671 use openacc_internal, only: acc_async_test_all_l
672 logical acc_async_test_all_h
673 if (acc_async_test_all_l () .eq. 1) then
674 acc_async_test_all_h = .TRUE.
675 else
676 acc_async_test_all_h = .FALSE.
677 end if
678 end function
680 subroutine acc_wait_h (a)
681 use openacc_internal, only: acc_wait_l
682 integer a
683 call acc_wait_l (a)
684 end subroutine
686 subroutine acc_wait_async_h (a1, a2)
687 use openacc_internal, only: acc_wait_async_l
688 integer a1, a2
689 call acc_wait_async_l (a1, a2)
690 end subroutine
692 subroutine acc_wait_all_h ()
693 use openacc_internal, only: acc_wait_all_l
694 call acc_wait_all_l ()
695 end subroutine
697 subroutine acc_wait_all_async_h (a)
698 use openacc_internal, only: acc_wait_all_async_l
699 integer a
700 call acc_wait_all_async_l (a)
701 end subroutine
703 subroutine acc_init_h (d)
704 use openacc_internal, only: acc_init_l
705 use openacc_kinds
706 integer (acc_device_kind) d
707 call acc_init_l (d)
708 end subroutine
710 subroutine acc_shutdown_h (d)
711 use openacc_internal, only: acc_shutdown_l
712 use openacc_kinds
713 integer (acc_device_kind) d
714 call acc_shutdown_l (d)
715 end subroutine
717 function acc_on_device_h (d)
718 use openacc_internal, only: acc_on_device_l
719 use openacc_kinds
720 integer (acc_device_kind) d
721 logical acc_on_device_h
722 if (acc_on_device_l (d) .eq. 1) then
723 acc_on_device_h = .TRUE.
724 else
725 acc_on_device_h = .FALSE.
726 end if
727 end function
729 subroutine acc_copyin_32_h (a, len)
730 use iso_c_binding, only: c_int32_t, c_size_t
731 use openacc_internal, only: acc_copyin_l
732 !GCC$ ATTRIBUTES NO_ARG_CHECK :: a
733 type (*), dimension (*) :: a
734 integer (c_int32_t) len
735 call acc_copyin_l (a, int (len, kind = c_size_t))
736 end subroutine
738 subroutine acc_copyin_64_h (a, len)
739 use iso_c_binding, only: c_int64_t, c_size_t
740 use openacc_internal, only: acc_copyin_l
741 !GCC$ ATTRIBUTES NO_ARG_CHECK :: a
742 type (*), dimension (*) :: a
743 integer (c_int64_t) len
744 call acc_copyin_l (a, int (len, kind = c_size_t))
745 end subroutine
747 subroutine acc_copyin_array_h (a)
748 use openacc_internal, only: acc_copyin_l
749 type (*), dimension (..), contiguous :: a
750 call acc_copyin_l (a, sizeof (a))
751 end subroutine
753 subroutine acc_present_or_copyin_32_h (a, len)
754 use iso_c_binding, only: c_int32_t, c_size_t
755 use openacc_internal, only: acc_present_or_copyin_l
756 !GCC$ ATTRIBUTES NO_ARG_CHECK :: a
757 type (*), dimension (*) :: a
758 integer (c_int32_t) len
759 call acc_present_or_copyin_l (a, int (len, kind = c_size_t))
760 end subroutine
762 subroutine acc_present_or_copyin_64_h (a, len)
763 use iso_c_binding, only: c_int64_t, c_size_t
764 use openacc_internal, only: acc_present_or_copyin_l
765 !GCC$ ATTRIBUTES NO_ARG_CHECK :: a
766 type (*), dimension (*) :: a
767 integer (c_int64_t) len
768 call acc_present_or_copyin_l (a, int (len, kind = c_size_t))
769 end subroutine
771 subroutine acc_present_or_copyin_array_h (a)
772 use openacc_internal, only: acc_present_or_copyin_l
773 type (*), dimension (..), contiguous :: a
774 call acc_present_or_copyin_l (a, sizeof (a))
775 end subroutine
777 subroutine acc_create_32_h (a, len)
778 use iso_c_binding, only: c_int32_t, c_size_t
779 use openacc_internal, only: acc_create_l
780 !GCC$ ATTRIBUTES NO_ARG_CHECK :: a
781 type (*), dimension (*) :: a
782 integer (c_int32_t) len
783 call acc_create_l (a, int (len, kind = c_size_t))
784 end subroutine
786 subroutine acc_create_64_h (a, len)
787 use iso_c_binding, only: c_int64_t, c_size_t
788 use openacc_internal, only: acc_create_l
789 !GCC$ ATTRIBUTES NO_ARG_CHECK :: a
790 type (*), dimension (*) :: a
791 integer (c_int64_t) len
792 call acc_create_l (a, int (len, kind = c_size_t))
793 end subroutine
795 subroutine acc_create_array_h (a)
796 use openacc_internal, only: acc_create_l
797 type (*), dimension (..), contiguous :: a
798 call acc_create_l (a, sizeof (a))
799 end subroutine
801 subroutine acc_present_or_create_32_h (a, len)
802 use iso_c_binding, only: c_int32_t, c_size_t
803 use openacc_internal, only: acc_present_or_create_l
804 !GCC$ ATTRIBUTES NO_ARG_CHECK :: a
805 type (*), dimension (*) :: a
806 integer (c_int32_t) len
807 call acc_present_or_create_l (a, int (len, kind = c_size_t))
808 end subroutine
810 subroutine acc_present_or_create_64_h (a, len)
811 use iso_c_binding, only: c_int64_t, c_size_t
812 use openacc_internal, only: acc_present_or_create_l
813 !GCC$ ATTRIBUTES NO_ARG_CHECK :: a
814 type (*), dimension (*) :: a
815 integer (c_int64_t) len
816 call acc_present_or_create_l (a, int (len, kind = c_size_t))
817 end subroutine
819 subroutine acc_present_or_create_array_h (a)
820 use openacc_internal, only: acc_present_or_create_l
821 type (*), dimension (..), contiguous :: a
822 call acc_present_or_create_l (a, sizeof (a))
823 end subroutine
825 subroutine acc_copyout_32_h (a, len)
826 use iso_c_binding, only: c_int32_t, c_size_t
827 use openacc_internal, only: acc_copyout_l
828 !GCC$ ATTRIBUTES NO_ARG_CHECK :: a
829 type (*), dimension (*) :: a
830 integer (c_int32_t) len
831 call acc_copyout_l (a, int (len, kind = c_size_t))
832 end subroutine
834 subroutine acc_copyout_64_h (a, len)
835 use iso_c_binding, only: c_int64_t, c_size_t
836 use openacc_internal, only: acc_copyout_l
837 !GCC$ ATTRIBUTES NO_ARG_CHECK :: a
838 type (*), dimension (*) :: a
839 integer (c_int64_t) len
840 call acc_copyout_l (a, int (len, kind = c_size_t))
841 end subroutine
843 subroutine acc_copyout_array_h (a)
844 use openacc_internal, only: acc_copyout_l
845 type (*), dimension (..), contiguous :: a
846 call acc_copyout_l (a, sizeof (a))
847 end subroutine
849 subroutine acc_delete_32_h (a, len)
850 use iso_c_binding, only: c_int32_t, c_size_t
851 use openacc_internal, only: acc_delete_l
852 !GCC$ ATTRIBUTES NO_ARG_CHECK :: a
853 type (*), dimension (*) :: a
854 integer (c_int32_t) len
855 call acc_delete_l (a, int (len, kind = c_size_t))
856 end subroutine
858 subroutine acc_delete_64_h (a, len)
859 use iso_c_binding, only: c_int64_t, c_size_t
860 use openacc_internal, only: acc_delete_l
861 !GCC$ ATTRIBUTES NO_ARG_CHECK :: a
862 type (*), dimension (*) :: a
863 integer (c_int64_t) len
864 call acc_delete_l (a, int (len, kind = c_size_t))
865 end subroutine
867 subroutine acc_delete_array_h (a)
868 use openacc_internal, only: acc_delete_l
869 type (*), dimension (..), contiguous :: a
870 call acc_delete_l (a, sizeof (a))
871 end subroutine
873 subroutine acc_update_device_32_h (a, len)
874 use iso_c_binding, only: c_int32_t, c_size_t
875 use openacc_internal, only: acc_update_device_l
876 !GCC$ ATTRIBUTES NO_ARG_CHECK :: a
877 type (*), dimension (*) :: a
878 integer (c_int32_t) len
879 call acc_update_device_l (a, int (len, kind = c_size_t))
880 end subroutine
882 subroutine acc_update_device_64_h (a, len)
883 use iso_c_binding, only: c_int64_t, c_size_t
884 use openacc_internal, only: acc_update_device_l
885 !GCC$ ATTRIBUTES NO_ARG_CHECK :: a
886 type (*), dimension (*) :: a
887 integer (c_int64_t) len
888 call acc_update_device_l (a, int (len, kind = c_size_t))
889 end subroutine
891 subroutine acc_update_device_array_h (a)
892 use openacc_internal, only: acc_update_device_l
893 type (*), dimension (..), contiguous :: a
894 call acc_update_device_l (a, sizeof (a))
895 end subroutine
897 subroutine acc_update_self_32_h (a, len)
898 use iso_c_binding, only: c_int32_t, c_size_t
899 use openacc_internal, only: acc_update_self_l
900 !GCC$ ATTRIBUTES NO_ARG_CHECK :: a
901 type (*), dimension (*) :: a
902 integer (c_int32_t) len
903 call acc_update_self_l (a, int (len, kind = c_size_t))
904 end subroutine
906 subroutine acc_update_self_64_h (a, len)
907 use iso_c_binding, only: c_int64_t, c_size_t
908 use openacc_internal, only: acc_update_self_l
909 !GCC$ ATTRIBUTES NO_ARG_CHECK :: a
910 type (*), dimension (*) :: a
911 integer (c_int64_t) len
912 call acc_update_self_l (a, int (len, kind = c_size_t))
913 end subroutine
915 subroutine acc_update_self_array_h (a)
916 use openacc_internal, only: acc_update_self_l
917 type (*), dimension (..), contiguous :: a
918 call acc_update_self_l (a, sizeof (a))
919 end subroutine
921 function acc_is_present_32_h (a, len)
922 use iso_c_binding, only: c_int32_t, c_size_t
923 use openacc_internal, only: acc_is_present_l
924 logical acc_is_present_32_h
925 !GCC$ ATTRIBUTES NO_ARG_CHECK :: a
926 type (*), dimension (*) :: a
927 integer (c_int32_t) len
928 if (acc_is_present_l (a, int (len, kind = c_size_t)) .eq. 1) then
929 acc_is_present_32_h = .TRUE.
930 else
931 acc_is_present_32_h = .FALSE.
932 end if
933 end function
935 function acc_is_present_64_h (a, len)
936 use iso_c_binding, only: c_int64_t, c_size_t
937 use openacc_internal, only: acc_is_present_l
938 logical acc_is_present_64_h
939 !GCC$ ATTRIBUTES NO_ARG_CHECK :: a
940 type (*), dimension (*) :: a
941 integer (c_int64_t) len
942 if (acc_is_present_l (a, int (len, kind = c_size_t)) .eq. 1) then
943 acc_is_present_64_h = .TRUE.
944 else
945 acc_is_present_64_h = .FALSE.
946 end if
947 end function
949 function acc_is_present_array_h (a)
950 use openacc_internal, only: acc_is_present_l
951 logical acc_is_present_array_h
952 type (*), dimension (..), contiguous :: a
953 acc_is_present_array_h = acc_is_present_l (a, sizeof (a)) == 1
954 end function