Skip to content

Commit ed3f257

Browse files
authored
Amd/dev/rlieberm/fopenacc warn (llvm#1052)
-fopenacc should not affect hipCatch2 1360 - Unit_hipMalloc3DArray_MaxTexture - uint4 (Subprocess killed) 1389 - Unit_hipArray3DCreate_MaxTexture - uint4 (Subprocess killed)
2 parents a206233 + c289bce commit ed3f257

34 files changed

+17
-56
lines changed

clang/include/clang/Basic/DiagnosticDriverKinds.td

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,9 @@ def warn_drv_unsupported_openmp_library : Warning<
146146
"the library '%0=%1' is not supported, OpenMP will not be enabled">,
147147
InGroup<OptionIgnored>;
148148

149+
def warn_openacc_experimental : Warning<
150+
"OpenACC is NOT supported for AMDGPU">;
151+
149152
def err_drv_invalid_thread_model_for_target : Error<
150153
"invalid thread model '%0' in '%1' for this target">;
151154
def err_drv_invalid_linker_name : Error<

clang/include/clang/Driver/Options.td

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1401,10 +1401,9 @@ def fno_hip_emit_relocatable : Flag<["-"], "fno-hip-emit-relocatable">,
14011401
}
14021402

14031403
// Clang specific/exclusive options for OpenACC.
1404-
// Unsupported on AMD downstream
14051404
def openacc_macro_override
14061405
: Separate<["-"], "fexperimental-openacc-macro-override">,
1407-
Visibility<[]>,
1406+
Visibility<[ClangOption, CC1Option]>,
14081407
Group<f_Group>,
14091408
HelpText<"Overrides the _OPENACC macro value for experimental testing "
14101409
"during OpenACC support development">;
@@ -3737,8 +3736,10 @@ def fno_openmp_target_debug : Flag<["-"], "fno-openmp-target-debug">;
37373736
// FlangOption + FC1 + ClangOption + CC1Option
37383737
//===----------------------------------------------------------------------===//
37393738
// Unsupported on AMD downstream
3739+
let Visibility = [FC1Option, FlangOption, CC1Option, ClangOption] in {
37403740
def fopenacc : Flag<["-"], "fopenacc">, Group<f_Group>, Visibility<[]>,
37413741
HelpText<"Enable OpenACC">;
3742+
}
37423743

37433744
//===----------------------------------------------------------------------===//
37443745
// Optimisation remark options

clang/lib/Driver/ToolChains/Clang.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4028,6 +4028,7 @@ static void RenderOpenACCOptions(const Driver &D, const ArgList &Args,
40284028
if (!Args.hasArg(options::OPT_fopenacc))
40294029
return;
40304030

4031+
D.Diag(diag::warn_openacc_experimental);
40314032
CmdArgs.push_back("-fopenacc");
40324033

40334034
if (Arg *A = Args.getLastArg(options::OPT_openacc_macro_override)) {

clang/lib/Driver/ToolChains/Flang.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,11 @@ void Flang::addOtherOptions(const ArgList &Args, ArgStringList &CmdArgs) const {
132132
options::OPT_fno_offload_global_filtering,
133133
options::OPT_funsigned, options::OPT_fno_unsigned});
134134

135+
if (Args.hasArg(options::OPT_fopenacc)) {
136+
const Driver &D = getToolChain().getDriver();
137+
D.Diag(diag::warn_openacc_experimental);
138+
}
139+
135140
llvm::codegenoptions::DebugInfoKind DebugInfoKind;
136141
if (Args.hasArg(options::OPT_gN_Group)) {
137142
Arg *gNArg = Args.getLastArg(options::OPT_gN_Group);

clang/test/AST/ast-print-openacc-atomic-construct.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
// RUN: %clang_cc1 -fopenacc -ast-print %s -o - | FileCheck %s
2-
// XFAIL: *
32

43
void foo(int v, int x) {
54
// CHECK: #pragma acc atomic read

clang/test/AST/ast-print-openacc-cache-construct.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
// RUN: %clang_cc1 -fopenacc -ast-print %s -o - | FileCheck %s
2-
// XFAIL: *
32
void foo() {
43
int Array[5];
54
// CHECK: #pragma acc cache(readonly: Array[1], Array[1:2])

clang/test/AST/ast-print-openacc-combined-construct.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
// -fopenacc unsupported on AMD downstream
2-
// UNSUPPORTED: true
31
// RUN: %clang_cc1 -fopenacc -Wno-openacc-deprecated-clause-alias -ast-print %s -o - | FileCheck %s
42

53
constexpr int get_value() { return 1; }

clang/test/AST/ast-print-openacc-compute-construct.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
// -fopenacc unsupported on AMD downstream
2-
// UNSUPPORTED: true
31
// RUN: %clang_cc1 -fopenacc -Wno-openacc-deprecated-clause-alias -ast-print %s -o - | FileCheck %s
42

53
void foo() {

clang/test/AST/ast-print-openacc-data-construct.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
// -fopenacc unsupported on AMD downstream
2-
// UNSUPPORTED: true
31
// RUN: %clang_cc1 -fopenacc -Wno-openacc-deprecated-clause-alias -Wno-source-uses-openacc -ast-print %s -o - | FileCheck %s
42

53
void foo() {

clang/test/AST/ast-print-openacc-declare-construct.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
// RUN: %clang_cc1 -fopenacc -ast-print %s -o - | FileCheck %s
22
// flang decided that we would NOT accept -fopenacc downsteam
3-
// XFAIL: *
43

54
int *Global, *Global2;
65
int GlobalArray[5];

0 commit comments

Comments
 (0)