Skip to content

Commit

Permalink
Add ltoir linkable code unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
isVoid committed Apr 18, 2024
1 parent cb4e652 commit 08bb96f
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
15 changes: 14 additions & 1 deletion pynvjitlink/tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import pytest

from numba import cuda
from pynvjitlink.patch import Archive, Cubin, CUSource, Fatbin, Object, PTXSource
from pynvjitlink.patch import Archive, Cubin, CUSource, Fatbin, Object, PTXSource, LTOIR


@pytest.fixture(scope="session")
Expand Down Expand Up @@ -113,6 +113,14 @@ def undefined_extern_cubin():
return f.read()


@pytest.fixture(scope="session")
def device_functions_ltoir():
test_dir = os.path.dirname(os.path.abspath(__file__))
path = os.path.join(test_dir, "test_device_functions.ltoir")
with open(path, "rb") as f:
return f.read()


@pytest.fixture(scope="session")
def linkable_code_archive(device_functions_archive):
return Archive(device_functions_archive)
Expand Down Expand Up @@ -141,3 +149,8 @@ def linkable_code_object(device_functions_object):
@pytest.fixture(scope="session")
def linkable_code_ptx(device_functions_ptx):
return PTXSource(device_functions_ptx)


@pytest.fixture(scope="session")
def linkable_code_ltoir(device_functions_ltoir):
return LTOIR(device_functions_ltoir)
1 change: 1 addition & 0 deletions pynvjitlink/tests/test_patch.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ def test_add_file_guess_ext_invalid_input(
"linkable_code_fatbin",
"linkable_code_object",
"linkable_code_ptx",
"linkable_code_ltoir",
),
)
def test_jit_with_linkable_code(file, request):
Expand Down

0 comments on commit 08bb96f

Please sign in to comment.