File tree 2 files changed +11
-5
lines changed
2 files changed +11
-5
lines changed Original file line number Diff line number Diff line change @@ -8973,12 +8973,12 @@ void ResolveNamesVisitor::FinishSpecificationPart(
8973
8973
if (NeedsExplicitType (symbol)) {
8974
8974
ApplyImplicitRules (symbol);
8975
8975
}
8976
- if (inDeviceSubprogram && IsDummy ( symbol) &&
8977
- symbol.has <ObjectEntityDetails>()) {
8978
- auto *dummy{symbol. detailsIf <ObjectEntityDetails>()};
8979
- if (!dummy-> cudaDataAttr () && ! IsValue (symbol )) {
8976
+ if (inDeviceSubprogram && symbol. has <ObjectEntityDetails>()) {
8977
+ auto *object{ symbol.detailsIf <ObjectEntityDetails>()};
8978
+ if (!object-> cudaDataAttr () && ! IsValue (symbol) &&
8979
+ ( IsDummy (symbol) || object-> IsArray () )) {
8980
8980
// Implicitly set device attribute if none is set in device context.
8981
- dummy ->set_cudaDataAttr (common::CUDADataAttr::Device);
8981
+ object ->set_cudaDataAttr (common::CUDADataAttr::Device);
8982
8982
}
8983
8983
}
8984
8984
if (IsDummy (symbol) && isImplicitNoneType () &&
Original file line number Diff line number Diff line change @@ -22,6 +22,12 @@ module m
22
22
!ERROR: Host array 'm' cannot be present in device context
23
23
if (i .le. N) a(i) = m(i)
24
24
end subroutine
25
+
26
+ attributes(global) subroutine localarray()
27
+ integer :: a(10)
28
+ i = threadIdx%x
29
+ a(i) = i
30
+ end subroutine
25
31
end
26
32
27
33
program main
You can’t perform that action at this time.
0 commit comments