Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion flang/lib/Common/Fortran.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,8 @@ bool AreCompatibleCUDADataAttrs(std::optional<CUDADataAttr> x,
if (*x == CUDADataAttr::Device) {
if ((y &&
(*y == CUDADataAttr::Managed || *y == CUDADataAttr::Unified ||
*y == CUDADataAttr::Shared)) ||
*y == CUDADataAttr::Shared ||
*y == CUDADataAttr::Constant)) ||
(!y && (isCudaUnified || isCudaManaged))) {
if (y && *y == CUDADataAttr::Shared && warning) {
*warning = "SHARED attribute ignored"s;
Expand Down
7 changes: 7 additions & 0 deletions flang/test/Semantics/cuf10.cuf
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
module m
real, device :: a(4,8)
real, managed, allocatable :: b(:,:)
integer, constant :: x = 1
contains
attributes(global) subroutine kernel(a,b,c,n,m)
integer, value :: n
Expand All @@ -23,4 +24,10 @@ module m
call devsub(c,4) ! not checked in OpenACC construct
end do
end
attributes(global) subroutine sub1(x)
integer :: x
end
subroutine sub2()
call sub1<<<1,1>>>(x) ! actual constant to device dummy
end
end
Loading