Skip to content

Commit 72a9c3a

Browse files
committed
[flang][flang-driver] atomic control support
1 parent f5a4693 commit 72a9c3a

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

flang/include/flang/Optimizer/Dialect/Support/FIRContext.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,12 @@ bool getAtomicRemoteMemory(mlir::ModuleOp mod);
7575
/// module `mod` is still live.
7676
void setTuneCPU(mlir::ModuleOp mod, llvm::StringRef cpu);
7777

78+
// set Atomic control options for amd gpu.
79+
void setAmdgpuAtomicControlOptions(mlir::ModuleOp mod,
80+
bool amdgpuIgnoreDenormalMode,
81+
bool amdgpuNoFineGrainedMemory,
82+
bool amdgpuNoRemoteMemory);
83+
7884
/// Get the tune CPU string from the Module or return a null reference.
7985
llvm::StringRef getTuneCPU(mlir::ModuleOp mod);
8086

mlir/include/mlir/Dialect/OpenMP/OpenMPAttrDefs.td

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,20 @@ def FlagsAttr : OpenMP_Attr<"Flags", "flags"> {
6969
let assemblyFormat = "`<` struct(params) `>`";
7070
}
7171

72+
//===----------------------------------------------------------------------===//
73+
// AtomicControlAttr
74+
//===----------------------------------------------------------------------===//
75+
76+
// Runtime library flags attribute that holds information for lowering to LLVM.
77+
def AtomicControlAttr : OpenMP_Attr<"AtomicControl", "atomic_control"> {
78+
let parameters =
79+
(ins DefaultValuedParameter<"bool", "false">:$amdgpu_ignore_denormal_mode,
80+
DefaultValuedParameter<"bool", "false">:$amdgpu_fine_grained_memory,
81+
DefaultValuedParameter<"bool", "false">:$amdgpu_remote_memory);
82+
83+
let assemblyFormat = "`<` struct(params) `>`";
84+
}
85+
7286
//===----------------------------------------------------------------------===//
7387
// TaskDependArrayAttr
7488
//===----------------------------------------------------------------------===//

0 commit comments

Comments
 (0)