[flang][cuda] Do not consider kernel result as host variable (#190626)
This commit is contained in:
parent
9265f9284c
commit
baa1e5008b
@ -138,13 +138,13 @@ struct FindHostArray
|
||||
using Base::operator();
|
||||
Result operator()(const evaluate::Component &x) const {
|
||||
const Symbol &symbol{x.GetLastSymbol()};
|
||||
if (symbol.IsFuncResult()) {
|
||||
const Symbol &baseSymbol{x.base().GetFirstSymbol()};
|
||||
if (symbol.IsFuncResult() || baseSymbol.IsFuncResult()) {
|
||||
return nullptr;
|
||||
}
|
||||
if (!IsHostArray(symbol)) {
|
||||
return nullptr;
|
||||
}
|
||||
const Symbol &baseSymbol{x.base().GetFirstSymbol()};
|
||||
if (IsDummy(baseSymbol) && IsCUDADeviceContext(&baseSymbol.owner())) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
@ -4,6 +4,9 @@ module m
|
||||
type bar
|
||||
integer, allocatable :: m(:)
|
||||
end type
|
||||
type r1
|
||||
real :: origin(3)
|
||||
end type r1
|
||||
contains
|
||||
attributes(global) subroutine g1( a )
|
||||
type(bar) :: a
|
||||
@ -11,4 +14,9 @@ contains
|
||||
a%m(i) = i
|
||||
return
|
||||
end subroutine
|
||||
attributes(device) function rayConstructor(origin, dir) result(r)
|
||||
real :: origin(3), dir(3)
|
||||
type(r1) :: r
|
||||
r%origin = origin
|
||||
end function
|
||||
end module m
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user