Make C++ unit tests run and pass on Windows (#3869)

* Make C++ unit tests run and pass on Windows

* Fix logic for external memory. The letter ':' is part of drive letter,
so remove the drive letter before splitting on ':'.
* Cosmetic syntax changes to keep MSVC happy.

* Fix lint

* Add Windows guard
This commit is contained in:
Philip Hyunsu Cho
2018-11-06 17:17:24 -08:00
committed by GitHub
parent d9642cf757
commit 2b045aa805
6 changed files with 67 additions and 41 deletions

View File

@@ -50,7 +50,9 @@ TEST(Transform, DeclareUnifiedTest(Basic)) {
HostDeviceVector<bst_float> out_vec{h_out, TRANSFORM_GPU_DIST};
out_vec.Fill(0);
Transform<>::Init(TestTransformRange<bst_float>{}, Range{0, size}, TRANSFORM_GPU_RANGE)
Transform<>::Init(TestTransformRange<bst_float>{},
Range{0, static_cast<Range::DifferenceType>(size)},
TRANSFORM_GPU_RANGE)
.Eval(&out_vec, &in_vec);
std::vector<bst_float> res = out_vec.HostVector();