Skip to content

Commit

Permalink
Mark x86 specific test (#10672)
Browse files Browse the repository at this point in the history
Currently this test crashes pytest on any other architecture, this introduces a decorator which can be used to mark future x86 tests.
  • Loading branch information
Mousius authored Mar 19, 2022
1 parent 3ceae5f commit e1af228
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
17 changes: 17 additions & 0 deletions python/tvm/testing/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ def test_something():
import functools
import logging
import os
import platform
import sys
import time
import pickle
Expand Down Expand Up @@ -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.
Expand Down
1 change: 1 addition & 0 deletions tests/python/relay/test_op_level2.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [
Expand Down

0 comments on commit e1af228

Please sign in to comment.