From 3e5cb25830a40442a48224d01937a474ea97b2e8 Mon Sep 17 00:00:00 2001 From: Tianqi Chen Date: Tue, 26 Aug 2014 20:02:10 -0700 Subject: [PATCH] minor fix, add openmp --- src/learner/evaluation-inl.hpp | 2 +- src/learner/objective-inl.hpp | 2 +- windows/xgboost/xgboost.vcxproj | 1 + 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/learner/evaluation-inl.hpp b/src/learner/evaluation-inl.hpp index d5cb9fc36..0b73ec1e1 100644 --- a/src/learner/evaluation-inl.hpp +++ b/src/learner/evaluation-inl.hpp @@ -123,7 +123,7 @@ struct EvalAMS : public IEvaluator { const double br = 10.0; unsigned thresindex = 0; double s_tp = 0.0, b_fp = 0.0, tams = 0.0; - for (unsigned i = 0; i < ndata-1 && i < ntop; ++i) { + for (unsigned i = 0; i < static_cast(ndata-1) && i < ntop; ++i) { const unsigned ridx = rec[i].second; const float wt = info.weights[ridx]; if (info.labels[ridx] > 0.5f) { diff --git a/src/learner/objective-inl.hpp b/src/learner/objective-inl.hpp index 02c896274..0e6b5ec7d 100644 --- a/src/learner/objective-inl.hpp +++ b/src/learner/objective-inl.hpp @@ -169,7 +169,7 @@ class SoftmaxMultiClassObj : public IObjFunction { std::vector &gpair = *out_gpair; gpair.resize(preds.size()); const unsigned nstep = static_cast(info.labels.size() * nclass); - const unsigned ndata = static_cast(preds.size() / nclass); + const bst_omp_uint ndata = static_cast(preds.size() / nclass); #pragma omp parallel { std::vector rec(nclass); diff --git a/windows/xgboost/xgboost.vcxproj b/windows/xgboost/xgboost.vcxproj index 064dd6ee6..8b88dbf2e 100644 --- a/windows/xgboost/xgboost.vcxproj +++ b/windows/xgboost/xgboost.vcxproj @@ -99,6 +99,7 @@ MaxSpeed true true + true true