ocl: split initialization.cpp into 3 files: context, operations, programcache

This commit is contained in:
Alexander Alekhin
2013-09-20 19:19:52 +04:00
parent 8e75947a7d
commit e8d9ed8955
36 changed files with 1699 additions and 1534 deletions

View File

@@ -44,17 +44,11 @@
//M*/
#include "precomp.hpp"
#include "opencl_kernels.hpp"
using namespace cv;
using namespace cv::ocl;
namespace cv
{
namespace ocl
{
extern const char* knearest;//knearest
}
}
KNearestNeighbour::KNearestNeighbour()
{
clear();
@@ -112,7 +106,7 @@ void KNearestNeighbour::find_nearest(const oclMat& samples, int k, oclMat& lable
k1 = MIN( k1, k );
String kernel_name = "knn_find_nearest";
cl_ulong local_memory_size = queryLocalMemInfo();
cl_ulong local_memory_size = (cl_ulong)Context::getContext()->getDeviceInfo().localMemorySize;
int nThreads = local_memory_size / (2 * k * 4);
if(nThreads >= 256)
nThreads = 256;
@@ -122,7 +116,7 @@ void KNearestNeighbour::find_nearest(const oclMat& samples, int k, oclMat& lable
size_t global_thread[] = {1, samples.rows, 1};
char build_option[50];
if(!Context::getContext()->supportsFeature(Context::CL_DOUBLE))
if(!Context::getContext()->supportsFeature(FEATURE_CL_DOUBLE))
{
sprintf(build_option, " ");
}else