Skip to content

Commit fadb547

Browse files
committed
Fix clang-tidy
Signed-off-by: Sebastian Berg <sebastianb@nvidia.com>
1 parent 70d0b8d commit fadb547

2 files changed

Lines changed: 5 additions & 3 deletions

File tree

src/models/tree/build_tree.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -281,8 +281,8 @@ struct TreeBuilder {
281281

282282
// NCCL cannot allreduce custom types, need to reinterpret as double
283283
SumAllReduce(context,
284-
// NOLINTNEXTLINE(cppcoreguidelines-pro-type-reinterpret-cast)
285284
cuda::std::span<double>(
285+
// NOLINTNEXTLINE(cppcoreguidelines-pro-type-reinterpret-cast)
286286
reinterpret_cast<double*>(histogram.Ptr(batch.node_idx_begin)),
287287
batch.NodesInBatch() * num_outputs * split_proposals.HistogramSize() * 2));
288288
this->Scan(histogram, batch, tree);

src/models/tree/build_tree.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ class SparseSplitProposals {
175175
// Returns the bin index for a given feature and value
176176
// If the value is not in the split proposals, -1 is returned
177177
#ifdef __CUDACC__
178-
__device__ auto FindBin(T x, int feature) const -> int
178+
[[nodiscard]] __device__ auto FindBin(T x, int feature) const -> int
179179
{
180180
const auto begin = split_proposals.begin() + row_pointers[feature];
181181
const auto end = split_proposals.begin() + row_pointers[feature + 1];
@@ -190,7 +190,9 @@ class SparseSplitProposals {
190190
// This could potentially be specialised for the 256 items case
191191
// https://blog.demofox.org/2017/06/20/simd-gpu-friendly-branchless-binary-search/
192192
template <class ForwardIt>
193-
constexpr ForwardIt branchless_lower_bound(ForwardIt first, ForwardIt last, const T& value) const
193+
[[nodiscard]] constexpr ForwardIt branchless_lower_bound(ForwardIt first,
194+
ForwardIt last,
195+
const T& value) const
194196
{
195197
int n = last - first;
196198
ForwardIt base = first;

0 commit comments

Comments
 (0)