Skip to content

Commit

Permalink
enforce the right CC is passed to NVRTC
Browse files Browse the repository at this point in the history
  • Loading branch information
leofang committed Dec 8, 2024
1 parent f3cc6bd commit b1f07a3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion cuda_core/tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
import pytest

from cuda.core.experimental import Device, _device
from cuda.core.experimental._utils import CUDAError, handle_return
from cuda.core.experimental._utils import handle_return


@pytest.fixture(scope="session", autouse=True)
Expand Down
6 changes: 4 additions & 2 deletions cuda_core/tests/test_program.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import pytest

from cuda import cuda, nvrtc
from cuda.core.experimental import Program
from cuda.core.experimental import Device, Program
from cuda.core.experimental._module import Kernel, ObjectCode


Expand Down Expand Up @@ -46,7 +46,9 @@ def test_program_init_invalid_code_format():
def test_program_compile_valid_target_type():
code = 'extern "C" __global__ void my_kernel() {}'
program = Program(code, "c++")
object_code = program.compile("ptx")
arch = "".join(str(i) for i in Device().compute_capability)
object_code = program.compile("ptx", options=(f"-arch=compute_{arch}",))
print(object_code._module.decode())
kernel = object_code.get_kernel("my_kernel")
assert isinstance(object_code, ObjectCode)
assert isinstance(kernel, Kernel)
Expand Down

0 comments on commit b1f07a3

Please sign in to comment.