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
7 changes: 7 additions & 0 deletions flang/lib/Semantics/check-call.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1033,6 +1033,13 @@ static void CheckExplicitDataArg(const characteristics::DummyDataObject &dummy,
*actualDataAttr == common::CUDADataAttr::Managed)) {
actualDataAttr = common::CUDADataAttr::Device;
}
// For device procedures, treat actual arguments with VALUE attribute as
// device data
if (!actualDataAttr && actualLastSymbol && IsValue(*actualLastSymbol) &&
(*procedure.cudaSubprogramAttrs ==
common::CUDASubprogramAttrs::Device)) {
actualDataAttr = common::CUDADataAttr::Device;
}
}
if (dummyDataAttr == common::CUDADataAttr::Device &&
(dummyIsAssumedShape || dummyIsAssumedRank) &&
Expand Down
11 changes: 7 additions & 4 deletions flang/test/Semantics/cuf21.cuf
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,22 @@ module mlocModule
end interface maxlocUpdate
contains

attributes(global) subroutine maxlocPartialMaskR_32F1D()
attributes(global) subroutine maxlocPartialMaskR_32F1D(back)
implicit none
logical, intent(in), value :: back
real(4) :: mval

call maxlocUpdate(mval)
call maxlocUpdate(mval, back)

end subroutine maxlocPartialMaskR_32F1D

attributes(device) subroutine maxlocUpdateR_32F(mval)
attributes(device) subroutine maxlocUpdateR_32F(mval, back)
real(4) :: mval
logical :: back
end subroutine maxlocUpdateR_32F

attributes(device) subroutine maxlocUpdateR_64F(mval)
attributes(device) subroutine maxlocUpdateR_64F(mval, back)
real(8) :: mval
logical :: back
end subroutine maxlocUpdateR_64F
end module
Loading