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) {
4343
4343
}
4344
4344
if (auto attrs{subp->cudaSubprogramAttrs ()}) {
4345
4345
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) {
4347
4349
const Scope &scope{currScope ()};
4348
4350
const Scope *mod{FindModuleContaining (scope)};
4349
4351
if (mod &&
Original file line number Diff line number Diff line change @@ -13,5 +13,17 @@ contains
13
13
!ERROR: 'threadfence' is use-associated from module 'cudadevice' and cannot be re-declared
14
14
integer :: threadfence
15
15
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
16
28
end module
17
29
You can’t perform that action at this time.
0 commit comments