Reduce span check overhead. (#5464)

This commit is contained in:
Jiaming Yuan
2020-04-01 22:07:24 +08:00
committed by GitHub
parent 15f40e51e9
commit babcb996e7
3 changed files with 50 additions and 43 deletions

View File

@@ -63,11 +63,11 @@ TEST(Transform, Exception) {
size_t const kSize {16};
std::vector<bst_float> h_in(kSize);
const HostDeviceVector<bst_float> in_vec{h_in, -1};
EXPECT_ANY_THROW({
EXPECT_DEATH({
Transform<>::Init([](size_t idx, common::Span<float const> _in) { _in[idx + 1]; },
Range(0, static_cast<Range::DifferenceType>(kSize)), -1)
.Eval(&in_vec);
});
}, "");
}
#endif