[flang][cuda] Check for ignore_tkr(d) when resolving generic call (#131923)

This commit is contained in:
Valentin Clement (バレンタイン クレメン)
2025-03-18 15:39:04 -07:00
committed by GitHub
parent 98943c4bd8
commit b7ed5c8e06
2 changed files with 12 additions and 0 deletions

View File

@@ -111,6 +111,9 @@ bool AreCompatibleCUDADataAttrs(std::optional<CUDADataAttr> x,
bool isCudaUnified{features
? features->IsEnabled(common::LanguageFeature::CudaUnified)
: false};
if (ignoreTKR.test(common::IgnoreTKR::Device)) {
return true;
}
if (!x && !y) {
return true;
} else if (x && y && *x == *y) {

View File

@@ -8,6 +8,13 @@ module matching
module procedure sub_unified
end interface
interface
subroutine ignore(a)
!dir$ ignore_tkr(d) a
integer, managed :: a(:)
end subroutine
end interface
contains
subroutine sub_host(a)
integer :: a(:)
@@ -43,9 +50,11 @@ program m
call sub(u) ! Should resolve to sub_unified
call sub(d) ! Should resolve to sub_device
call ignore(a)
end
! CHECK: CALL sub_host
! CHECK: CALL sub_managed
! CHECK: CALL sub_unified
! CHECK: CALL sub_device
! CHECK: CALL ignore