Skip to content

Commit

Permalink
Fix compiler warnings. (#11226)
Browse files Browse the repository at this point in the history
  • Loading branch information
trivialfis authored Feb 10, 2025
1 parent 88c8d1a commit 178b49b
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 7 deletions.
1 change: 1 addition & 0 deletions src/collective/comm.h
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,7 @@ class Channel {
public:
explicit Channel(Comm const& comm, std::shared_ptr<TCPSocket> sock)
: sock_{std::move(sock)}, comm_{comm} {}
virtual ~Channel() = default;

[[nodiscard]] virtual Result SendAll(std::int8_t const* ptr, std::size_t n) {
Loop::Op op{Loop::Op::kWrite, comm_.Rank(), const_cast<std::int8_t*>(ptr), n, sock_.get(), 0};
Expand Down
1 change: 0 additions & 1 deletion src/common/ranking_utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,6 @@ bool IsBinaryRel(linalg::VectorView<float const> label, AllOf all_of) {
*/
template <typename AllOf>
void CheckPreLabels(StringView name, linalg::VectorView<float const> label, AllOf all_of) {
auto s_label = label.Values();
auto is_binary = IsBinaryRel(label, all_of);
CHECK(is_binary) << name << " can only be used with binary labels.";
}
Expand Down
10 changes: 4 additions & 6 deletions src/data/extmem_quantile_dmatrix.cc
Original file line number Diff line number Diff line change
Expand Up @@ -148,17 +148,15 @@ void ExtMemQuantileDMatrix::InitFromCUDA(
BatchSet<EllpackPage> ExtMemQuantileDMatrix::GetEllpackBatches(Context const *,
const BatchParam &) {
common::AssertGPUSupport();
auto batch_set =
std::visit([this](auto &&ptr) { return BatchSet{BatchIterator<EllpackPage>{ptr}}; },
this->ellpack_page_source_);
auto batch_set = std::visit([](auto &&ptr) { return BatchSet{BatchIterator<EllpackPage>{ptr}}; },
this->ellpack_page_source_);
return batch_set;
}

BatchSet<EllpackPage> ExtMemQuantileDMatrix::GetEllpackPageImpl() {
common::AssertGPUSupport();
auto batch_set =
std::visit([this](auto &&ptr) { return BatchSet{BatchIterator<EllpackPage>{ptr}}; },
this->ellpack_page_source_);
auto batch_set = std::visit([](auto &&ptr) { return BatchSet{BatchIterator<EllpackPage>{ptr}}; },
this->ellpack_page_source_);
return batch_set;
}
#endif
Expand Down

0 comments on commit 178b49b

Please sign in to comment.