|
| 1 | +#:include 'parallel_macros.fpp' |
| 2 | + |
1 | 3 | #:def LOG(expr) |
2 | 4 | #ifdef MFC_DEBUG |
3 | 5 | block |
|
12 | 14 |
|
13 | 15 | #:def ALLOCATE(*args) |
14 | 16 | @:LOG({'@:ALLOCATE(${re.sub(' +', ' ', ', '.join(args))}$)'}) |
15 | | - allocate (${', '.join(args)}$) |
16 | | - !$acc enter data create(${', '.join(args)}$) |
| 17 | + #:set allocated_variables = ', '.join(args) |
| 18 | + allocate (${allocated_variables}$) |
| 19 | + $:GPU_ENTER_DATA(create=('[' + allocated_variables + ']')) |
17 | 20 | #:enddef ALLOCATE |
18 | 21 |
|
19 | 22 | #:def DEALLOCATE(*args) |
20 | 23 | @:LOG({'@:DEALLOCATE(${re.sub(' +', ' ', ', '.join(args))}$)'}) |
21 | | - !$acc exit data delete(${', '.join(args)}$) |
22 | | - deallocate (${', '.join(args)}$) |
| 24 | + #:set allocated_variables = ', '.join(args) |
| 25 | + $:GPU_EXIT_DATA(delete=('[' + allocated_variables + ']')) |
| 26 | + deallocate (${allocated_variables}$) |
23 | 27 | #:enddef DEALLOCATE |
24 | 28 |
|
25 | 29 | #:def ACC_SETUP_VFs(*args) |
|
30 | 34 | @:LOG({'@:ACC_SETUP_VFs(${', '.join(args)}$)'}) |
31 | 35 |
|
32 | 36 | #:for arg in args |
33 | | - !$acc enter data copyin(${arg}$) |
34 | | - !$acc enter data copyin(${arg}$%vf) |
| 37 | + $:GPU_ENTER_DATA(copyin=('[' + arg + ']')) |
| 38 | + $:GPU_ENTER_DATA(copyin=('[' + arg + '%vf]')) |
35 | 39 | if (allocated(${arg}$%vf)) then |
36 | 40 | do macros_setup_vfs_i = lbound(${arg}$%vf, 1), ubound(${arg}$%vf, 1) |
37 | 41 | if (associated(${arg}$%vf(macros_setup_vfs_i)%sf)) then |
38 | | - !$acc enter data copyin(${arg}$%vf(macros_setup_vfs_i)) |
39 | | - !$acc enter data create(${arg}$%vf(macros_setup_vfs_i)%sf) |
| 42 | + $:GPU_ENTER_DATA(copyin=('[' + arg + '%vf(macros_setup_vfs_i)]')) |
| 43 | + $:GPU_ENTER_DATA(copyin=('[' + arg + '%vf(macros_setup_vfs_i)%sf]')) |
40 | 44 | end if |
41 | 45 | end do |
42 | 46 | end if |
|
52 | 56 | @:LOG({'@:ACC_SETUP_SFs(${', '.join(args)}$)'}) |
53 | 57 |
|
54 | 58 | #:for arg in args |
55 | | - !$acc enter data copyin(${arg}$) |
| 59 | + $:GPU_ENTER_DATA(copyin=('[' + arg + ']')) |
56 | 60 | if (associated(${arg}$%sf)) then |
57 | | - !$acc enter data create(${arg}$%sf) |
| 61 | + $:GPU_ENTER_DATA(copyin=('[' + arg + '%sf]')) |
58 | 62 | end if |
59 | 63 | #:endfor |
60 | 64 | end block |
|
68 | 72 | @:LOG({'@:ACC_SETUP_source_spatials(${', '.join(args)}$)'}) |
69 | 73 |
|
70 | 74 | #:for arg in args |
71 | | - !$acc enter data copyin(${arg}$) |
| 75 | + $:GPU_ENTER_DATA(copyin=('[' + arg + ']')) |
72 | 76 | if (allocated(${arg}$%coord)) then |
73 | | - !$acc enter data create(${arg}$%coord) |
| 77 | + $:GPU_ENTER_DATA(copyin=('[' + arg + '%coord]')) |
74 | 78 | end if |
75 | 79 | if (allocated(${arg}$%val)) then |
76 | | - !$acc enter data create(${arg}$%val) |
| 80 | + $:GPU_ENTER_DATA(copyin=('[' + arg + '%val]')) |
77 | 81 | end if |
78 | 82 | if (allocated(${arg}$%angle)) then |
79 | | - !$acc enter data create(${arg}$%angle) |
| 83 | + $:GPU_ENTER_DATA(copyin=('[' + arg + '%angle]')) |
80 | 84 | end if |
81 | 85 | if (allocated(${arg}$%xyz_to_r_ratios)) then |
82 | | - !$acc enter data create(${arg}$%xyz_to_r_ratios) |
| 86 | + $:GPU_ENTER_DATA(copyin=('[' + arg + '%xyz_to_r_ratios]')) |
83 | 87 | end if |
84 | 88 | #:endfor |
85 | 89 | end block |
|
102 | 106 | //${message or '"No error description."'}$) |
103 | 107 | end if |
104 | 108 | #:enddef |
| 109 | +! New line at end of file is required for FYPP |
0 commit comments