File tree Expand file tree Collapse file tree 2 files changed +5
-3
lines changed Expand file tree Collapse file tree 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) {
616616 }
617617 if (allocateInfo_.gotPinned ) {
618618 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)) {
620622 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 );
622624 }
623625 }
624626 if (allocateInfo_.gotStream ) {
Original file line number Diff line number Diff line change @@ -28,7 +28,7 @@ module m
2828 integer, allocatable, device :: ia(:)
2929 logical :: plog
3030
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
3232 allocate(ia(100), pinned = plog)
3333 end subroutine
3434
You can’t perform that action at this time.
0 commit comments