Skip to content

Commit bbdd46d

Browse files
committed
Rename language feature
1 parent c4844a4 commit bbdd46d

File tree

6 files changed

+19
-13
lines changed

6 files changed

+19
-13
lines changed

flang/include/flang/Optimizer/Builder/CUFCommon.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@ mlir::gpu::GPUModuleOp getOrCreateGPUModule(mlir::ModuleOp mod,
2727
mlir::SymbolTable &symTab);
2828

2929
bool isCUDADeviceContext(mlir::Operation *op);
30-
bool isCUDADeviceContext(mlir::Region &, bool isStdParEnabled = false);
30+
bool isCUDADeviceContext(mlir::Region &,
31+
bool isDoConcurrentOffloadEnabled = false);
3132
bool isRegisteredDeviceGlobal(fir::GlobalOp op);
3233
bool isRegisteredDeviceAttr(std::optional<cuf::DataAttribute> attr);
3334

flang/include/flang/Support/Fortran-features.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ ENUM_CLASS(LanguageFeature, BackslashEscapes, OldDebugLines,
5555
SavedLocalInSpecExpr, PrintNamelist, AssumedRankPassedToNonAssumedRank,
5656
IgnoreIrrelevantAttributes, Unsigned, AmbiguousStructureConstructor,
5757
ContiguousOkForSeqAssociation, ForwardRefExplicitTypeDummy,
58-
InaccessibleDeferredOverride, CudaWarpMatchFunction, StdPar)
58+
InaccessibleDeferredOverride, CudaWarpMatchFunction, DoConcurrentOffload)
5959

6060
// Portability and suspicious usage warnings
6161
ENUM_CLASS(UsageWarning, Portability, PointerToUndefinable,

flang/lib/Lower/Bridge.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4887,8 +4887,9 @@ class FirConverter : public Fortran::lower::AbstractConverter {
48874887
fir::FirOpBuilder &builder = getFirOpBuilder();
48884888

48894889
bool isInDeviceContext = cuf::isCUDADeviceContext(
4890-
builder.getRegion(), getFoldingContext().languageFeatures().IsEnabled(
4891-
Fortran::common::LanguageFeature::StdPar));
4890+
builder.getRegion(),
4891+
getFoldingContext().languageFeatures().IsEnabled(
4892+
Fortran::common::LanguageFeature::DoConcurrentOffload));
48924893

48934894
bool isCUDATransfer =
48944895
IsCUDADataTransfer(assign.lhs, assign.rhs) && !isInDeviceContext;

flang/lib/Optimizer/Builder/CUFCommon.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,8 @@ bool cuf::isCUDADeviceContext(mlir::Operation *op) {
4343
// for it.
4444
// If the insertion point is inside an OpenACC region op, it is considered
4545
// device context.
46-
bool cuf::isCUDADeviceContext(mlir::Region &region, bool isStdParEnabled) {
46+
bool cuf::isCUDADeviceContext(mlir::Region &region,
47+
bool isDoConcurrentOffloadEnabled) {
4748
if (region.getParentOfType<cuf::KernelOp>())
4849
return true;
4950
if (region.getParentOfType<mlir::acc::ComputeRegionOpInterface>())
@@ -56,7 +57,8 @@ bool cuf::isCUDADeviceContext(mlir::Region &region, bool isStdParEnabled) {
5657
cudaProcAttr.getValue() != cuf::ProcAttribute::HostDevice;
5758
}
5859
}
59-
if (isStdParEnabled && region.getParentOfType<fir::DoConcurrentLoopOp>())
60+
if (isDoConcurrentOffloadEnabled &&
61+
region.getParentOfType<fir::DoConcurrentLoopOp>())
6062
return true;
6163
return false;
6264
}

flang/lib/Semantics/check-cuda.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -729,14 +729,14 @@ void CUDAChecker::Leave(const parser::OpenACCLoopConstruct &) {
729729
void CUDAChecker::Enter(const parser::DoConstruct &x) {
730730
if (x.IsDoConcurrent() &&
731731
context_.foldingContext().languageFeatures().IsEnabled(
732-
common::LanguageFeature::StdPar)) {
732+
common::LanguageFeature::DoConcurrentOffload)) {
733733
++deviceConstructDepth_;
734734
}
735735
}
736736
void CUDAChecker::Leave(const parser::DoConstruct &x) {
737737
if (x.IsDoConcurrent() &&
738738
context_.foldingContext().languageFeatures().IsEnabled(
739-
common::LanguageFeature::StdPar)) {
739+
common::LanguageFeature::DoConcurrentOffload)) {
740740
--deviceConstructDepth_;
741741
}
742742
}

flang/tools/bbc/bbc.cpp

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -223,9 +223,10 @@ static llvm::cl::opt<bool> enableCUDA("fcuda",
223223
llvm::cl::desc("enable CUDA Fortran"),
224224
llvm::cl::init(false));
225225

226-
static llvm::cl::opt<bool> enableStdPar("stdpar",
227-
llvm::cl::desc("enable stdpar"),
228-
llvm::cl::init(false));
226+
static llvm::cl::opt<bool>
227+
enableDoConcurrentOffload("fdoconcurrent-offload",
228+
llvm::cl::desc("enable do concurrent offload"),
229+
llvm::cl::init(false));
229230

230231
static llvm::cl::opt<bool>
231232
disableCUDAWarpFunction("fcuda-disable-warp-function",
@@ -612,8 +613,9 @@ int main(int argc, char **argv) {
612613
options.features.Enable(Fortran::common::LanguageFeature::CUDA);
613614
}
614615

615-
if (enableStdPar) {
616-
options.features.Enable(Fortran::common::LanguageFeature::StdPar);
616+
if (enableDoConcurrentOffload) {
617+
options.features.Enable(
618+
Fortran::common::LanguageFeature::DoConcurrentOffload);
617619
}
618620

619621
if (disableCUDAWarpFunction) {

0 commit comments

Comments
 (0)