Skip to content

Commit

Permalink
check
Browse files Browse the repository at this point in the history
  • Loading branch information
ShvetsKS committed Apr 30, 2020
1 parent cc66e89 commit 3ba5362
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
8 changes: 4 additions & 4 deletions src/common/hist_util.cc
Original file line number Diff line number Diff line change
Expand Up @@ -842,7 +842,7 @@ void InitilizeHistByZeroes(GHistRow hist, size_t begin, size_t end) {
* \brief Increment hist as dst += add in range [begin, end)
*/
void IncrementHist(GHistRow dst, const GHistRow add, size_t begin, size_t end) {
using FPType = decltype(tree::GradStats::sum_grad);//GradStatHist::ValueT;
using FPType = decltype(tree::GradStats::sum_grad); // GradStatHist::ValueT;
FPType* pdst = reinterpret_cast<FPType*>(dst.data());
const FPType* padd = reinterpret_cast<const FPType*>(add.data());

Expand All @@ -855,7 +855,7 @@ void IncrementHist(GHistRow dst, const GHistRow add, size_t begin, size_t end) {
* \brief Copy hist from src to dst in range [begin, end)
*/
void CopyHist(GHistRow dst, const GHistRow src, size_t begin, size_t end) {
using FPType = decltype(tree::GradStats::sum_grad);//GradStatHist::ValueT;
using FPType = decltype(tree::GradStats::sum_grad); // GradStatHist::ValueT;
FPType* pdst = reinterpret_cast<FPType*>(dst.data());
const FPType* psrc = reinterpret_cast<const FPType*>(src.data());

Expand All @@ -869,7 +869,7 @@ void CopyHist(GHistRow dst, const GHistRow src, size_t begin, size_t end) {
*/
void SubtractionHist(GHistRow dst, const GHistRow src1, const GHistRow src2,
size_t begin, size_t end) {
using FPType = decltype(tree::GradStats::sum_grad);//GradStatHist::ValueT;
using FPType = decltype(tree::GradStats::sum_grad); // GradStatHist::ValueT;
FPType* pdst = reinterpret_cast<FPType*>(dst.data());
const FPType* psrc1 = reinterpret_cast<const FPType*>(src1.data());
const FPType* psrc2 = reinterpret_cast<const FPType*>(src2.data());
Expand Down Expand Up @@ -1027,7 +1027,7 @@ void GHistBuilder::BuildHist(const std::vector<GradientPair>& gpair,
const GHistIndexMatrix& gmat,
GHistRow hist,
bool isDense) {
using FPType = decltype(tree::GradStats::sum_grad);//GradStatHist::ValueT;
using FPType = decltype(tree::GradStats::sum_grad); // GradStatHist::ValueT;
const size_t nrows = row_indices.Size();
const size_t no_prefetch_size = Prefetch::NoPrefetchSize(nrows);

Expand Down
12 changes: 6 additions & 6 deletions src/tree/updater_quantile_hist.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1077,7 +1077,7 @@ void QuantileHistMaker::Builder::InitNewNode(int nid,
{
auto& stats = snode_[nid].stats;
GHistRow hist = hist_[nid];
//common::GradStatHist grad_stat;
// common::GradStatHist grad_stat;
if (tree[nid].IsRoot()) {
if (data_layout_ == kDenseDataZeroBased || data_layout_ == kDenseDataOneBased) {
const std::vector<uint32_t>& row_ptr = gmat.cut.Ptrs();
Expand All @@ -1087,19 +1087,19 @@ void QuantileHistMaker::Builder::InitNewNode(int nid,
for (uint32_t i = ibegin; i < iend; ++i) {
const GradStats et = begin[i];
stats.Add(et.sum_grad, et.sum_hess);
//const common::GradStatHist et = begin[i];
//grad_stat.Add(et.GetGrad(), et.GetHess());
// const common::GradStatHist et = begin[i];
// grad_stat.Add(et.GetGrad(), et.GetHess());
}
} else {
const RowSetCollection::Elem e = row_set_collection_[nid];
for (const size_t* it = e.begin; it < e.end; ++it) {
stats.Add(gpair[*it]);
//grad_stat.Add(gpair[*it]);
// grad_stat.Add(gpair[*it]);
}
}
histred_.Allreduce(&snode_[nid].stats, 1);
//histred_.Allreduce(&grad_stat, 1);
//snode_[nid].stats = tree::GradStats(grad_stat.GetGrad(), grad_stat.GetHess());
// histred_.Allreduce(&grad_stat, 1);
// snode_[nid].stats = tree::GradStats(grad_stat.GetGrad(), grad_stat.GetHess());
} else {
int parent_id = tree[nid].Parent();
if (tree[nid].IsLeftChild()) {
Expand Down

0 comments on commit 3ba5362

Please sign in to comment.