-
-
Notifications
You must be signed in to change notification settings - Fork 8.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Port R compatibility patches from 1.0.0 release branch #5577
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -831,7 +831,11 @@ void GHistIndexBlockMatrix::Init(const GHistIndexMatrix& gmat, | |
* \brief fill a histogram by zeros in range [begin, end) | ||
*/ | ||
void InitilizeHistByZeroes(GHistRow hist, size_t begin, size_t end) { | ||
#if defined(XGBOOST_STRICT_R_MODE) && XGBOOST_STRICT_R_MODE == 1 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could you run a small benchmark on this? You can call There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We can use in both cases: using FPType = decltype(tree::GradStats::sum_grad);
FPType* pdata = reinterpret_cast<FPType*>(hist.data());
std::fill_n(pdata + 2 * begin, 2 * (end-begin), 0); It should have the same perf as memset There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Let's come back to this after 1.1.0 release. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Tracking issue: #5579 |
||
std::fill(hist.begin() + begin, hist.begin() + end, tree::GradStats()); | ||
#else // defined(XGBOOST_STRICT_R_MODE) && XGBOOST_STRICT_R_MODE == 1 | ||
memset(hist.data() + begin, '\0', (end-begin)*sizeof(tree::GradStats)); | ||
#endif // defined(XGBOOST_STRICT_R_MODE) && XGBOOST_STRICT_R_MODE == 1 | ||
} | ||
|
||
/*! | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's wrong with our 32 bit build?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some of the unit tests will fail because 32-bit platform uses x87 unit, whereas 64-bit uses SSE. See #3723 for context. In the long run, we should re-design tests so that they work equally well on 32-bit and 64-bit systems.
Support for 32-bit systems is mandated by CRAN submission policy.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tracking issue: #5578