File tree Expand file tree Collapse file tree 2 files changed +15
-1
lines changed Expand file tree Collapse file tree 2 files changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -4343,7 +4343,9 @@ bool SubprogramVisitor::Pre(const parser::PrefixSpec::Attributes &attrs) {
43434343 }
43444344 if (auto attrs{subp->cudaSubprogramAttrs ()}) {
43454345 if (*attrs == common::CUDASubprogramAttrs::Global ||
4346- *attrs == common::CUDASubprogramAttrs::Device) {
4346+ *attrs == common::CUDASubprogramAttrs::Grid_Global ||
4347+ *attrs == common::CUDASubprogramAttrs::Device ||
4348+ *attrs == common::CUDASubprogramAttrs::HostDevice) {
43474349 const Scope &scope{currScope ()};
43484350 const Scope *mod{FindModuleContaining (scope)};
43494351 if (mod &&
Original file line number Diff line number Diff line change @@ -13,5 +13,17 @@ contains
1313!ERROR: 'threadfence' is use-associated from module 'cudadevice' and cannot be re-declared
1414 integer :: threadfence
1515 end subroutine
16+
17+ attributes(host,device) subroutine sub3()
18+ if (on_device()) then
19+ print*, 'on device'
20+ else
21+ print*, 'on host'
22+ end if
23+ end subroutine
24+
25+ attributes(grid_global) subroutine sub4()
26+ call threadfence()
27+ end subroutine
1628end module
1729
You can’t perform that action at this time.
0 commit comments