|
|
|
@ -245,11 +245,12 @@ static void matchDispatcher(const oclMat &query, const oclMat &train, const oclM |
|
|
|
|
{ |
|
|
|
|
const oclMat zeroMask; |
|
|
|
|
const oclMat &tempMask = mask.data ? mask : zeroMask; |
|
|
|
|
bool is_cpu = queryDeviceInfo<IS_CPU_DEVICE, bool>(); |
|
|
|
|
if (query.cols <= 64) |
|
|
|
|
{ |
|
|
|
|
matchUnrolledCached<16, 64>(query, train, tempMask, trainIdx, distance, distType); |
|
|
|
|
} |
|
|
|
|
else if (query.cols <= 128) |
|
|
|
|
else if (query.cols <= 128 && !is_cpu) |
|
|
|
|
{ |
|
|
|
|
matchUnrolledCached<16, 128>(query, train, tempMask, trainIdx, distance, distType); |
|
|
|
|
} |
|
|
|
@ -264,11 +265,12 @@ static void matchDispatcher(const oclMat &query, const oclMat *trains, int n, co |
|
|
|
|
{ |
|
|
|
|
const oclMat zeroMask; |
|
|
|
|
const oclMat &tempMask = mask.data ? mask : zeroMask; |
|
|
|
|
bool is_cpu = queryDeviceInfo<IS_CPU_DEVICE, bool>(); |
|
|
|
|
if (query.cols <= 64) |
|
|
|
|
{ |
|
|
|
|
matchUnrolledCached<16, 64>(query, trains, n, tempMask, trainIdx, imgIdx, distance, distType); |
|
|
|
|
} |
|
|
|
|
else if (query.cols <= 128) |
|
|
|
|
else if (query.cols <= 128 && !is_cpu) |
|
|
|
|
{ |
|
|
|
|
matchUnrolledCached<16, 128>(query, trains, n, tempMask, trainIdx, imgIdx, distance, distType); |
|
|
|
|
} |
|
|
|
@ -284,11 +286,12 @@ static void matchDispatcher(const oclMat &query, const oclMat &train, float maxD |
|
|
|
|
{ |
|
|
|
|
const oclMat zeroMask; |
|
|
|
|
const oclMat &tempMask = mask.data ? mask : zeroMask; |
|
|
|
|
bool is_cpu = queryDeviceInfo<IS_CPU_DEVICE, bool>(); |
|
|
|
|
if (query.cols <= 64) |
|
|
|
|
{ |
|
|
|
|
matchUnrolledCached<16, 64>(query, train, maxDistance, tempMask, trainIdx, distance, nMatches, distType); |
|
|
|
|
} |
|
|
|
|
else if (query.cols <= 128) |
|
|
|
|
else if (query.cols <= 128 && !is_cpu) |
|
|
|
|
{ |
|
|
|
|
matchUnrolledCached<16, 128>(query, train, maxDistance, tempMask, trainIdx, distance, nMatches, distType); |
|
|
|
|
} |
|
|
|
@ -466,11 +469,12 @@ static void calcDistanceDispatcher(const oclMat &query, const oclMat &train, con |
|
|
|
|
static void match2Dispatcher(const oclMat &query, const oclMat &train, const oclMat &mask, |
|
|
|
|
const oclMat &trainIdx, const oclMat &distance, int distType) |
|
|
|
|
{ |
|
|
|
|
bool is_cpu = queryDeviceInfo<IS_CPU_DEVICE, bool>(); |
|
|
|
|
if (query.cols <= 64) |
|
|
|
|
{ |
|
|
|
|
knn_matchUnrolledCached<16, 64>(query, train, mask, trainIdx, distance, distType); |
|
|
|
|
} |
|
|
|
|
else if (query.cols <= 128) |
|
|
|
|
else if (query.cols <= 128 && !is_cpu) |
|
|
|
|
{ |
|
|
|
|
knn_matchUnrolledCached<16, 128>(query, train, mask, trainIdx, distance, distType); |
|
|
|
|
} |
|
|
|
|