Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove some warnings from clang. #7533

Merged
merged 1 commit into from
Jan 4, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions include/xgboost/json_io.h
Original file line number Diff line number Diff line change
Expand Up @@ -115,12 +115,10 @@ class JsonReader {
class JsonWriter {
static constexpr size_t kIndentSize = 2;

size_t n_spaces_;
std::vector<char>* stream_;

public:
explicit JsonWriter(std::vector<char>* stream) :
n_spaces_{0}, stream_{stream} {}
explicit JsonWriter(std::vector<char>* stream) : stream_{stream} {}

virtual ~JsonWriter() = default;

Expand Down
2 changes: 1 addition & 1 deletion src/c_api/c_api_utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -165,9 +165,9 @@ inline float GetMissing(Json const &config) {

// Safe guard some global variables from being changed by XGBoost.
class XGBoostAPIGuard {
#if defined(XGBOOST_USE_CUDA)
int32_t device_id_ {0};

#if defined(XGBOOST_USE_CUDA)
void SetGPUAttribute();
void RestoreGPUAttribute();
#else
Expand Down
7 changes: 2 additions & 5 deletions src/tree/updater_quantile_hist.h
Original file line number Diff line number Diff line change
Expand Up @@ -166,11 +166,8 @@ class QuantileHistMaker: public TreeUpdater {
builder_monitor_.Init("Quantile::Builder");
}
// update one tree, growing
virtual void Update(const GHistIndexMatrix& gmat,
const ColumnMatrix& column_matrix,
HostDeviceVector<GradientPair>* gpair,
DMatrix* p_fmat,
RegTree* p_tree);
void Update(const GHistIndexMatrix& gmat, const ColumnMatrix& column_matrix,
HostDeviceVector<GradientPair>* gpair, DMatrix* p_fmat, RegTree* p_tree);

bool UpdatePredictionCache(const DMatrix* data,
linalg::VectorView<float> out_preds);
Expand Down