File tree Expand file tree Collapse file tree 2 files changed +11
-5
lines changed Expand file tree Collapse file tree 2 files changed +11
-5
lines changed Original file line number Diff line number Diff line change @@ -8973,12 +8973,12 @@ void ResolveNamesVisitor::FinishSpecificationPart(
89738973 if (NeedsExplicitType (symbol)) {
89748974 ApplyImplicitRules (symbol);
89758975 }
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 () )) {
89808980 // 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);
89828982 }
89838983 }
89848984 if (IsDummy (symbol) && isImplicitNoneType () &&
Original file line number Diff line number Diff line change @@ -22,6 +22,12 @@ module m
2222 !ERROR: Host array 'm' cannot be present in device context
2323 if (i .le. N) a(i) = m(i)
2424 end subroutine
25+
26+ attributes(global) subroutine localarray()
27+ integer :: a(10)
28+ i = threadIdx%x
29+ a(i) = i
30+ end subroutine
2531end
2632
2733program main
You can’t perform that action at this time.
0 commit comments