|
|
|
@ -51,7 +51,7 @@ |
|
|
|
|
using namespace cv; |
|
|
|
|
using namespace cv::ocl; |
|
|
|
|
|
|
|
|
|
static ProgramEntry surf = cv::ocl::nonfree::surf; |
|
|
|
|
static ProgramEntry surfprog = cv::ocl::nonfree::surf; |
|
|
|
|
|
|
|
|
|
namespace cv |
|
|
|
|
{ |
|
|
|
@ -501,7 +501,7 @@ void SURF_OCL_Invoker::icvCalcLayerDetAndTrace_gpu(oclMat &det, oclMat &trace, i |
|
|
|
|
divUp(max_samples_i, localThreads[1]) *localThreads[1] *(nOctaveLayers + 2), |
|
|
|
|
1 |
|
|
|
|
}; |
|
|
|
|
openCLExecuteKernelSURF(clCxt, &surf, kernelName, globalThreads, localThreads, args, -1, -1); |
|
|
|
|
openCLExecuteKernelSURF(clCxt, &surfprog, kernelName, globalThreads, localThreads, args, -1, -1); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void SURF_OCL_Invoker::icvFindMaximaInLayer_gpu(const oclMat &det, const oclMat &trace, oclMat &maxPosBuffer, oclMat &maxCounter, int counterOffset, |
|
|
|
@ -547,7 +547,7 @@ void SURF_OCL_Invoker::icvFindMaximaInLayer_gpu(const oclMat &det, const oclMat |
|
|
|
|
1 |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
openCLExecuteKernelSURF(clCxt, &surf, kernelName, globalThreads, localThreads, args, -1, -1); |
|
|
|
|
openCLExecuteKernelSURF(clCxt, &surfprog, kernelName, globalThreads, localThreads, args, -1, -1); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void SURF_OCL_Invoker::icvInterpolateKeypoint_gpu(const oclMat &det, const oclMat &maxPosBuffer, int maxCounter, |
|
|
|
@ -572,7 +572,7 @@ void SURF_OCL_Invoker::icvInterpolateKeypoint_gpu(const oclMat &det, const oclMa |
|
|
|
|
size_t localThreads[3] = {3, 3, 3}; |
|
|
|
|
size_t globalThreads[3] = {maxCounter *localThreads[0], localThreads[1], 1}; |
|
|
|
|
|
|
|
|
|
openCLExecuteKernelSURF(clCxt, &surf, kernelName, globalThreads, localThreads, args, -1, -1); |
|
|
|
|
openCLExecuteKernelSURF(clCxt, &surfprog, kernelName, globalThreads, localThreads, args, -1, -1); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void SURF_OCL_Invoker::icvCalcOrientation_gpu(const oclMat &keypoints, int nFeatures) |
|
|
|
@ -599,7 +599,7 @@ void SURF_OCL_Invoker::icvCalcOrientation_gpu(const oclMat &keypoints, int nFeat |
|
|
|
|
size_t localThreads[3] = {32, 4, 1}; |
|
|
|
|
size_t globalThreads[3] = {nFeatures *localThreads[0], localThreads[1], 1}; |
|
|
|
|
|
|
|
|
|
openCLExecuteKernelSURF(clCxt, &surf, kernelName, globalThreads, localThreads, args, -1, -1); |
|
|
|
|
openCLExecuteKernelSURF(clCxt, &surfprog, kernelName, globalThreads, localThreads, args, -1, -1); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void SURF_OCL_Invoker::icvSetUpright_gpu(const oclMat &keypoints, int nFeatures) |
|
|
|
@ -616,7 +616,7 @@ void SURF_OCL_Invoker::icvSetUpright_gpu(const oclMat &keypoints, int nFeatures) |
|
|
|
|
size_t localThreads[3] = {256, 1, 1}; |
|
|
|
|
size_t globalThreads[3] = {saturate_cast<size_t>(nFeatures), 1, 1}; |
|
|
|
|
|
|
|
|
|
openCLExecuteKernelSURF(clCxt, &surf, kernelName, globalThreads, localThreads, args, -1, -1); |
|
|
|
|
openCLExecuteKernelSURF(clCxt, &surfprog, kernelName, globalThreads, localThreads, args, -1, -1); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -656,7 +656,7 @@ void SURF_OCL_Invoker::compute_descriptors_gpu(const oclMat &descriptors, const |
|
|
|
|
args.push_back( std::make_pair( sizeof(cl_int), (void *)&_img.cols)); |
|
|
|
|
args.push_back( std::make_pair( sizeof(cl_int), (void *)&_img.step)); |
|
|
|
|
|
|
|
|
|
openCLExecuteKernelSURF(clCxt, &surf, kernelName, globalThreads, localThreads, args, -1, -1); |
|
|
|
|
openCLExecuteKernelSURF(clCxt, &surfprog, kernelName, globalThreads, localThreads, args, -1, -1); |
|
|
|
|
|
|
|
|
|
kernelName = "normalize_descriptors64"; |
|
|
|
|
|
|
|
|
@ -670,7 +670,7 @@ void SURF_OCL_Invoker::compute_descriptors_gpu(const oclMat &descriptors, const |
|
|
|
|
args.push_back( std::make_pair( sizeof(cl_mem), (void *)&descriptors.data)); |
|
|
|
|
args.push_back( std::make_pair( sizeof(cl_int), (void *)&descriptors.step)); |
|
|
|
|
|
|
|
|
|
openCLExecuteKernelSURF(clCxt, &surf, kernelName, globalThreads, localThreads, args, -1, -1); |
|
|
|
|
openCLExecuteKernelSURF(clCxt, &surfprog, kernelName, globalThreads, localThreads, args, -1, -1); |
|
|
|
|
} |
|
|
|
|
else |
|
|
|
|
{ |
|
|
|
@ -699,7 +699,7 @@ void SURF_OCL_Invoker::compute_descriptors_gpu(const oclMat &descriptors, const |
|
|
|
|
args.push_back( std::make_pair( sizeof(cl_int), (void *)&_img.cols)); |
|
|
|
|
args.push_back( std::make_pair( sizeof(cl_int), (void *)&_img.step)); |
|
|
|
|
|
|
|
|
|
openCLExecuteKernelSURF(clCxt, &surf, kernelName, globalThreads, localThreads, args, -1, -1); |
|
|
|
|
openCLExecuteKernelSURF(clCxt, &surfprog, kernelName, globalThreads, localThreads, args, -1, -1); |
|
|
|
|
|
|
|
|
|
kernelName = "normalize_descriptors128"; |
|
|
|
|
|
|
|
|
@ -713,7 +713,7 @@ void SURF_OCL_Invoker::compute_descriptors_gpu(const oclMat &descriptors, const |
|
|
|
|
args.push_back( std::make_pair( sizeof(cl_mem), (void *)&descriptors.data)); |
|
|
|
|
args.push_back( std::make_pair( sizeof(cl_int), (void *)&descriptors.step)); |
|
|
|
|
|
|
|
|
|
openCLExecuteKernelSURF(clCxt, &surf, kernelName, globalThreads, localThreads, args, -1, -1); |
|
|
|
|
openCLExecuteKernelSURF(clCxt, &surfprog, kernelName, globalThreads, localThreads, args, -1, -1); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|