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
1 change: 1 addition & 0 deletions flang/lib/Semantics/check-cuda.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ struct FindHostArray
(!details->cudaDataAttr() ||
(details->cudaDataAttr() &&
*details->cudaDataAttr() != common::CUDADataAttr::Device &&
*details->cudaDataAttr() != common::CUDADataAttr::Constant &&
*details->cudaDataAttr() != common::CUDADataAttr::Managed &&
*details->cudaDataAttr() != common::CUDADataAttr::Shared &&
*details->cudaDataAttr() != common::CUDADataAttr::Unified))) {
Expand Down
7 changes: 7 additions & 0 deletions flang/test/Semantics/cuf09.cuf
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
! RUN: %python %S/test_errors.py %s %flang_fc1
module m
integer :: m(100)
integer, constant :: c(10)
integer, parameter :: p(5) = [1,2,3,4,5]
contains
attributes(device) subroutine devsub
Expand Down Expand Up @@ -42,6 +43,12 @@ module m
i = threadIdx%x
a(i) = s(10) ! ok, a is device and s is shared
end subroutine

attributes(global) subroutine cstarray(a)
integer, device :: a(10)
i = threadIdx%x
a(i) = c(10) ! ok, a is device and c is constant
end subroutine
end

program main
Expand Down
Loading