File size: 451 Bytes
567c8ad |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
import pytest
def pytest_addoption(parser):
parser.addoption("--device", action="store", default="cuda")
@pytest.fixture
def device(request):
return request.config.getoption("--device")
@pytest.fixture
def fresh_knobs(monkeypatch):
from triton._internal_testing import _fresh_knobs_impl
fresh_function, reset_function = _fresh_knobs_impl(monkeypatch)
try:
yield fresh_function()
finally:
reset_function()
|