Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 17 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES.
# All rights reserved. SPDX-License-Identifier: Apache-2.0
# SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION &
# AFFILIATES. All rights reserved. SPDX-License-Identifier: Apache-2.0
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not
# use this file except in compliance with the License. You may obtain a copy of
Expand All @@ -15,6 +15,17 @@

cmake_minimum_required(VERSION 3.20 FATAL_ERROR)

# Record whether the user explicitly requested CUDA architectures *before*
# project() runs. enable_language(CUDA) (CMP0104 NEW) initializes
# CMAKE_CUDA_ARCHITECTURES to a compiler default, so testing it afterwards
# cannot tell a user-provided -DCMAKE_CUDA_ARCHITECTURES from that default.
set(_EDGELLM_USER_CUDA_ARCHS FALSE)
if(DEFINED CMAKE_CUDA_ARCHITECTURES)
if(NOT CMAKE_CUDA_ARCHITECTURES STREQUAL "")
set(_EDGELLM_USER_CUDA_ARCHS TRUE)
endif()
endif()

project(
tensorrt_edgellm_sdk
VERSION 0.8.0
Expand Down Expand Up @@ -61,7 +72,10 @@ endif()
set_ifndef(CUDA_CTK_VERSION 12.8)
set_ifndef(CUDA_DIR /usr/local/cuda-${CUDA_CTK_VERSION})

if(NOT DEFINED AARCH64_BUILD)
# Apply the project's default architecture set only when the user did not pass
# an explicit -DCMAKE_CUDA_ARCHITECTURES (e.g. a native Jetson SM87 build), and
# not for the aarch64 cross toolchain which selects its own.
if(NOT _EDGELLM_USER_CUDA_ARCHS AND NOT DEFINED AARCH64_BUILD)
set(CMAKE_CUDA_ARCHITECTURES 80;86;89)
if(CUDA_CTK_VERSION VERSION_GREATER_EQUAL 12.8)
list(APPEND CMAKE_CUDA_ARCHITECTURES 100a 120)
Expand Down
9 changes: 7 additions & 2 deletions cmake/CuteDsl.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -775,7 +775,8 @@ function(cute_dsl_setup)
foreach(_tgt ${ARG_LINK_TARGETS})
get_target_property(_tgt_type ${_tgt} TYPE)
if(_tgt_type STREQUAL "STATIC_LIBRARY")
target_link_libraries(${_tgt} PUBLIC "${_static_lib}")
target_link_libraries(${_tgt} PUBLIC "${_static_lib}"
trt_edgellm_cutedsl_cudart_shim)
else()
target_link_libraries(${_tgt} PRIVATE "${_static_lib}"
trt_edgellm_cutedsl_cudart_shim)
Expand All @@ -787,7 +788,11 @@ function(cute_dsl_setup)
# JetPack 6).
if(NOT _cute_dsl_cuda_ver STREQUAL "" AND _cute_dsl_cuda_ver VERSION_LESS
12.8)
target_link_options(${_tgt} PRIVATE "-Wl,--wrap=_cudaLaunchKernelEx")
if(_tgt_type STREQUAL "STATIC_LIBRARY")
target_link_options(${_tgt} INTERFACE "-Wl,--wrap=_cudaLaunchKernelEx")
else()
target_link_options(${_tgt} PRIVATE "-Wl,--wrap=_cudaLaunchKernelEx")
endif()
endif()
endforeach()

Expand Down