diff --git a/python/tvm/testing/utils.py b/python/tvm/testing/utils.py index 49a8aa796a64..b21e722be630 100644 --- a/python/tvm/testing/utils.py +++ b/python/tvm/testing/utils.py @@ -68,6 +68,7 @@ def test_something(): import functools import logging import os +import platform import sys import time import pickle @@ -545,6 +546,22 @@ def uses_gpu(*args): return _compose(args, _uses_gpu) +def requires_x86(*args): + """Mark a test as requiring the x86 Architecture to run. + + Tests with this mark will not be run unless on an x86 platform. + + Parameters + ---------- + f : function + Function to mark + """ + _requires_x86 = [ + pytest.mark.skipif(platform.machine() != "x86_64", reason="x86 Architecture Required"), + ] + return _compose(args, _requires_x86) + + def requires_gpu(*args): """Mark a test as requiring a GPU to run. diff --git a/tests/python/relay/test_op_level2.py b/tests/python/relay/test_op_level2.py index ab34324d4118..bd9536742a8b 100644 --- a/tests/python/relay/test_op_level2.py +++ b/tests/python/relay/test_op_level2.py @@ -1644,6 +1644,7 @@ def test_upsampling3d(): _test_upsampling3d("NDHWC", "trilinear", "align_corners") +@tvm.testing.requires_x86 @pytest.mark.skipif(tvm.target.codegen.llvm_version_major() < 8, reason="Requires LLVM 8") class TestConv2DInt8Intrinsics: supported_targets = [