Skip to content

Commit 05fb56c

Browse files
authored
Reenable overflow builtins with nvc++ (#7414)
1 parent d871704 commit 05fb56c

File tree

2 files changed

+6
-8
lines changed

2 files changed

+6
-8
lines changed

libcudacxx/include/cuda/__numeric/add_overflow.h

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,10 @@
4848
# define _CCCL_BUILTIN_ADD_OVERFLOW(...) __builtin_add_overflow(__VA_ARGS__)
4949
#endif // _CCCL_CHECK_BUILTIN(builtin_add_overflow)
5050

51-
// nvc++ doesn't support 128-bit integers and crashes when certain type combinations are used (nvbug 5730860), so let's
52-
// just disable the builtin for now.
53-
#if _CCCL_COMPILER(NVHPC)
51+
// nvc++ < 26.1 doesn't support 128-bit integers and crashes when certain type combinations are used (nvbug 5730860).
52+
#if _CCCL_COMPILER(NVHPC, <, 26, 1)
5453
# undef _CCCL_BUILTIN_ADD_OVERFLOW
55-
#endif // _CCCL_COMPILER(NVHPC)
54+
#endif // _CCCL_COMPILER(NVHPC, <, 26, 1)
5655

5756
_CCCL_BEGIN_NAMESPACE_CUDA
5857

libcudacxx/include/cuda/__numeric/sub_overflow.h

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,10 @@
4646
# define _CCCL_BUILTIN_SUB_OVERFLOW(...) __builtin_sub_overflow(__VA_ARGS__)
4747
#endif // _CCCL_CHECK_BUILTIN(builtin_sub_overflow)
4848

49-
// nvc++ doesn't support 128-bit integers and crashes when certain type combinations are used (nvbug 5730860), so let's
50-
// just disable the builtin for now.
51-
#if _CCCL_COMPILER(NVHPC)
49+
// nvc++ < 26.1 doesn't support 128-bit integers and crashes when certain type combinations are used (nvbug 5730860).
50+
#if _CCCL_COMPILER(NVHPC, <, 26, 1)
5251
# undef _CCCL_BUILTIN_SUB_OVERFLOW
53-
#endif // _CCCL_COMPILER(NVHPC)
52+
#endif // _CCCL_COMPILER(NVHPC, <, 26, 1)
5453

5554
_CCCL_BEGIN_NAMESPACE_CUDA
5655

0 commit comments

Comments
 (0)