[clang] [flang] [Flang][OpenMP] Add -fopenmp-force-usm option to flang (PR #94359)

Michael Kruse via cfe-commits cfe-commits at lists.llvm.org
Tue Jun 4 07:45:47 PDT 2024


================
@@ -172,13 +174,17 @@ struct OffloadModuleOpts {
           module.getOperation())) {
     offloadMod.setIsTargetDevice(Opts.OpenMPIsTargetDevice);
     offloadMod.setIsGPU(Opts.OpenMPIsGPU);
+    if (Opts.OpenMPForceUSM) {
+      offloadMod.setRequires(mlir::omp::ClauseRequires::unified_shared_memory);
+    }
     if (Opts.OpenMPIsTargetDevice) {
       offloadMod.setFlags(Opts.OpenMPTargetDebug, Opts.OpenMPTeamSubscription,
           Opts.OpenMPThreadSubscription, Opts.OpenMPNoThreadState,
           Opts.OpenMPNoNestedParallelism, Opts.OpenMPVersion, Opts.NoGPULib);
 
-      if (!Opts.OMPHostIRFile.empty())
+      if (!Opts.OMPHostIRFile.empty()) {
----------------
Meinersbur wrote:

[nit] unrelated change

https://github.com/llvm/llvm-project/pull/94359


More information about the cfe-commits mailing list