From 552e99f9598877f97f4b95bfb56e618daaa1fd6a Mon Sep 17 00:00:00 2001 From: Colin Heinzmann Date: Mon, 25 Apr 2016 07:15:34 -0400 Subject: [PATCH] fixed PCA disagreement --- openbr/plugins/cuda/cudapca.cu | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/openbr/plugins/cuda/cudapca.cu b/openbr/plugins/cuda/cudapca.cu index cc877ce..bc21a86 100644 --- a/openbr/plugins/cuda/cudapca.cu +++ b/openbr/plugins/cuda/cudapca.cu @@ -60,12 +60,13 @@ namespace br { namespace cuda { namespace pca { return; } + if (numSteps*stepSize+evIdx >= numEigenvectors) { + numSteps--; + } + float acc = 0; for (int i=0; i < numSteps; i++) { int ibIdx = i*stepSize + evIdx; - if (ibIdx >= numSteps*stepSize) { - break; - } acc += intermediaryBuffer[ibIdx]; } -- libgit2 0.21.4