Get rid of a few trivial compiler warnings. (#4312)
This commit is contained in:
parent
ad4de0d718
commit
680a1b36f3
@ -624,7 +624,7 @@ XGB_DLL int XGDMatrixCreateFromDT(void** data, const char** feature_stypes,
|
|||||||
#pragma omp parallel num_threads(nthread)
|
#pragma omp parallel num_threads(nthread)
|
||||||
{
|
{
|
||||||
// Count elements per row, column by column
|
// Count elements per row, column by column
|
||||||
for (auto j = 0; j < ncol; ++j) {
|
for (auto j = 0u; j < ncol; ++j) {
|
||||||
DTType dtype = DTGetType(feature_stypes[j]);
|
DTType dtype = DTGetType(feature_stypes[j]);
|
||||||
#pragma omp for schedule(static)
|
#pragma omp for schedule(static)
|
||||||
for (omp_ulong i = 0; i < nrow; ++i) {
|
for (omp_ulong i = 0; i < nrow; ++i) {
|
||||||
|
|||||||
@ -81,12 +81,12 @@ float SparsePageDMatrix::GetColDensity(size_t cidx) {
|
|||||||
if (col_density_.empty()) {
|
if (col_density_.empty()) {
|
||||||
std::vector<size_t> column_size(this->Info().num_col_);
|
std::vector<size_t> column_size(this->Info().num_col_);
|
||||||
for (const auto &batch : this->GetColumnBatches()) {
|
for (const auto &batch : this->GetColumnBatches()) {
|
||||||
for (int i = 0; i < batch.Size(); i++) {
|
for (auto i = 0u; i < batch.Size(); i++) {
|
||||||
column_size[i] += batch[i].size();
|
column_size[i] += batch[i].size();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
col_density_.resize(column_size.size());
|
col_density_.resize(column_size.size());
|
||||||
for (int i = 0; i < col_density_.size(); i++) {
|
for (auto i = 0u; i < col_density_.size(); i++) {
|
||||||
size_t nmiss = this->Info().num_row_ - column_size[i];
|
size_t nmiss = this->Info().num_row_ - column_size[i];
|
||||||
col_density_[i] =
|
col_density_[i] =
|
||||||
1.0f - (static_cast<float>(nmiss)) / this->Info().num_row_;
|
1.0f - (static_cast<float>(nmiss)) / this->Info().num_row_;
|
||||||
|
|||||||
@ -331,7 +331,6 @@ class BaseMaker: public TreeUpdater {
|
|||||||
std::vector< std::vector<TStats> > *p_thread_temp,
|
std::vector< std::vector<TStats> > *p_thread_temp,
|
||||||
std::vector<TStats> *p_node_stats) {
|
std::vector<TStats> *p_node_stats) {
|
||||||
std::vector< std::vector<TStats> > &thread_temp = *p_thread_temp;
|
std::vector< std::vector<TStats> > &thread_temp = *p_thread_temp;
|
||||||
const MetaInfo &info = fmat.Info();
|
|
||||||
thread_temp.resize(omp_get_max_threads());
|
thread_temp.resize(omp_get_max_threads());
|
||||||
p_node_stats->resize(tree.param.num_nodes);
|
p_node_stats->resize(tree.param.num_nodes);
|
||||||
#pragma omp parallel
|
#pragma omp parallel
|
||||||
|
|||||||
@ -245,7 +245,6 @@ class ColMaker: public TreeUpdater {
|
|||||||
DMatrix *p_fmat,
|
DMatrix *p_fmat,
|
||||||
const std::vector<GradientPair> &gpair) {
|
const std::vector<GradientPair> &gpair) {
|
||||||
// TODO(tqchen): double check stats order.
|
// TODO(tqchen): double check stats order.
|
||||||
const MetaInfo& info = p_fmat->Info();
|
|
||||||
const bool ind = col.size() != 0 && col[0].fvalue == col[col.size() - 1].fvalue;
|
const bool ind = col.size() != 0 && col[0].fvalue == col[col.size() - 1].fvalue;
|
||||||
bool need_forward = param_.NeedForwardSearch(p_fmat->GetColDensity(fid), ind);
|
bool need_forward = param_.NeedForwardSearch(p_fmat->GetColDensity(fid), ind);
|
||||||
bool need_backward = param_.NeedBackwardSearch(p_fmat->GetColDensity(fid), ind);
|
bool need_backward = param_.NeedBackwardSearch(p_fmat->GetColDensity(fid), ind);
|
||||||
|
|||||||
@ -140,7 +140,7 @@ class SketchMaker: public BaseMaker {
|
|||||||
this->UpdateSketchCol(gpair, batch[fidx], tree,
|
this->UpdateSketchCol(gpair, batch[fidx], tree,
|
||||||
node_stats_,
|
node_stats_,
|
||||||
fidx,
|
fidx,
|
||||||
batch[fidx].size() == nrows,
|
static_cast<size_t>(batch[fidx].size()) == nrows,
|
||||||
&thread_sketch_[omp_get_thread_num()]);
|
&thread_sketch_[omp_get_thread_num()]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user