mirror of
https://github.com/opencv/opencv.git
synced 2025-01-18 06:03:15 +08:00
Merge pull request #932 from bitwangyaoyao:2.4_fixBFM
This commit is contained in:
commit
37091b086c
@ -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);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user