Fix Google test warnings and error (#2957)

This commit is contained in:
Rory Mitchell 2017-12-20 00:13:56 +13:00 committed by GitHub
parent 76f8f51438
commit 7759ab99ee
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 10 additions and 4 deletions

View File

@ -9,6 +9,7 @@
#include <dmlc/base.h>
#include <dmlc/omp.h>
#include <cmath>
#include <iostream>
/*!
* \brief string flag for R library, to leave hooks when needed.

View File

@ -15,6 +15,9 @@ TEST(gpu_predictor, Test) {
std::unique_ptr<Predictor> cpu_predictor =
std::unique_ptr<Predictor>(Predictor::Create("cpu_predictor"));
gpu_predictor->Init({}, {});
cpu_predictor->Init({}, {});
std::vector<std::unique_ptr<RegTree>> trees;
trees.push_back(std::unique_ptr<RegTree>(new RegTree()));
trees.back()->InitModel();

View File

@ -22,9 +22,10 @@ TEST(gpu_hist_experimental, TestSparseShard) {
hmat.Init(dmat.get(), max_bins);
gmat.cut = &hmat;
gmat.Init(dmat.get());
ncclComm_t comm;
TrainParam p;
p.max_depth = 6;
DeviceShard shard(0, 0, gmat, 0, rows, hmat.row_ptr.back(),
TrainParam());
p);
ASSERT_LT(shard.row_stride, columns);
@ -56,9 +57,10 @@ TEST(gpu_hist_experimental, TestDenseShard) {
hmat.Init(dmat.get(), max_bins);
gmat.cut = &hmat;
gmat.Init(dmat.get());
ncclComm_t comm;
TrainParam p;
p.max_depth = 6;
DeviceShard shard(0, 0, gmat, 0, rows, hmat.row_ptr.back(),
TrainParam());
p);
ASSERT_EQ(shard.row_stride, columns);