Commit 39a9073 1 parent a4e4758 commit 39a9073 Copy full SHA for 39a9073
File tree 2 files changed +5
-3
lines changed
2 files changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -616,9 +616,11 @@ bool AllocationCheckerHelper::RunChecks(SemanticsContext &context) {
616
616
}
617
617
if (allocateInfo_.gotPinned ) {
618
618
std::optional<common::CUDADataAttr> cudaAttr{GetCUDADataAttr (ultimate_)};
619
- if (!cudaAttr || *cudaAttr != common::CUDADataAttr::Pinned) {
619
+ if ((!cudaAttr || *cudaAttr != common::CUDADataAttr::Pinned) &&
620
+ context.languageFeatures ().ShouldWarn (
621
+ common::UsageWarning::CUDAUsage)) {
620
622
context.Say (name_.source ,
621
- " Object in ALLOCATE must have PINNED attribute when PINNED option is specified" _err_en_US );
623
+ " Object in ALLOCATE should have PINNED attribute when PINNED option is specified" _warn_en_US );
622
624
}
623
625
}
624
626
if (allocateInfo_.gotStream ) {
Original file line number Diff line number Diff line change @@ -28,7 +28,7 @@ module m
28
28
integer, allocatable, device :: ia(:)
29
29
logical :: plog
30
30
31
- !ERROR : Object in ALLOCATE must have PINNED attribute when PINNED option is specified
31
+ !WARNING : Object in ALLOCATE should have PINNED attribute when PINNED option is specified
32
32
allocate(ia(100), pinned = plog)
33
33
end subroutine
34
34
You can’t perform that action at this time.
0 commit comments