Use thrust functions instead of custom functions (#5544)

This commit is contained in:
Rory Mitchell
2020-04-16 21:41:16 +12:00
committed by GitHub
parent 6a169cd41a
commit e268fb0093
6 changed files with 82 additions and 306 deletions

View File

@@ -49,7 +49,9 @@ __global__ void CompressBinEllpackKernel(
int ncuts = cut_rows[feature + 1] - cut_rows[feature];
// Assigning the bin in current entry.
// S.t.: fvalue < feature_cuts[bin]
bin = dh::UpperBound(feature_cuts, ncuts, fvalue);
bin = thrust::upper_bound(thrust::seq, feature_cuts, feature_cuts + ncuts,
fvalue) -
feature_cuts;
if (bin >= ncuts) {
bin = ncuts - 1;
}