Skip to content

Commit 04b80ba

Browse files
committed
add warning
1 parent a967fda commit 04b80ba

File tree

3 files changed

+11
-0
lines changed

3 files changed

+11
-0
lines changed

clang/include/clang/Basic/DiagnosticDriverKinds.td

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,10 @@ def err_drv_hipspv_no_hip_path : Error<
9393
"'--hip-path' must be specified when offloading to "
9494
"SPIR-V%select{| unless %1 is given}0.">;
9595

96+
// TODO: Remove when COV6 is fully supported by ROCm.
97+
def warn_drv_amdgpu_cov6: Warning<
98+
"code object v6 is still in development and not ready for production use yet;"
99+
" use at your own risk">;
96100
def err_drv_undetermined_gpu_arch : Error<
97101
"cannot determine %0 architecture: %1; consider passing it via "
98102
"'%2'">;

clang/lib/Driver/ToolChains/CommonArgs.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2661,6 +2661,12 @@ void tools::checkAMDGPUCodeObjectVersion(const Driver &D,
26612661
if (Remnant || CodeObjVer < MinCodeObjVer || CodeObjVer > MaxCodeObjVer)
26622662
D.Diag(diag::err_drv_invalid_int_value)
26632663
<< CodeObjArg->getAsString(Args) << CodeObjArg->getValue();
2664+
2665+
// COV6 is only supported by LLVM at the time of writing this, and it's
2666+
// expected to take some time before all ROCm components fully
2667+
// support it. In the meantime, make sure users are aware of this.
2668+
if (CodeObjVer == 6)
2669+
D.Diag(diag::warn_drv_amdgpu_cov6);
26642670
}
26652671
}
26662672
}

clang/test/Driver/hip-code-object-version.hip

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
// RUN: --offload-arch=gfx906 --rocm-path=%S/Inputs/rocm \
3131
// RUN: %s 2>&1 | FileCheck -check-prefix=V6 %s
3232

33+
// V6: warning: code object v6 is still in development and not ready for production use yet; use at your own risk
3334
// V6: "-mcode-object-version=6"
3435
// V6: "-mllvm" "--amdhsa-code-object-version=6"
3536
// V6: "-targets=host-x86_64-unknown-linux,hipv4-amdgcn-amd-amdhsa--gfx906"

0 commit comments

Comments
 (0)