Skip to content

Commit

Permalink
[ROCm] Always require --iree-hip-target (#18645)
Browse files Browse the repository at this point in the history
Do not default to any arbitrary chip -- better to fail during
compilation than at runtime.

No test because, AFAICT, it's not possible to match error with an
unknown location using `--verify-diagnostic`.
  • Loading branch information
kuhar authored Oct 1, 2024
1 parent 0b17c72 commit 20a7638
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion compiler/plugins/target/ROCM/ROCMTarget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ namespace mlir::iree_compiler::IREE::HAL {
namespace {

struct ROCmOptions {
std::string target = "gfx908";
std::string target = "";
std::string targetFeatures = "";
std::string bitcodeDirectory = getDefaultBitcodeDirectory();
int wavesPerEu = 0;
Expand Down Expand Up @@ -98,6 +98,11 @@ struct ROCmOptions {
}

LogicalResult verify(mlir::Builder &builder) const {
if (target.empty()) {
return emitError(builder.getUnknownLoc())
<< "HIP target not set; did you forget to pass "
"'--iree-hip-target'?";
}
if (GPU::normalizeHIPTarget(target).empty()) {
return emitError(builder.getUnknownLoc(), "Unknown HIP target '")
<< target << "'";
Expand Down

0 comments on commit 20a7638

Please sign in to comment.