Commit 7c0da79
authored
[flang][cuda] Use fir.cuda_deallocate for automatic deallocation (#89662)
Automatic deallocation of allocatable that are cuda device variable must
use the fir.cuda_deallocate operation. This patch update the automatic
deallocation code generation to use this operation when the variable is
a cuda variable.
This patch has also the side effect to correctly call
`attachDeclarePostDeallocAction` for OpenACC declare variable on
automatic deallocation as well. Update the code in
`attachDeclarePostDeallocAction` so we do not attach on fir.result but
on the correct last op.1 parent 31e769c commit 7c0da79
File tree
6 files changed
+67
-21
lines changed- flang
- include/flang/Lower
- lib/Lower
- test/Lower
- CUDA
- OpenACC
6 files changed
+67
-21
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
55 | 55 | | |
56 | 56 | | |
57 | 57 | | |
| 58 | + | |
58 | 59 | | |
59 | 60 | | |
60 | 61 | | |
61 | 62 | | |
62 | 63 | | |
63 | | - | |
| 64 | + | |
| 65 | + | |
64 | 66 | | |
65 | 67 | | |
66 | 68 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
859 | 859 | | |
860 | 860 | | |
861 | 861 | | |
862 | | - | |
| 862 | + | |
863 | 863 | | |
864 | 864 | | |
865 | 865 | | |
866 | 866 | | |
867 | 867 | | |
868 | | - | |
| 868 | + | |
| 869 | + | |
869 | 870 | | |
870 | 871 | | |
871 | 872 | | |
872 | 873 | | |
873 | | - | |
| 874 | + | |
| 875 | + | |
874 | 876 | | |
875 | 877 | | |
876 | 878 | | |
| |||
880 | 882 | | |
881 | 883 | | |
882 | 884 | | |
883 | | - | |
| 885 | + | |
884 | 886 | | |
885 | | - | |
| 887 | + | |
886 | 888 | | |
887 | 889 | | |
888 | 890 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
916 | 916 | | |
917 | 917 | | |
918 | 918 | | |
919 | | - | |
| 919 | + | |
| 920 | + | |
920 | 921 | | |
921 | 922 | | |
922 | 923 | | |
923 | 924 | | |
924 | 925 | | |
925 | | - | |
| 926 | + | |
926 | 927 | | |
927 | 928 | | |
928 | 929 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4187 | 4187 | | |
4188 | 4188 | | |
4189 | 4189 | | |
4190 | | - | |
4191 | | - | |
4192 | | - | |
| 4190 | + | |
| 4191 | + | |
| 4192 | + | |
| 4193 | + | |
| 4194 | + | |
| 4195 | + | |
| 4196 | + | |
| 4197 | + | |
| 4198 | + | |
4193 | 4199 | | |
4194 | | - | |
4195 | | - | |
4196 | | - | |
4197 | | - | |
4198 | | - | |
| 4200 | + | |
| 4201 | + | |
| 4202 | + | |
| 4203 | + | |
| 4204 | + | |
4199 | 4205 | | |
4200 | | - | |
4201 | | - | |
4202 | | - | |
4203 | | - | |
4204 | | - | |
| 4206 | + | |
| 4207 | + | |
| 4208 | + | |
| 4209 | + | |
| 4210 | + | |
4205 | 4211 | | |
4206 | 4212 | | |
4207 | 4213 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
20 | 29 | | |
21 | 30 | | |
22 | 31 | | |
| |||
37 | 46 | | |
38 | 47 | | |
39 | 48 | | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
40 | 53 | | |
41 | 54 | | |
42 | 55 | | |
| |||
50 | 63 | | |
51 | 64 | | |
52 | 65 | | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
53 | 69 | | |
54 | 70 | | |
55 | 71 | | |
| |||
65 | 81 | | |
66 | 82 | | |
67 | 83 | | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
68 | 87 | | |
69 | 88 | | |
70 | 89 | | |
| |||
80 | 99 | | |
81 | 100 | | |
82 | 101 | | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
83 | 107 | | |
84 | 108 | | |
85 | 109 | | |
| |||
95 | 119 | | |
96 | 120 | | |
97 | 121 | | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
98 | 125 | | |
99 | 126 | | |
100 | 127 | | |
| |||
120 | 147 | | |
121 | 148 | | |
122 | 149 | | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
245 | 245 | | |
246 | 246 | | |
247 | 247 | | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
248 | 253 | | |
249 | 254 | | |
250 | 255 | | |
| |||
0 commit comments