Clean up training code. (#3825)

* Remove GHistRow, GHistEntry, GHistIndexRow.
* Remove kSimpleStats.
* Remove CheckInfo, SetLeafVec in GradStats and in SKStats.
* Clean up the GradStats.
* Cleanup calcgain.
* Move LossChangeMissing out of common.
* Remove [] operator from GHistIndexBlock.
This commit is contained in:
Jiaming Yuan
2019-02-07 14:22:13 +08:00
committed by GitHub
parent 325b16bccd
commit 017c97b8ce
19 changed files with 306 additions and 406 deletions

View File

@@ -58,12 +58,12 @@ class Transform {
public:
Evaluator(Functor func, Range range, GPUSet devices, bool reshard) :
func_(func), range_{std::move(range)},
distribution_{std::move(GPUDistribution::Block(devices))},
reshard_{reshard} {}
reshard_{reshard},
distribution_{std::move(GPUDistribution::Block(devices))} {}
Evaluator(Functor func, Range range, GPUDistribution dist,
bool reshard) :
func_(func), range_{std::move(range)}, distribution_{std::move(dist)},
reshard_{reshard} {}
func_(func), range_{std::move(range)}, reshard_{reshard},
distribution_{std::move(dist)} {}
/*!
* \brief Evaluate the functor with input pointers to HostDeviceVector.
@@ -159,7 +159,7 @@ class Transform {
template <typename... HDV>
void LaunchCPU(Functor func, HDV*... vectors) const {
auto end = *(range_.end());
omp_ulong end = static_cast<omp_ulong>(*(range_.end()));
#pragma omp parallel for schedule(static)
for (omp_ulong idx = 0; idx < end; ++idx) {
func(idx, UnpackHDV(vectors)...);