summaryrefslogtreecommitdiff
path: root/flang/lib/Semantics/assignment.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'flang/lib/Semantics/assignment.cpp')
-rw-r--r--flang/lib/Semantics/assignment.cpp56
1 files changed, 0 insertions, 56 deletions
diff --git a/flang/lib/Semantics/assignment.cpp b/flang/lib/Semantics/assignment.cpp
index 43e23a9d8f60..88e08887160d 100644
--- a/flang/lib/Semantics/assignment.cpp
+++ b/flang/lib/Semantics/assignment.cpp
@@ -42,7 +42,6 @@ public:
void Analyze(const parser::AssignmentStmt &);
void Analyze(const parser::PointerAssignmentStmt &);
void Analyze(const parser::ConcurrentControl &);
- int deviceConstructDepth_{0};
SemanticsContext &context() { return context_; }
private:
@@ -97,21 +96,6 @@ void AssignmentContext::Analyze(const parser::AssignmentStmt &stmt) {
if (whereDepth_ > 0) {
CheckShape(lhsLoc, &lhs);
}
- if (context_.foldingContext().languageFeatures().IsEnabled(
- common::LanguageFeature::CUDA)) {
- const auto &scope{context_.FindScope(lhsLoc)};
- const Scope &progUnit{GetProgramUnitContaining(scope)};
- if (!IsCUDADeviceContext(&progUnit) && deviceConstructDepth_ == 0) {
- if (Fortran::evaluate::HasCUDADeviceAttrs(lhs) &&
- Fortran::evaluate::HasCUDAImplicitTransfer(rhs)) {
- if (GetNbOfCUDAManagedOrUnifiedSymbols(lhs) == 1 &&
- GetNbOfCUDAManagedOrUnifiedSymbols(rhs) == 1 &&
- GetNbOfCUDADeviceSymbols(rhs) == 1)
- return; // This is a special case handled on the host.
- context_.Say(lhsLoc, "Unsupported CUDA data transfer"_err_en_US);
- }
- }
- }
}
}
@@ -254,46 +238,6 @@ void AssignmentChecker::Enter(const parser::MaskedElsewhereStmt &x) {
void AssignmentChecker::Leave(const parser::MaskedElsewhereStmt &) {
context_.value().PopWhereContext();
}
-void AssignmentChecker::Enter(const parser::CUFKernelDoConstruct &x) {
- ++context_.value().deviceConstructDepth_;
-}
-void AssignmentChecker::Leave(const parser::CUFKernelDoConstruct &) {
- --context_.value().deviceConstructDepth_;
-}
-static bool IsOpenACCComputeConstruct(const parser::OpenACCBlockConstruct &x) {
- const auto &beginBlockDirective =
- std::get<Fortran::parser::AccBeginBlockDirective>(x.t);
- const auto &blockDirective =
- std::get<Fortran::parser::AccBlockDirective>(beginBlockDirective.t);
- if (blockDirective.v == llvm::acc::ACCD_parallel ||
- blockDirective.v == llvm::acc::ACCD_serial ||
- blockDirective.v == llvm::acc::ACCD_kernels) {
- return true;
- }
- return false;
-}
-void AssignmentChecker::Enter(const parser::OpenACCBlockConstruct &x) {
- if (IsOpenACCComputeConstruct(x)) {
- ++context_.value().deviceConstructDepth_;
- }
-}
-void AssignmentChecker::Leave(const parser::OpenACCBlockConstruct &x) {
- if (IsOpenACCComputeConstruct(x)) {
- --context_.value().deviceConstructDepth_;
- }
-}
-void AssignmentChecker::Enter(const parser::OpenACCCombinedConstruct &) {
- ++context_.value().deviceConstructDepth_;
-}
-void AssignmentChecker::Leave(const parser::OpenACCCombinedConstruct &) {
- --context_.value().deviceConstructDepth_;
-}
-void AssignmentChecker::Enter(const parser::OpenACCLoopConstruct &) {
- ++context_.value().deviceConstructDepth_;
-}
-void AssignmentChecker::Leave(const parser::OpenACCLoopConstruct &) {
- --context_.value().deviceConstructDepth_;
-}
} // namespace Fortran::semantics
template class Fortran::common::Indirection<