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) {
777777void CUDAChecker::Enter (const parser::PrintStmt &x) {
778778 CHECK (context_.location ());
779779 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 ) {
781782 return ;
782783 }
783784
Original file line number Diff line number Diff line change @@ -46,3 +46,10 @@ attributes(device) subroutine device1()
4646 real, device :: a(10)
4747 print*, a ! ok
4848end 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