GPU binning and compression. (#3319)

* GPU binning and compression.

- binning and index compression are done inside the DeviceShard constructor
- in case of a DMatrix with multiple row batches, it is first converted into a single row batch
This commit is contained in:
Andy Adinets
2018-06-05 07:15:13 +02:00
committed by Rory Mitchell
parent 3f7696ff53
commit 286dccb8e8
10 changed files with 302 additions and 67 deletions

View File

@@ -122,6 +122,14 @@ inline size_t AvailableMemory(int device_idx) {
return device_free;
}
inline size_t TotalMemory(int device_idx) {
size_t device_free = 0;
size_t device_total = 0;
safe_cuda(cudaSetDevice(device_idx));
dh::safe_cuda(cudaMemGetInfo(&device_free, &device_total));
return device_total;
}
/**
* \fn inline int max_shared_memory(int device_idx)
*
@@ -155,6 +163,12 @@ inline void CheckComputeCapability() {
}
}
DEV_INLINE void AtomicOrByte(unsigned int* __restrict__ buffer, size_t ibyte, unsigned char b) {
atomicOr(&buffer[ibyte / sizeof(unsigned int)], (unsigned int)b << (ibyte % (sizeof(unsigned int)) * 8));
}
/*
* Range iterator
*/