Fix compilation on Mac OSX High Sierra (10.13) (#5597)

* Fix compilation on Mac OSX High Sierra

* [CI] Build Mac OSX binary wheel using Travis CI
This commit is contained in:
Philip Hyunsu Cho
2020-04-25 10:53:03 -07:00
committed by GitHub
parent e726dd9902
commit f68155de6c
5 changed files with 33 additions and 9 deletions

View File

@@ -56,8 +56,7 @@ class AFTObj : public ObjFunction {
const omp_ulong nsize = static_cast<omp_ulong>(yhat.size());
const float aft_loss_distribution_scale = param_.aft_loss_distribution_scale;
#pragma omp parallel for default(none) \
firstprivate(nsize, is_null_weight, aft_loss_distribution_scale) \
#pragma omp parallel for \
shared(weights, y_lower, y_upper, yhat, gpair)
for (omp_ulong i = 0; i < nsize; ++i) {
// If weights are empty, data is unweighted so we use 1.0 everywhere
@@ -74,7 +73,7 @@ class AFTObj : public ObjFunction {
// Trees give us a prediction in log scale, so exponentiate
std::vector<bst_float> &preds = io_preds->HostVector();
const long ndata = static_cast<long>(preds.size()); // NOLINT(*)
#pragma omp parallel for default(none) firstprivate(ndata) shared(preds)
#pragma omp parallel for shared(preds)
for (long j = 0; j < ndata; ++j) { // NOLINT(*)
preds[j] = std::exp(preds[j]);
}