summaryrefslogtreecommitdiff
path: root/flang/lib/Lower/Bridge.cpp
diff options
context:
space:
mode:
authorValentin Clement (バレンタイン クレメン) <clementval@gmail.com>2025-07-08 10:52:15 -0700
committerGitHub <noreply@github.com>2025-07-08 10:52:15 -0700
commit46caad52ac14cefd6f9cf3188863818e330f3844 (patch)
tree408654b7580b750b7b9dad9378de4f8eae18e234 /flang/lib/Lower/Bridge.cpp
parent1e3f6a6c4fd8dafb208216ffcabe31fa978ca502 (diff)
[flang][cuda] Do not produce data transfer in offloaded do concurrent (#147435)users/david-salinas/fix_offload_compression
If a `do concurrent` loop is offloaded then there should be no CUDA data transfer in it. Update the semantic and lowering to take that into account. `AssignmentChecker` has to be put into a separate pass because the checkers in `SemanticsVisitor` cannot have the same `Enter/Leave` functions. The `DoForallChecker` already has `Eneter/Leave` functions for the `DoConstruct`.
Diffstat (limited to 'flang/lib/Lower/Bridge.cpp')
-rw-r--r--flang/lib/Lower/Bridge.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/flang/lib/Lower/Bridge.cpp b/flang/lib/Lower/Bridge.cpp
index ff35840a6668..696473605a4e 100644
--- a/flang/lib/Lower/Bridge.cpp
+++ b/flang/lib/Lower/Bridge.cpp
@@ -4886,7 +4886,10 @@ private:
mlir::Location loc = getCurrentLocation();
fir::FirOpBuilder &builder = getFirOpBuilder();
- bool isInDeviceContext = cuf::isCUDADeviceContext(builder.getRegion());
+ bool isInDeviceContext = cuf::isCUDADeviceContext(
+ builder.getRegion(),
+ getFoldingContext().languageFeatures().IsEnabled(
+ Fortran::common::LanguageFeature::DoConcurrentOffload));
bool isCUDATransfer =
IsCUDADataTransfer(assign.lhs, assign.rhs) && !isInDeviceContext;