minor fix, add openmp

This commit is contained in:
Tianqi Chen 2014-08-26 20:02:10 -07:00
parent 9d2c1cf9f5
commit 3e5cb25830
3 changed files with 3 additions and 2 deletions

View File

@ -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<unsigned>(ndata-1) && i < ntop; ++i) {
const unsigned ridx = rec[i].second;
const float wt = info.weights[ridx];
if (info.labels[ridx] > 0.5f) {

View File

@ -169,7 +169,7 @@ class SoftmaxMultiClassObj : public IObjFunction {
std::vector<bst_gpair> &gpair = *out_gpair;
gpair.resize(preds.size());
const unsigned nstep = static_cast<unsigned>(info.labels.size() * nclass);
const unsigned ndata = static_cast<bst_omp_uint>(preds.size() / nclass);
const bst_omp_uint ndata = static_cast<bst_omp_uint>(preds.size() / nclass);
#pragma omp parallel
{
std::vector<float> rec(nclass);

View File

@ -99,6 +99,7 @@
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<OpenMPSupport>true</OpenMPSupport>
</ClCompile>
<Link>
<GenerateDebugInformation>true</GenerateDebugInformation>