Fix Google test warnings and error (#2957)
This commit is contained in:
parent
76f8f51438
commit
7759ab99ee
@ -9,6 +9,7 @@
|
|||||||
#include <dmlc/base.h>
|
#include <dmlc/base.h>
|
||||||
#include <dmlc/omp.h>
|
#include <dmlc/omp.h>
|
||||||
#include <cmath>
|
#include <cmath>
|
||||||
|
#include <iostream>
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* \brief string flag for R library, to leave hooks when needed.
|
* \brief string flag for R library, to leave hooks when needed.
|
||||||
|
|||||||
@ -15,6 +15,9 @@ TEST(gpu_predictor, Test) {
|
|||||||
std::unique_ptr<Predictor> cpu_predictor =
|
std::unique_ptr<Predictor> cpu_predictor =
|
||||||
std::unique_ptr<Predictor>(Predictor::Create("cpu_predictor"));
|
std::unique_ptr<Predictor>(Predictor::Create("cpu_predictor"));
|
||||||
|
|
||||||
|
gpu_predictor->Init({}, {});
|
||||||
|
cpu_predictor->Init({}, {});
|
||||||
|
|
||||||
std::vector<std::unique_ptr<RegTree>> trees;
|
std::vector<std::unique_ptr<RegTree>> trees;
|
||||||
trees.push_back(std::unique_ptr<RegTree>(new RegTree()));
|
trees.push_back(std::unique_ptr<RegTree>(new RegTree()));
|
||||||
trees.back()->InitModel();
|
trees.back()->InitModel();
|
||||||
|
|||||||
@ -22,9 +22,10 @@ TEST(gpu_hist_experimental, TestSparseShard) {
|
|||||||
hmat.Init(dmat.get(), max_bins);
|
hmat.Init(dmat.get(), max_bins);
|
||||||
gmat.cut = &hmat;
|
gmat.cut = &hmat;
|
||||||
gmat.Init(dmat.get());
|
gmat.Init(dmat.get());
|
||||||
ncclComm_t comm;
|
TrainParam p;
|
||||||
|
p.max_depth = 6;
|
||||||
DeviceShard shard(0, 0, gmat, 0, rows, hmat.row_ptr.back(),
|
DeviceShard shard(0, 0, gmat, 0, rows, hmat.row_ptr.back(),
|
||||||
TrainParam());
|
p);
|
||||||
|
|
||||||
ASSERT_LT(shard.row_stride, columns);
|
ASSERT_LT(shard.row_stride, columns);
|
||||||
|
|
||||||
@ -56,9 +57,10 @@ TEST(gpu_hist_experimental, TestDenseShard) {
|
|||||||
hmat.Init(dmat.get(), max_bins);
|
hmat.Init(dmat.get(), max_bins);
|
||||||
gmat.cut = &hmat;
|
gmat.cut = &hmat;
|
||||||
gmat.Init(dmat.get());
|
gmat.Init(dmat.get());
|
||||||
ncclComm_t comm;
|
TrainParam p;
|
||||||
|
p.max_depth = 6;
|
||||||
DeviceShard shard(0, 0, gmat, 0, rows, hmat.row_ptr.back(),
|
DeviceShard shard(0, 0, gmat, 0, rows, hmat.row_ptr.back(),
|
||||||
TrainParam());
|
p);
|
||||||
|
|
||||||
ASSERT_EQ(shard.row_stride, columns);
|
ASSERT_EQ(shard.row_stride, columns);
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user