Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CMake doesn't support IPO for current CUDA compiler #121297

Open
eduardz1 opened this issue Dec 29, 2024 · 0 comments
Open

CMake doesn't support IPO for current CUDA compiler #121297

eduardz1 opened this issue Dec 29, 2024 · 0 comments
Labels
cuda ipo Interprocedural optimizations

Comments

@eduardz1
Copy link

eduardz1 commented Dec 29, 2024

When trying to compile my CUDA project with LTO enabled I get the error CMAKE doesn't support IPO for current CUDA compiler. In my root CMakeLists.txt file I have the check defined in this way:

cmake_minimum_required(VERSION 3.27...3.31)

if(NOT DEFINED CMAKE_CUDA_ARCHITECTURES)
  set(CMAKE_CUDA_ARCHITECTURES 50)
endif()

project(
    cuda_path_tracer
    VERSION 1.0
    LANGUAGES CXX CUDA
)

include(CheckIPOSupported)
check_ipo_supported(RESULT supported OUTPUT error)

if (supported)
    set(CMAKE_INTERPROCEDURAL_OPTIMIZATION TRUE)
else()
    message(WARNING "IPO is not supported: ${error}")
endif()

...

Shouldn't LTO be supported with clang? I am currently using clang20

Edit

I managed to find where in the CMake source code LTO support for CUDA compilation with Clang is unset. Here https://fuchsia.googlesource.com/third_party/github.com/Kitware/CMake/+/refs/heads/main/Modules/Compiler/Clang-CUDA.cmake we see

# Clang doesn't support CUDA device LTO
set(_CMAKE_CUDA_IPO_SUPPORTED_BY_CMAKE NO)
set(_CMAKE_CUDA_IPO_MAY_BE_SUPPORTED_BY_COMPILER NO)

However, I can't seem to find this mentioned anywhere in the Clang's documentation, is it a feature that is on a roadmap for future Clang releases?

@EugeneZelenko EugeneZelenko added cuda ipo Interprocedural optimizations and removed new issue labels Dec 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cuda ipo Interprocedural optimizations
Projects
None yet
Development

No branches or pull requests

2 participants