Skip to content

Commit f7fcf6f

Browse files
authored
Deprecate cuda::std::rel_ops in c++20 (#8029)
1 parent 3ed7d1b commit f7fcf6f

File tree

3 files changed

+8
-24
lines changed

3 files changed

+8
-24
lines changed

cudax/include/cuda/experimental/__execution/completion_behavior.cuh

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -50,24 +50,6 @@ enum class _CCCL_TYPE_VISIBILITY_DEFAULT completion_behavior : int
5050
///< `start()`.
5151
};
5252

53-
#if _LIBCUDACXX_HAS_SPACESHIP_OPERATOR()
54-
[[nodiscard]] _CCCL_API constexpr auto operator<=>(completion_behavior __a, completion_behavior __b) noexcept
55-
-> ::cuda::std::strong_ordering
56-
{
57-
return static_cast<int>(__a) <=> static_cast<int>(__b);
58-
}
59-
#else
60-
[[nodiscard]] _CCCL_API constexpr auto operator<(completion_behavior __a, completion_behavior __b) noexcept -> bool
61-
{
62-
return static_cast<int>(__a) < static_cast<int>(__b);
63-
}
64-
[[nodiscard]] _CCCL_API constexpr auto operator==(completion_behavior __a, completion_behavior __b) noexcept -> bool
65-
{
66-
return static_cast<int>(__a) == static_cast<int>(__b);
67-
}
68-
using namespace ::cuda::std::rel_ops;
69-
#endif
70-
7153
template <completion_behavior _CB>
7254
using __constant_t = ::cuda::std::integral_constant<completion_behavior, _CB>;
7355

libcudacxx/include/cuda/std/__utility/rel_ops.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
44
// See https://llvm.org/LICENSE.txt for license information.
55
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6-
// SPDX-FileCopyrightText: Copyright (c) 2023 NVIDIA CORPORATION & AFFILIATES.
6+
// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES.
77
//
88
//===----------------------------------------------------------------------===//
99

@@ -30,25 +30,25 @@ _CCCL_BEGIN_NAMESPACE_CUDA_STD
3030
namespace rel_ops
3131
{
3232
template <class _Tp>
33-
_CCCL_API inline bool operator!=(const _Tp& __x, const _Tp& __y)
33+
[[nodiscard]] _CCCL_DEPRECATED_IN_CXX20 _CCCL_API inline bool operator!=(const _Tp& __x, const _Tp& __y)
3434
{
3535
return !(__x == __y);
3636
}
3737

3838
template <class _Tp>
39-
_CCCL_API inline bool operator>(const _Tp& __x, const _Tp& __y)
39+
[[nodiscard]] _CCCL_DEPRECATED_IN_CXX20 _CCCL_API inline bool operator>(const _Tp& __x, const _Tp& __y)
4040
{
4141
return __y < __x;
4242
}
4343

4444
template <class _Tp>
45-
_CCCL_API inline bool operator<=(const _Tp& __x, const _Tp& __y)
45+
[[nodiscard]] _CCCL_DEPRECATED_IN_CXX20 _CCCL_API inline bool operator<=(const _Tp& __x, const _Tp& __y)
4646
{
4747
return !(__y < __x);
4848
}
4949

5050
template <class _Tp>
51-
_CCCL_API inline bool operator>=(const _Tp& __x, const _Tp& __y)
51+
[[nodiscard]] _CCCL_DEPRECATED_IN_CXX20 _CCCL_API inline bool operator>=(const _Tp& __x, const _Tp& __y)
5252
{
5353
return !(__x < __y);
5454
}

libcudacxx/test/libcudacxx/std/utilities/utility/operators/rel_ops.pass.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@
77
//
88
//===----------------------------------------------------------------------===//
99

10-
// test rel_ops
10+
// ADDITIONAL_COMPILE_DEFINITIONS: CCCL_IGNORE_DEPRECATED_API
11+
12+
// test rel_ops, deprecated in c++20
1113

1214
#include <cuda/std/cassert>
1315
#include <cuda/std/utility>

0 commit comments

Comments
 (0)