-
Notifications
You must be signed in to change notification settings - Fork 185
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move cccl global logic into a
__cccl_config
We just reused the libcu++ config, but going forward we want to move more common parts into a unified config.
- Loading branch information
Showing
10 changed files
with
82 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
//===----------------------------------------------------------------------===// | ||
// | ||
// Part of libcu++, the C++ Standard Library for your entire system, | ||
// under the Apache License v2.0 with LLVM Exceptions. | ||
// See https://llvm.org/LICENSE.txt for license information. | ||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | ||
// SPDX-FileCopyrightText: Copyright (c) 2023 NVIDIA CORPORATION & AFFILIATES. | ||
// | ||
//===----------------------------------------------------------------------===// | ||
|
||
#ifndef _CUDA__CCCL_CONFIG | ||
#define _CUDA__CCCL_CONFIG | ||
|
||
#include "std/detail/libcxx/include/__cccl_config" | ||
|
||
#endif // _CUDA__CCCL_CONFIG |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
55 changes: 55 additions & 0 deletions
55
libcudacxx/include/cuda/std/detail/libcxx/include/__cccl_config
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
//===----------------------------------------------------------------------===// | ||
// | ||
// Part of libcu++, the C++ Standard Library for your entire system, | ||
// under the Apache License v2.0 with LLVM Exceptions. | ||
// See https://llvm.org/LICENSE.txt for license information. | ||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | ||
// SPDX-FileCopyrightText: Copyright (c) 2023 NVIDIA CORPORATION & AFFILIATES. | ||
// | ||
//===----------------------------------------------------------------------===// | ||
|
||
#ifndef __CCCL_CONFIG | ||
#define __CCCL_CONFIG | ||
|
||
// Determine the host compiler | ||
#if defined(__NVCOMPILER) | ||
# define _CCCL_COMPILER_NVHPC | ||
#elif defined(__clang__) | ||
# define _CCCL_COMPILER_CLANG | ||
#elif defined(__GNUC__) | ||
# define _CCCL_COMPILER_GCC | ||
#elif defined(_MSC_VER) | ||
# define _CCCL_COMPILER_MSVC | ||
#elif defined(__IBMCPP__) | ||
# define _CCCL_COMPILER_IBM | ||
#elif defined(__CUDACC_RTC__) | ||
# define _CCCL_COMPILER_NVRTC | ||
#endif | ||
|
||
// Ensure cccl headers are treated as system headers when possible | ||
#if defined(_CCCL_NO_SYSTEM_HEADER) | ||
# define _CCCL_IMPLICIT_SYSTEM_HEADER | ||
#elif defined(_CCCL_COMPILER_MSVC) \ | ||
&& defined(_LIBCUDACXX_DISABLE_PRAGMA_MSVC_WARNING) | ||
# define _CCCL_IMPLICIT_SYSTEM_HEADER | ||
#elif defined(_CCCL_COMPILER_NVRTC) | ||
# define _CCCL_IMPLICIT_SYSTEM_HEADER | ||
#elif defined(_LIBCUDACXX_DISABLE_PRAGMA_GCC_SYSTEM_HEADER) | ||
# define _CCCL_IMPLICIT_SYSTEM_HEADER | ||
#else | ||
# if defined(_CCCL_COMPILER_GCC) | ||
# define _CCCL_IMPLICIT_SYSTEM_HEADER _Pragma("GCC system_header") | ||
# elif defined(_CCCL_COMPILER_CLANG) | ||
# define _CCCL_IMPLICIT_SYSTEM_HEADER _Pragma("clang system_header") | ||
# elif defined(_CCCL_COMPILER_MSVC) | ||
# define _CCCL_IMPLICIT_SYSTEM_HEADER __pragma(system_header) | ||
# elif defined(_CCCL_COMPILER_NVHPC) | ||
# define _CCCL_IMPLICIT_SYSTEM_HEADER _Pragma("GCC system_header") | ||
# else | ||
# define _CCCL_IMPLICIT_SYSTEM_HEADER | ||
# endif | ||
#endif | ||
|
||
_CCCL_IMPLICIT_SYSTEM_HEADER | ||
|
||
#endif // __CCCL_CONFIG |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters