Skip to content

Commit fcd7c0c

Browse files
authored
Merge branch 'main' into nvvm
2 parents d96c848 + 7a24bd8 commit fcd7c0c

45 files changed

Lines changed: 2112 additions & 183 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ cuda_bindings/cuda/bindings/_bindings/cyruntime_ptds.pxd
2727
cuda_bindings/cuda/bindings/_bindings/cyruntime_ptds.pyx
2828
cuda_bindings/cuda/bindings/_bindings/cynvrtc.pxd
2929
cuda_bindings/cuda/bindings/_bindings/cynvrtc.pyx
30+
cuda_bindings/cuda/bindings/_internal/cufile.pyx
3031
cuda_bindings/cuda/bindings/_internal/nvjitlink.pyx
3132
cuda_bindings/cuda/bindings/_internal/nvvm.pyx
3233
cuda_bindings/cuda/bindings/_lib/utils.pxd

conftest.py

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
import os
5+
import pytest
6+
7+
8+
def pytest_collection_modifyitems(config, items):
9+
cuda_home = os.environ.get("CUDA_HOME")
10+
for item in items:
11+
nodeid = item.nodeid.replace("\\", "/")
12+
13+
# Package markers by path
14+
if (
15+
nodeid.startswith("cuda_pathfinder/tests/")
16+
or "/cuda_pathfinder/tests/" in nodeid
17+
):
18+
item.add_marker(pytest.mark.pathfinder)
19+
if (
20+
nodeid.startswith("cuda_bindings/tests/")
21+
or "/cuda_bindings/tests/" in nodeid
22+
):
23+
item.add_marker(pytest.mark.bindings)
24+
if nodeid.startswith("cuda_core/tests/") or "/cuda_core/tests/" in nodeid:
25+
item.add_marker(pytest.mark.core)
26+
27+
# Smoke tests
28+
if nodeid.startswith("tests/integration/") or "/tests/integration/" in nodeid:
29+
item.add_marker(pytest.mark.smoke)
30+
31+
# Cython tests (any tests/cython subtree)
32+
if (
33+
"/tests/cython/" in nodeid
34+
or nodeid.endswith("/tests/cython")
35+
or ("/cython/" in nodeid and "/tests/" in nodeid)
36+
):
37+
item.add_marker(pytest.mark.cython)
38+
39+
# Gate core cython tests on CUDA_HOME
40+
if "core" in item.keywords and not cuda_home:
41+
item.add_marker(
42+
pytest.mark.skip(
43+
reason="CUDA_HOME not set; skipping core cython tests"
44+
)
45+
)

cuda_bindings/cuda/bindings/_bindings/cydriver.pxd.in

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2239,6 +2239,11 @@ cdef CUresult _cuCheckpointProcessLock(int pid, CUcheckpointLockArgs* args) exce
22392239
cdef CUresult _cuCheckpointProcessCheckpoint(int pid, CUcheckpointCheckpointArgs* args) except ?CUDA_ERROR_NOT_FOUND nogil
22402240
{{endif}}
22412241

2242+
{{if 'cuCheckpointProcessRestore' in found_functions}}
2243+
2244+
cdef CUresult _cuCheckpointProcessRestore(int pid, CUcheckpointRestoreArgs* args) except ?CUDA_ERROR_NOT_FOUND nogil
2245+
{{endif}}
2246+
22422247
{{if 'cuCheckpointProcessUnlock' in found_functions}}
22432248

22442249
cdef CUresult _cuCheckpointProcessUnlock(int pid, CUcheckpointUnlockArgs* args) except ?CUDA_ERROR_NOT_FOUND nogil

cuda_bindings/cuda/bindings/_bindings/cydriver.pyx.in

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -463,6 +463,7 @@ cdef bint __cuPythonInit = False
463463
{{if 'cuCheckpointProcessGetState' in found_functions}}cdef void *__cuCheckpointProcessGetState = NULL{{endif}}
464464
{{if 'cuCheckpointProcessLock' in found_functions}}cdef void *__cuCheckpointProcessLock = NULL{{endif}}
465465
{{if 'cuCheckpointProcessCheckpoint' in found_functions}}cdef void *__cuCheckpointProcessCheckpoint = NULL{{endif}}
466+
{{if 'cuCheckpointProcessRestore' in found_functions}}cdef void *__cuCheckpointProcessRestore = NULL{{endif}}
466467
{{if 'cuCheckpointProcessUnlock' in found_functions}}cdef void *__cuCheckpointProcessUnlock = NULL{{endif}}
467468
{{if 'cuProfilerStart' in found_functions}}cdef void *__cuProfilerStart = NULL{{endif}}
468469
{{if 'cuProfilerStop' in found_functions}}cdef void *__cuProfilerStop = NULL{{endif}}
@@ -2667,6 +2668,10 @@ cdef int _cuPythonInit() except -1 nogil:
26672668
global __cuCheckpointProcessCheckpoint
26682669
_F_cuGetProcAddress_v2('cuCheckpointProcessCheckpoint', &__cuCheckpointProcessCheckpoint, 12080, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
26692670
{{endif}}
2671+
{{if 'cuCheckpointProcessRestore' in found_functions}}
2672+
global __cuCheckpointProcessRestore
2673+
_F_cuGetProcAddress_v2('cuCheckpointProcessRestore', &__cuCheckpointProcessRestore, 12080, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
2674+
{{endif}}
26702675
{{if 'cuCheckpointProcessUnlock' in found_functions}}
26712676
global __cuCheckpointProcessUnlock
26722677
_F_cuGetProcAddress_v2('cuCheckpointProcessUnlock', &__cuCheckpointProcessUnlock, 12080, CU_GET_PROC_ADDRESS_DEFAULT, NULL)
@@ -4895,6 +4900,10 @@ cdef int _cuPythonInit() except -1 nogil:
48954900
global __cuCheckpointProcessCheckpoint
48964901
__cuCheckpointProcessCheckpoint = windll.GetProcAddress(handle, 'cuCheckpointProcessCheckpoint')
48974902
{{endif}}
4903+
{{if 'cuCheckpointProcessRestore' in found_functions}}
4904+
global __cuCheckpointProcessRestore
4905+
__cuCheckpointProcessRestore = windll.GetProcAddress(handle, 'cuCheckpointProcessRestore')
4906+
{{endif}}
48984907
{{if 'cuCheckpointProcessUnlock' in found_functions}}
48994908
global __cuCheckpointProcessUnlock
49004909
__cuCheckpointProcessUnlock = windll.GetProcAddress(handle, 'cuCheckpointProcessUnlock')
@@ -7120,6 +7129,10 @@ cdef int _cuPythonInit() except -1 nogil:
71207129
global __cuCheckpointProcessCheckpoint
71217130
__cuCheckpointProcessCheckpoint = dlfcn.dlsym(handle, 'cuCheckpointProcessCheckpoint')
71227131
{{endif}}
7132+
{{if 'cuCheckpointProcessRestore' in found_functions}}
7133+
global __cuCheckpointProcessRestore
7134+
__cuCheckpointProcessRestore = dlfcn.dlsym(handle, 'cuCheckpointProcessRestore')
7135+
{{endif}}
71237136
{{if 'cuCheckpointProcessUnlock' in found_functions}}
71247137
global __cuCheckpointProcessUnlock
71257138
__cuCheckpointProcessUnlock = dlfcn.dlsym(handle, 'cuCheckpointProcessUnlock')
@@ -12583,6 +12596,18 @@ cdef CUresult _cuCheckpointProcessCheckpoint(int pid, CUcheckpointCheckpointArgs
1258312596
return err
1258412597
{{endif}}
1258512598

12599+
{{if 'cuCheckpointProcessRestore' in found_functions}}
12600+
12601+
cdef CUresult _cuCheckpointProcessRestore(int pid, CUcheckpointRestoreArgs* args) except ?CUDA_ERROR_NOT_FOUND nogil:
12602+
global __cuCheckpointProcessRestore
12603+
cuPythonInit()
12604+
if __cuCheckpointProcessRestore == NULL:
12605+
with gil:
12606+
raise RuntimeError('Function "cuCheckpointProcessRestore" not found')
12607+
err = (<CUresult (*)(int, CUcheckpointRestoreArgs*) except ?CUDA_ERROR_NOT_FOUND nogil> __cuCheckpointProcessRestore)(pid, args)
12608+
return err
12609+
{{endif}}
12610+
1258612611
{{if 'cuCheckpointProcessUnlock' in found_functions}}
1258712612

1258812613
cdef CUresult _cuCheckpointProcessUnlock(int pid, CUcheckpointUnlockArgs* args) except ?CUDA_ERROR_NOT_FOUND nogil:
@@ -15986,6 +16011,13 @@ cpdef dict _inspect_function_pointers():
1598616011
data["__cuCheckpointProcessCheckpoint"] = <intptr_t>0
1598716012
{{endif}}
1598816013

16014+
{{if 'cuCheckpointProcessRestore' in found_functions}}
16015+
global __cuCheckpointProcessRestore
16016+
data["__cuCheckpointProcessRestore"] = <intptr_t>__cuCheckpointProcessRestore
16017+
{{else}}
16018+
data["__cuCheckpointProcessRestore"] = <intptr_t>0
16019+
{{endif}}
16020+
1598916021
{{if 'cuCheckpointProcessUnlock' in found_functions}}
1599016022
global __cuCheckpointProcessUnlock
1599116023
data["__cuCheckpointProcessUnlock"] = <intptr_t>__cuCheckpointProcessUnlock

0 commit comments

Comments
 (0)