Modify caching allocator/vector and fix issues relating to inability to train large datasets (#4615)

This commit is contained in:
sriramch
2019-07-08 23:33:27 -07:00
committed by Rory Mitchell
parent cd1526d3b1
commit 7a388cbf8b
5 changed files with 22 additions and 18 deletions

View File

@@ -11,15 +11,16 @@ namespace tree {
void TestSortPosition(const std::vector<int>& position_in, int left_idx,
int right_idx) {
dh::safe_cuda(cudaSetDevice(0));
std::vector<int64_t> left_count = {
std::count(position_in.begin(), position_in.end(), left_idx)};
thrust::device_vector<int64_t> d_left_count = left_count;
thrust::device_vector<int> position = position_in;
thrust::device_vector<int> position_out(position.size());
dh::caching_device_vector<int64_t> d_left_count = left_count;
dh::caching_device_vector<int> position = position_in;
dh::caching_device_vector<int> position_out(position.size());
thrust::device_vector<RowPartitioner::RowIndexT> ridx(position.size());
dh::caching_device_vector<RowPartitioner::RowIndexT> ridx(position.size());
thrust::sequence(ridx.begin(), ridx.end());
thrust::device_vector<RowPartitioner::RowIndexT> ridx_out(ridx.size());
dh::caching_device_vector<RowPartitioner::RowIndexT> ridx_out(ridx.size());
RowPartitioner rp(0,10);
rp.SortPosition(
common::Span<int>(position.data().get(), position.size()),