File tree Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -777,7 +777,8 @@ void CUDAChecker::Enter(const parser::AssignmentStmt &x) {
777
777
void CUDAChecker::Enter (const parser::PrintStmt &x) {
778
778
CHECK (context_.location ());
779
779
const Scope &scope{context_.FindScope (*context_.location ())};
780
- if (IsCUDADeviceContext (&scope) || deviceConstructDepth_ > 0 ) {
780
+ const Scope &progUnit{GetProgramUnitContaining (scope)};
781
+ if (IsCUDADeviceContext (&progUnit) || deviceConstructDepth_ > 0 ) {
781
782
return ;
782
783
}
783
784
Original file line number Diff line number Diff line change @@ -46,3 +46,10 @@ attributes(device) subroutine device1()
46
46
real, device :: a(10)
47
47
print*, a ! ok
48
48
end subroutine
49
+
50
+ attributes(global) subroutine global_with_block()
51
+ block
52
+ real, device :: a(10)
53
+ print*, a ! ok
54
+ end block
55
+ end subroutine
You can’t perform that action at this time.
0 commit comments