Skip to content

Commit

Permalink
Fix the use of constexpr in the dynamic batching header (#582)
Browse files Browse the repository at this point in the history
Remove the `constexpr` in a function that is non-constexpr according to the C++17 rules.

Authors:
  - Artem M. Chirkin (https://github.com/achirkin)

Approvers:
  - Bradley Dice (https://github.com/bdice)
  - Corey J. Nolet (https://github.com/cjnolet)

URL: #582
  • Loading branch information
achirkin authored Jan 16, 2025
1 parent 86b4ee8 commit b9f71fe
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions cpp/src/neighbors/detail/dynamic_batching.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -238,8 +238,8 @@ enum struct slot_state : int32_t {
struct batch_token {
uint64_t value = 0;

constexpr inline batch_token() {}
explicit constexpr inline batch_token(uint32_t buffer_id) { id() = buffer_id; }
constexpr inline batch_token() = default;
RAFT_INLINE_FUNCTION explicit batch_token(uint32_t buffer_id) { id() = buffer_id; }

/**
* Sequential id of the batch in the array of batches.
Expand Down Expand Up @@ -492,7 +492,7 @@ struct batch_queue_t {
* NB: "round" is the number of times the queue counters went over the whole ring buffer.
* It's used to avoid the ABA problem for atomic token updates.
*/
static constexpr inline auto make_empty_token(seq_order_id seq_id) noexcept -> batch_token
static inline auto make_empty_token(seq_order_id seq_id) noexcept -> batch_token
{
// Modify the seq_id to identify that the token slot is empty
auto empty_round = static_cast<uint32_t>(slot_state::kEmptyPast) * kSize;
Expand Down

0 comments on commit b9f71fe

Please sign in to comment.