mirror of
https://github.com/llvm/llvm-project.git
synced 2025-04-16 14:46:36 +00:00
[flang][cuda] Downgrade allocate pinned error to a warning (#121589)
To be in accordance with the reference compiler.
This commit is contained in:
parent
a4e47586b9
commit
39a9073f9e
@ -616,9 +616,11 @@ bool AllocationCheckerHelper::RunChecks(SemanticsContext &context) {
|
||||
}
|
||||
if (allocateInfo_.gotPinned) {
|
||||
std::optional<common::CUDADataAttr> cudaAttr{GetCUDADataAttr(ultimate_)};
|
||||
if (!cudaAttr || *cudaAttr != common::CUDADataAttr::Pinned) {
|
||||
if ((!cudaAttr || *cudaAttr != common::CUDADataAttr::Pinned) &&
|
||||
context.languageFeatures().ShouldWarn(
|
||||
common::UsageWarning::CUDAUsage)) {
|
||||
context.Say(name_.source,
|
||||
"Object in ALLOCATE must have PINNED attribute when PINNED option is specified"_err_en_US);
|
||||
"Object in ALLOCATE should have PINNED attribute when PINNED option is specified"_warn_en_US);
|
||||
}
|
||||
}
|
||||
if (allocateInfo_.gotStream) {
|
||||
|
@ -28,7 +28,7 @@ module m
|
||||
integer, allocatable, device :: ia(:)
|
||||
logical :: plog
|
||||
|
||||
!ERROR: Object in ALLOCATE must have PINNED attribute when PINNED option is specified
|
||||
!WARNING: Object in ALLOCATE should have PINNED attribute when PINNED option is specified
|
||||
allocate(ia(100), pinned = plog)
|
||||
end subroutine
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user