[flang][cuda] Remove meaningless warning on CUDA shared arguments (#152404)
The warning in issued during the compatibility check makes little sense. Just remove it as it is confusing.
This commit is contained in:
parent
2696e8c149
commit
a196281896
@ -95,8 +95,8 @@ static constexpr IgnoreTKRSet ignoreTKRAll{IgnoreTKR::Type, IgnoreTKR::Kind,
|
||||
std::string AsFortran(IgnoreTKRSet);
|
||||
|
||||
bool AreCompatibleCUDADataAttrs(std::optional<CUDADataAttr>,
|
||||
std::optional<CUDADataAttr>, IgnoreTKRSet, std::optional<std::string> *,
|
||||
bool allowUnifiedMatchingRule, bool isHostDeviceProcedure,
|
||||
std::optional<CUDADataAttr>, IgnoreTKRSet, bool allowUnifiedMatchingRule,
|
||||
bool isHostDeviceProcedure,
|
||||
const LanguageFeatureControl *features = nullptr);
|
||||
|
||||
static constexpr char blankCommonObjectName[] = "__BLNK__";
|
||||
|
@ -400,7 +400,7 @@ bool DummyDataObject::IsCompatibleWith(const DummyDataObject &actual,
|
||||
}
|
||||
if (!attrs.test(Attr::Value) &&
|
||||
!common::AreCompatibleCUDADataAttrs(cudaDataAttr, actual.cudaDataAttr,
|
||||
ignoreTKR, warning,
|
||||
ignoreTKR,
|
||||
/*allowUnifiedMatchingRule=*/false,
|
||||
/*=isHostDeviceProcedure*/ false)) {
|
||||
if (whyNot) {
|
||||
@ -1816,7 +1816,7 @@ bool DistinguishUtils::Distinguishable(
|
||||
x.intent != common::Intent::In) {
|
||||
return true;
|
||||
} else if (!common::AreCompatibleCUDADataAttrs(x.cudaDataAttr, y.cudaDataAttr,
|
||||
x.ignoreTKR | y.ignoreTKR, nullptr,
|
||||
x.ignoreTKR | y.ignoreTKR,
|
||||
/*allowUnifiedMatchingRule=*/false,
|
||||
/*=isHostDeviceProcedure*/ false)) {
|
||||
return true;
|
||||
|
@ -1058,12 +1058,11 @@ static void CheckExplicitDataArg(const characteristics::DummyDataObject &dummy,
|
||||
dummyName);
|
||||
}
|
||||
}
|
||||
std::optional<std::string> warning;
|
||||
bool isHostDeviceProc{procedure.cudaSubprogramAttrs &&
|
||||
*procedure.cudaSubprogramAttrs ==
|
||||
common::CUDASubprogramAttrs::HostDevice};
|
||||
if (!common::AreCompatibleCUDADataAttrs(dummyDataAttr, actualDataAttr,
|
||||
dummy.ignoreTKR, &warning, /*allowUnifiedMatchingRule=*/true,
|
||||
dummy.ignoreTKR, /*allowUnifiedMatchingRule=*/true,
|
||||
isHostDeviceProc, &context.languageFeatures())) {
|
||||
auto toStr{[](std::optional<common::CUDADataAttr> x) {
|
||||
return x ? "ATTRIBUTES("s +
|
||||
@ -1074,10 +1073,6 @@ static void CheckExplicitDataArg(const characteristics::DummyDataObject &dummy,
|
||||
"%s has %s but its associated actual argument has %s"_err_en_US,
|
||||
dummyName, toStr(dummyDataAttr), toStr(actualDataAttr));
|
||||
}
|
||||
if (warning && context.ShouldWarn(common::UsageWarning::CUDAUsage)) {
|
||||
messages.Say(common::UsageWarning::CUDAUsage, "%s"_warn_en_US,
|
||||
std::move(*warning));
|
||||
}
|
||||
}
|
||||
|
||||
// Warning for breaking F'2023 change with character allocatables
|
||||
|
@ -103,8 +103,8 @@ std::string AsFortran(IgnoreTKRSet tkr) {
|
||||
/// dummy argument attribute while `y` represents the actual argument attribute.
|
||||
bool AreCompatibleCUDADataAttrs(std::optional<CUDADataAttr> x,
|
||||
std::optional<CUDADataAttr> y, IgnoreTKRSet ignoreTKR,
|
||||
std::optional<std::string> *warning, bool allowUnifiedMatchingRule,
|
||||
bool isHostDeviceProcedure, const LanguageFeatureControl *features) {
|
||||
bool allowUnifiedMatchingRule, bool isHostDeviceProcedure,
|
||||
const LanguageFeatureControl *features) {
|
||||
bool isCudaManaged{features
|
||||
? features->IsEnabled(common::LanguageFeature::CudaManaged)
|
||||
: false};
|
||||
@ -145,9 +145,6 @@ bool AreCompatibleCUDADataAttrs(std::optional<CUDADataAttr> x,
|
||||
*y == CUDADataAttr::Shared ||
|
||||
*y == CUDADataAttr::Constant)) ||
|
||||
(!y && (isCudaUnified || isCudaManaged))) {
|
||||
if (y && *y == CUDADataAttr::Shared && warning) {
|
||||
*warning = "SHARED attribute ignored"s;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
} else if (*x == CUDADataAttr::Managed) {
|
||||
|
@ -1,18 +0,0 @@
|
||||
! RUN: bbc -emit-hlfir -fcuda %s 2>&1 | FileCheck %s
|
||||
|
||||
module mod1
|
||||
contains
|
||||
|
||||
attributes(device) subroutine sub1(adev)
|
||||
real, device :: adev(10)
|
||||
end
|
||||
|
||||
attributes(global) subroutine sub2()
|
||||
real, shared :: adev(10)
|
||||
!WARNING: SHARED attribute ignored
|
||||
call sub1(adev)
|
||||
end subroutine
|
||||
|
||||
end module
|
||||
|
||||
! CHECK: warning: SHARED attribute ignored
|
Loading…
x
Reference in New Issue
Block a user