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

Issue a deprecation warning when compiling with ICC #2076

Merged
merged 2 commits into from
Oct 29, 2024
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
1 change: 1 addition & 0 deletions CMakePresets.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
"CCCL_ENABLE_TESTING": false,
"CCCL_ENABLE_EXAMPLES": false,
"CCCL_ENABLE_C": false,
"CCCL_SUPPRESS_ICC_DEPRECATION_WARNING": true,
"libcudacxx_ENABLE_INSTALL_RULES": true,
"CUB_ENABLE_INSTALL_RULES": true,
"Thrust_ENABLE_INSTALL_RULES": true,
Expand Down
5 changes: 5 additions & 0 deletions cmake/CCCLBuildCompilerTargets.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ set(CMAKE_MSVC_DEBUG_INFORMATION_FORMAT Embedded)
option(CCCL_ENABLE_EXCEPTIONS "Enable exceptions within CCCL libraries." ON)
option(CCCL_ENABLE_RTTI "Enable RTTI within CCCL libraries." ON)
option(CCCL_ENABLE_WERROR "Treat warnings as errors for CCCL targets." ON)
option(CCCL_SUPPRESS_ICC_DEPRECATION_WARNING "Suppress Intel Compiler deprecation warnings" OFF)

function(cccl_build_compiler_interface interface_target cuda_compile_options cxx_compile_options compile_defs)
add_library(${interface_target} INTERFACE)
Expand Down Expand Up @@ -65,6 +66,10 @@ function(cccl_build_compiler_targets)
list(APPEND cxx_compile_definitions "CCCL_DISABLE_RTTI")
endif()

if (CCCL_SUPPRESS_ICC_DEPRECATION_WARNING)
list(APPEND cxx_compile_definitions "CCCL_SUPPRESS_ICC_DEPRECATION_WARNING")
endif()

bernhardmgruber marked this conversation as resolved.
Show resolved Hide resolved
if ("MSVC" STREQUAL "${CMAKE_CXX_COMPILER_ID}")
list(APPEND cuda_compile_options "--use-local-env")
list(APPEND cxx_compile_options "/bigobj")
Expand Down
4 changes: 4 additions & 0 deletions libcudacxx/include/cuda/std/__cccl/compiler.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@
// Determine the host compiler and its version
#if defined(__INTEL_COMPILER)
# define _CCCL_COMPILER_ICC
# ifndef CCCL_SUPPRESS_ICC_DEPRECATION_WARNING
# warning \
"Support for the Intel C++ Compiler Classic is deprecated and will eventually be removed. Define CCCL_SUPPRESS_ICC_DEPRECATION_WARNING to suppress this warning"
# endif // CCCL_SUPPRESS_ICC_DEPRECATION_WARNING
#elif defined(__NVCOMPILER)
# define _CCCL_COMPILER_NVHPC
# define _CCCL_COMPILER_NVHPC_VERSION \
Expand Down
3 changes: 3 additions & 0 deletions libcudacxx/test/internal_headers/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,9 @@ function(libcudacxx_create_internal_header_test header_name, headertest_src, fal
target_compile_definitions(headertest_${header_name} PRIVATE "-D${fallback}")
endif()
target_compile_definitions(headertest_${header_name} PRIVATE "-DLIBCUDACXX_ENABLE_EXPERIMENTAL_MEMORY_RESOURCE")
if (CCCL_SUPPRESS_ICC_DEPRECATION_WARNING)
miscco marked this conversation as resolved.
Show resolved Hide resolved
target_compile_definitions(headertest_${header_name} PRIVATE CCCL_SUPPRESS_ICC_DEPRECATION_WARNING)
endif()

add_dependencies(libcudacxx.test.internal_headers headertest_${header_name})
endfunction()
Expand Down
4 changes: 4 additions & 0 deletions libcudacxx/test/libcudacxx/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,10 @@ if (${CMAKE_CXX_COMPILER_ID} STREQUAL "IntelLLVM" OR ${CMAKE_CXX_COMPILER_ID} ST
string(APPEND LIBCUDACXX_TEST_COMPILER_FLAGS " --compiler-options=-fno-fast-math")
endif()

if (CCCL_SUPPRESS_ICC_DEPRECATION_WARNING)
miscco marked this conversation as resolved.
Show resolved Hide resolved
string(APPEND LIBCUDACXX_TEST_COMPILER_FLAGS " -DCCCL_SUPPRESS_ICC_DEPRECATION_WARNING")
endif()

if (${CMAKE_CUDA_COMPILER_ID} STREQUAL "Clang")
string(APPEND LIBCUDACXX_TEST_COMPILER_FLAGS
" ${CMAKE_CUDA_FLAGS}"
Expand Down
3 changes: 3 additions & 0 deletions libcudacxx/test/public_headers/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,9 @@ function(libcudacxx_add_public_header_test header)
PRIVATE
${headertest_warning_levels_device}
-DLIBCUDACXX_ENABLE_EXPERIMENTAL_MEMORY_RESOURCE)
if (CCCL_SUPPRESS_ICC_DEPRECATION_WARNING)
miscco marked this conversation as resolved.
Show resolved Hide resolved
target_compile_definitions(headertest_${header_name} PRIVATE CCCL_SUPPRESS_ICC_DEPRECATION_WARNING)
endif()
target_compile_definitions(headertest_${header_name} PRIVATE CCCL_ENABLE_ASSERTIONS)

# Ensure that if this is an atomic header, we only include the right architectures
Expand Down
3 changes: 3 additions & 0 deletions libcudacxx/test/public_headers_host_only/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ function(libcudacxx_add_std_header_test header)
target_include_directories(headertest_std_${header_name} PRIVATE "${libcudacxx_SOURCE_DIR}/include")
target_compile_options(headertest_std_${header_name} PRIVATE ${headertest_warning_levels_host})
target_compile_definitions(headertest_std_${header_name} PRIVATE CCCL_ENABLE_ASSERTIONS)
if (CCCL_SUPPRESS_ICC_DEPRECATION_WARNING)
miscco marked this conversation as resolved.
Show resolved Hide resolved
target_compile_definitions(headertest_std_${header_name} PRIVATE CCCL_SUPPRESS_ICC_DEPRECATION_WARNING)
endif()

add_dependencies(libcudacxx.test.public_headers_host_only headertest_std_${header_name})
endfunction()
Expand Down
Loading