Skip to content

Commit

Permalink
update test
Browse files Browse the repository at this point in the history
  • Loading branch information
ksimpson-work committed Jan 21, 2025
1 parent 2f617eb commit caebb92
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions cuda_core/tests/test_module.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,10 @@
from conftest import can_load_generated_ptx

try:
from cuda.bindings import driver
from cuda.bindings import driver, runtime
except ImportError:
from cuda import cuda as driver
from cuda import cudart as runtime

from cuda.core.experimental import Program, ProgramOptions
from cuda.core.experimental._utils import handle_return
Expand All @@ -22,8 +23,10 @@
@pytest.fixture(scope="module")
def cuda_version():
version = handle_return(driver.cuDriverGetVersion())
version = handle_return(runtime.cudaRuntimeGetVersion())
major_version = version // 1000
minor_version = (version % 1000) // 10
print(version)
return major_version, minor_version


Expand Down Expand Up @@ -55,7 +58,7 @@ def get_saxpy_kernel(init_cuda):


@pytest.mark.xfail(not can_load_generated_ptx(), reason="PTX version too new")
def test_get_kernel():
def test_get_kernel(init_cuda):
kernel = """extern "C" __global__ void ABC() { }"""
object_code = Program(kernel, "c++", options=ProgramOptions(relocatable_device_code=True)).compile("ptx")
assert object_code._handle is None
Expand Down

0 comments on commit caebb92

Please sign in to comment.