Skip to content

Commit bd42838

Browse files
authored
build: enable free-threading compatibility (#1103)
* build: enable free-threading compatibility * chore: add ftcompat flag to cython tests * build: enable ft compat for all cython tests
1 parent e32892c commit bd42838

File tree

6 files changed

+6
-6
lines changed

6 files changed

+6
-6
lines changed

cuda_bindings/setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,7 @@ def do_cythonize(extensions):
329329
return cythonize(
330330
extensions,
331331
nthreads=nthreads,
332-
compiler_directives=dict(language_level=3, embedsignature=True, binding=True),
332+
compiler_directives=dict(language_level=3, embedsignature=True, binding=True, freethreading_compatible=True),
333333
**extra_cythonize_kwargs,
334334
)
335335

cuda_bindings/tests/cython/build_tests.bat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@ REM SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE
55

66
setlocal
77
set CL=%CL% /I"%CUDA_HOME%\include"
8-
cythonize -3 -i %~dp0test_*.pyx
8+
cythonize -3 -i -Xfreethreading_compatible=True %~dp0test_*.pyx
99
endlocal

cuda_bindings/tests/cython/build_tests.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,4 @@ else
1414
exit 1
1515
fi
1616

17-
cythonize -3 -i ${SCRIPTPATH}/test_*.pyx
17+
cythonize -3 -i -Xfreethreading_compatible=True ${SCRIPTPATH}/test_*.pyx

cuda_core/build_hooks.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ def get_cuda_paths():
101101
verbose=True,
102102
language_level=3,
103103
nthreads=nthreads,
104-
compiler_directives={"embedsignature": True, "warn.deprecated.IF": False},
104+
compiler_directives={"embedsignature": True, "warn.deprecated.IF": False, "freethreading_compatible": True},
105105
compile_time_env=compile_time_env,
106106
)
107107

cuda_core/pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ cu12 = ["cuda-bindings[all]==12.*"]
5151
cu13 = ["cuda-bindings[all]==13.*"]
5252

5353
[dependency-groups]
54-
test = ["cython>=3.0", "setuptools", "pytest>=6.2.4"]
54+
test = ["cython>=3.1", "setuptools", "pytest>=6.2.4"]
5555
test-cu12 = ["cuda-core[test]", "cupy-cuda12x; python_version < '3.14'", "cuda-toolkit[cudart]==12.*"] # runtime headers needed by CuPy
5656
test-cu13 = ["cuda-core[test]", "cupy-cuda13x; python_version < '3.14'", "cuda-toolkit[cudart]==13.*"] # runtime headers needed by CuPy
5757
# free threaded build, cupy doesn't support free-threaded builds yet, so avoid installing it for now

cuda_core/tests/cython/build_tests.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,4 @@ else
1515
exit 1
1616
fi
1717

18-
cythonize -3 -i ${SCRIPTPATH}/test_*.pyx
18+
cythonize -3 -i -Xfreethreading_compatible=True ${SCRIPTPATH}/test_*.pyx

0 commit comments

Comments
 (0)