Skip to content
This repository was archived by the owner on Apr 6, 2026. It is now read-only.

Commit 3d028b0

Browse files
authored
Remove -static-global-template-stub on CUDA < 12.8 (#345)
This makes it possible to use the `-static-global-template-stub` option without breaking builds on CUDA < 12.8.
1 parent 2997c77 commit 3d028b0

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

build2cmake/src/templates/cuda/kernel.cmake

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,19 @@ if(GPU_LANG STREQUAL "CUDA")
2525

2626
{% if cuda_flags %}
2727

28+
set(_CUDA_FLAGS "{{ cuda_flags }}")
29+
# -static-global-template-stub is not supported on CUDA < 12.8. Remove this
30+
# once we don't support CUDA 12.6 anymore.
31+
if(CUDA_VERSION VERSION_LESS 12.8)
32+
string(REGEX REPLACE "-static-global-template-stub=(true|false)" "" _CUDA_FLAGS "${_CUDA_FLAGS}")
33+
endif()
34+
2835
foreach(_KERNEL_SRC {{'${' + kernel_name + '_SRC}'}})
2936
if(_KERNEL_SRC MATCHES ".*\\.cu$")
3037
set_property(
3138
SOURCE ${_KERNEL_SRC}
3239
APPEND PROPERTY
33-
COMPILE_OPTIONS "$<$<COMPILE_LANGUAGE:CUDA>:{{ cuda_flags }}>"
40+
COMPILE_OPTIONS "$<$<COMPILE_LANGUAGE:CUDA>:${_CUDA_FLAGS}>"
3441
)
3542
endif()
3643
endforeach()

0 commit comments

Comments
 (0)