Skip to content

Commit

Permalink
Use more specific warning message
Browse files Browse the repository at this point in the history
Change-Id: I98a72a95e2b51f8a4b577dcef15f40e7c28719a2
  • Loading branch information
lhutton1 committed Jan 29, 2024
1 parent 52cbe87 commit abeb0fa
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/target/llvm/llvm_instance.cc
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ LLVMTargetInfo::LLVMTargetInfo(LLVMInstance& instance, const TargetJSON& target)
// give the code a chance to run with a less-specific target.
LOG(ERROR) << "LLVM cpu architecture `-mcpu=" << cpu_
<< "` is not valid in `-mtriple=" << triple_ << "`"
<< ", cpu architecture ignored";
<< ", using default `-mcpu=" << String(defaults::cpu) << "`";
}
}

Expand Down
10 changes: 10 additions & 0 deletions tests/python/relay/strategy/test_select_implementation.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
from tvm.relay.testing import run_infer_type, run_opt_pass
import tvm.testing
from tvm import topi
from tvm.target.codegen import llvm_version_major


@pytest.mark.parametrize(
Expand Down Expand Up @@ -90,6 +91,9 @@ def _get_conv2d_impl(dtype, target):
return impl.name


@pytest.mark.skipif(
llvm_version_major() < 15, reason=f"Requires LLVM 15+, got {llvm_version_major()}"
)
@pytest.mark.parametrize(
"target,expected_impl",
[
Expand Down Expand Up @@ -132,6 +136,9 @@ def test_int8_conv2d(target, expected_impl):
assert selected_impl == expected_impl


@pytest.mark.skipif(
llvm_version_major() < 15, reason=f"Requires LLVM 15+, got {llvm_version_major()}"
)
@pytest.mark.parametrize(
"target,expected_impl",
[
Expand Down Expand Up @@ -166,6 +173,9 @@ def test_fp32_conv2d(target, expected_impl):
assert selected_impl == expected_impl


@pytest.mark.skipif(
llvm_version_major() < 15, reason=f"Requires LLVM 15+, got {llvm_version_major()}"
)
@pytest.mark.parametrize(
"target,expected_impl",
[
Expand Down
6 changes: 4 additions & 2 deletions tests/python/target/test_llvm_features_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,10 @@ def test_llvm_targets(capfd):
tvm.target.codegen.llvm_get_cpu_features(
tvm.target.Target("llvm -mtriple=x86_64-linux-gnu -mcpu=dummy")
)
expected_str = ("Error: LLVM cpu architecture `-mcpu=dummy` is not valid in "
"`-mtriple=x86_64-linux-gnu`, cpu architecture ignored")
expected_str = (
"Error: LLVM cpu architecture `-mcpu=dummy` is not valid in "
"`-mtriple=x86_64-linux-gnu`, using default `-mcpu=generic`"
)
assert expected_str in capfd.readouterr().err


Expand Down

0 comments on commit abeb0fa

Please sign in to comment.