Repository navigation
Add __int128 and __float128 detection macros
#3413
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
Merged
+169
−44
Merged
Changes from all commits
Commits
Show all changes
35 commits
Select commit
Hold shift + click to select a range
0808605
adding int128 and float128 detection macros
fbusato 24e5f78
document new macros
fbusato 12664e3
fix missing preprocessing paths
fbusato ab8f299
improve documentation
fbusato e1b0189
move macro tests in libcxx directory
fbusato 06ba0b0
Merge branch 'main' into 128bit-types-macro
fbusato 377c7f6
add negative tests
fbusato d767bb4
add static_assert to negative tests
fbusato d1ad8e8
fix nvrtc test case
fbusato 6290337
rename to extend_data_types.h
fbusato 46f4eb2
fix conflict
fbusato 3ec64ba
Merge branch 'main' into 128bit-types-macro
fbusato be5d7db
move _CCCL_HAS_NVFP8 to extended data types
fbusato ac4ecc5
unify extended data type tests
fbusato 9168c04
split failing test cases
fbusato a21ec9a
__SIZEOF_INT128__ not defined with NVRTC
fbusato 8a2c5a7
workaround for nvrtc compiler bug
fbusato 76cd412
Update libcudacxx/include/cuda/std/__cccl/extended_data_types.h
fbusato bf0e1fa
Update libcudacxx/test/libcudacxx/libcxx/macros/extended_data_types.f…
fbusato 6300bbd
Update libcudacxx/include/cuda/std/__cccl/extended_data_types.h
fbusato 48fdc55
Update libcudacxx/include/cuda/std/__cccl/extended_data_types.h
fbusato e057cfa
improve float128 detection
fbusato 603f8b7
sync extended_floating_point.h
fbusato cfcb682
Merge branch 'main' into 128bit-types-macro
fbusato 6b1e89f
delete extended_floating_point.h
fbusato 6837252
revert bf16, fp16 conditions for fp8
fbusato 1d6c905
add nvrtc support for float128
fbusato f973dcc
Merge branch 'main' into 128bit-types-macro
fbusato da06349
Disable float128 with nvc++
fbusato 7241464
fix nvc++ float128 detection on device code
fbusato d77c768
sync macro.rst
fbusato 1d996e4
Merge branch 'main' into 128bit-types-macro
fbusato ebba451
improve fp8 docs
fbusato 738bd66
Update libcudacxx/include/cuda/std/__cccl/extended_data_types.h
fbusato e52f7a3
Merge branch 'main' into 128bit-types-macro
fbusato File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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
File renamed without changes.
This file contains hidden or 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
23 changes: 23 additions & 0 deletions
23
libcudacxx/test/libcudacxx/libcxx/macros/extended_data_types.fp128.fail.cpp
This file contains hidden or 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,23 @@ | ||
| //===----------------------------------------------------------------------===// | ||
| // | ||
| // 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) 2025 NVIDIA CORPORATION & AFFILIATES. | ||
| // | ||
| //===----------------------------------------------------------------------===// | ||
| #include <cuda/std/__cccl/extended_data_types.h> | ||
|
|
||
| #include "test_macros.h" | ||
|
|
||
| int main(int, char**) | ||
| { | ||
| #if !_CCCL_HAS_FLOAT128() | ||
| __float128 x4 = __float128(3.14) + __float128(3.14); | ||
| unused(x4); | ||
| #else | ||
| static_assert(false); | ||
| #endif | ||
| return 0; | ||
| } |
26 changes: 26 additions & 0 deletions
26
libcudacxx/test/libcudacxx/libcxx/macros/extended_data_types.fp16.fail.cpp
This file contains hidden or 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,26 @@ | ||
| //===----------------------------------------------------------------------===// | ||
| // | ||
| // Part of the LLVM Project, 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) 2025 NVIDIA CORPORATION & AFFILIATES. | ||
| // | ||
| //===----------------------------------------------------------------------===// | ||
| #include <cuda/std/__cccl/extended_data_types.h> | ||
|
|
||
| #include "test_macros.h" | ||
|
|
||
| #if !defined(_CCCL_HAS_NVFP16) | ||
| # include <cuda_fp16.h> | ||
| #endif | ||
|
|
||
| int main(int, char**) | ||
| { | ||
| #if !defined(_CCCL_HAS_NVFP16) | ||
| auto x2 = __half(1.0f); | ||
| unused(x2); | ||
| #else | ||
| static_assert(false); | ||
| #endif | ||
| return 0; | ||
| } |
26 changes: 26 additions & 0 deletions
26
libcudacxx/test/libcudacxx/libcxx/macros/extended_data_types.fp8.fail.cpp
This file contains hidden or 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,26 @@ | ||
| //===----------------------------------------------------------------------===// | ||
| // | ||
| // Part of the LLVM Project, 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) 2025 NVIDIA CORPORATION & AFFILIATES. | ||
| // | ||
| //===----------------------------------------------------------------------===// | ||
| #include <cuda/std/__cccl/extended_data_types.h> | ||
|
|
||
| #include "test_macros.h" | ||
|
|
||
| #if !_CCCL_HAS_NVFP8() | ||
| # include <cuda_fp8.h> | ||
| #endif | ||
|
|
||
| int main(int, char**) | ||
| { | ||
| #if !_CCCL_HAS_NVFP8() | ||
| auto x1 = __nv_fp8_e4m3(1.0f); | ||
| unused(x1); | ||
| #else | ||
| static_assert(false); | ||
| #endif | ||
| return 0; | ||
| } |
24 changes: 24 additions & 0 deletions
24
libcudacxx/test/libcudacxx/libcxx/macros/extended_data_types.i128.fail.cpp
This file contains hidden or 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,24 @@ | ||
| //===----------------------------------------------------------------------===// | ||
| // | ||
| // Part of the LLVM Project, 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) 2025 NVIDIA CORPORATION & AFFILIATES. | ||
| // | ||
| //===----------------------------------------------------------------------===// | ||
| #include <cuda/std/__cccl/extended_data_types.h> | ||
|
|
||
| #include "test_macros.h" | ||
|
|
||
| int main(int, char**) | ||
| { | ||
| #if !_CCCL_HAS_INT128() | ||
| __int128 x = __int128(123456789123) + __int128(123456789123); | ||
| __uint128_t y = __uint128_t(123456789123) + __uint128_t(123456789123); | ||
| unused(x); | ||
| unused(y); | ||
| #else | ||
| static_assert(false); | ||
| #endif | ||
| return 0; | ||
| } |
This file contains hidden or 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
File renamed without changes.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.