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

Set -Wno-deprecated-gpu-targets when compiling for RAPIDS architectures #776

Merged
merged 3 commits into from
Feb 22, 2025
Merged
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
8 changes: 8 additions & 0 deletions rapids-cmake/cuda/set_architectures.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,13 @@ function(rapids_cuda_set_architectures mode)
list(TRANSFORM CMAKE_CUDA_ARCHITECTURES APPEND "-real")
endif()

# CUDA 12.8.0 and later warns when compiling for arch 70. We ignore this warning when compiling
# for RAPIDS architectures.
if(CMAKE_CUDA_COMPILER_ID STREQUAL "NVIDIA" AND CMAKE_CUDA_COMPILER_VERSION VERSION_GREATER_EQUAL
12.8.0)
string(APPEND CMAKE_CUDA_FLAGS " -Wno-deprecated-gpu-targets")
endif()

# cache the cuda archs.
get_property(cached_value GLOBAL PROPERTY rapids_cuda_architectures)
if(NOT cached_value)
Expand All @@ -103,5 +110,6 @@ function(rapids_cuda_set_architectures mode)

# Set as a local variable to maintain comp
set(CMAKE_CUDA_ARCHITECTURES ${CMAKE_CUDA_ARCHITECTURES} PARENT_SCOPE)
set(CMAKE_CUDA_FLAGS ${CMAKE_CUDA_FLAGS} PARENT_SCOPE)

endfunction()
8 changes: 7 additions & 1 deletion testing/cuda/validate-cuda-native.cmake
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#=============================================================================
# Copyright (c) 2021-2024, NVIDIA CORPORATION.
# Copyright (c) 2021-2025, NVIDIA CORPORATION.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -29,3 +29,9 @@ endforeach()
if(NOT DEFINED CACHE{CMAKE_CUDA_ARCHITECTURES} )
message(FATAL_ERROR "rapids_cuda_set_architectures didn't make CMAKE_CUDA_ARCHITECTURES a cache variable")
endif()

if(CMAKE_CUDA_COMPILER_VERSION VERSION_GREATER_EQUAL 12.8.0 )
if(NOT CMAKE_CUDA_FLAGS MATCHES "Wno-deprecated-gpu-targets")
message(FATAL_ERROR "CMAKE_CUDA_FLAGS should have -Wno-deprecated-gpu-targets")
endif()
endif()
8 changes: 7 additions & 1 deletion testing/cuda/validate-cuda-rapids.cmake
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#=============================================================================
# Copyright (c) 2021-2024, NVIDIA CORPORATION.
# Copyright (c) 2021-2025, NVIDIA CORPORATION.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -48,3 +48,9 @@ list(APPEND CMAKE_CUDA_ARCHITECTURES ${last_value})
if(NOT DEFINED CACHE{CMAKE_CUDA_ARCHITECTURES} )
message(FATAL_ERROR "rapids_cuda_set_architectures didn't make CMAKE_CUDA_ARCHITECTURES a cache variable")
endif()

if(CMAKE_CUDA_COMPILER_VERSION VERSION_GREATER_EQUAL 12.8.0 )
if(NOT CMAKE_CUDA_FLAGS MATCHES "Wno-deprecated-gpu-targets")
message(FATAL_ERROR "CMAKE_CUDA_FLAGS should have -Wno-deprecated-gpu-targets")
endif()
endif()
Loading