Home || Visual Search || Applications || Architecture || Important Messages || OGL || Src

template<class FType>
void Impala::Core::Vector::DoSlabHistogramIntersection ( FType *  C,
const FType *  A,
const FType *  B,
unsigned int  slabSizeA,
unsigned int  slabSizeB,
unsigned int  vectorSize 
) [inline]

Compute reference data set C = A * B.

Parameters:
C reference data, computed but preallocated
A matrix A as provided to device
B matrix B as provided to device
hA height of matrix A
wB width of matrix B

Definition at line 62 of file HistogramIntersection.h.

Referenced by Impala::Core::Training::ComputeKernelMatrix().

00065 {
00066     #pragma omp parallel for
00067     for (unsigned int a = 0; a < slabSizeA; a++)
00068     {
00069         for (unsigned int b = 0; b < slabSizeB; b++)
00070         {
00071             const FType* baseA = A + (a * vectorSize);
00072             const FType* baseB = B + (b * vectorSize);
00073             FType sum = 0;
00074             for (unsigned int k = 0; k < vectorSize; k++)
00075             {
00076                 if (baseA[k] < baseB[k])
00077                 {
00078                     sum += baseA[k];
00079                 }
00080                 else
00081                 {
00082                     sum += baseB[k];
00083                 }
00084             }
00085             C[b * slabSizeA + a] = (FType)sum;
00086         }
00087     }
00088 }


Generated on Thu Jan 13 09:21:36 2011 for ImpalaSrc by  doxygen 1.5.1