Skip to content

Commit 29d18b7

Browse files
committed
Propagate CuTe DSL cudart shim and --wrap to static-lib consumers
cute_dsl_setup() linked the cutedsl cudart shim and the CUDA<12.8 -Wl,--wrap=_cudaLaunchKernelEx option PRIVATEly. For STATIC_LIBRARY link targets a static archive performs no link step, so neither reached the final executable, breaking the CuTe DSL kernels on JetPack 6 / CUDA 12.6. Propagate the shim via PUBLIC and the --wrap link option via INTERFACE for static-library targets so the consuming executable inherits them; keep PRIVATE for shared/other targets. Signed-off-by: suharvest <suharvest@gmail.com>
1 parent 7d32c0b commit 29d18b7

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

cmake/CuteDsl.cmake

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -775,7 +775,8 @@ function(cute_dsl_setup)
775775
foreach(_tgt ${ARG_LINK_TARGETS})
776776
get_target_property(_tgt_type ${_tgt} TYPE)
777777
if(_tgt_type STREQUAL "STATIC_LIBRARY")
778-
target_link_libraries(${_tgt} PUBLIC "${_static_lib}")
778+
target_link_libraries(${_tgt} PUBLIC "${_static_lib}"
779+
trt_edgellm_cutedsl_cudart_shim)
779780
else()
780781
target_link_libraries(${_tgt} PRIVATE "${_static_lib}"
781782
trt_edgellm_cutedsl_cudart_shim)
@@ -787,7 +788,11 @@ function(cute_dsl_setup)
787788
# JetPack 6).
788789
if(NOT _cute_dsl_cuda_ver STREQUAL "" AND _cute_dsl_cuda_ver VERSION_LESS
789790
12.8)
790-
target_link_options(${_tgt} PRIVATE "-Wl,--wrap=_cudaLaunchKernelEx")
791+
if(_tgt_type STREQUAL "STATIC_LIBRARY")
792+
target_link_options(${_tgt} INTERFACE "-Wl,--wrap=_cudaLaunchKernelEx")
793+
else()
794+
target_link_options(${_tgt} PRIVATE "-Wl,--wrap=_cudaLaunchKernelEx")
795+
endif()
791796
endif()
792797
endforeach()
793798

0 commit comments

Comments
 (0)