static const int OPT_SIZE = 100;
+static const char * T_ARR [] = {"uchar", "char", "ushort", "short", "int", "float", "double"};
+
template < int BLOCK_SIZE, int MAX_DESC_LEN/*, typename Mask*/ >
void matchUnrolledCached(const oclMat &query, const oclMat &train, const oclMat &/*mask*/,
const oclMat &trainIdx, const oclMat &distance, int distType)
vector< pair<size_t, const void *> > args;
char opt [OPT_SIZE] = "";
- sprintf(opt, "-D DIST_TYPE=%d -D BLOCK_SIZE=%d -D MAX_DESC_LEN=%d", distType, block_size, m_size);
+ sprintf(opt,
+ "-D T=%s -D DIST_TYPE=%d -D BLOCK_SIZE=%d -D MAX_DESC_LEN=%d",
+ T_ARR[query.depth()], distType, block_size, m_size);
if(globalSize[0] != 0)
{
vector< pair<size_t, const void *> > args;
char opt [OPT_SIZE] = "";
- sprintf(opt, "-D DIST_TYPE=%d -D BLOCK_SIZE=%d", distType, block_size);
+ sprintf(opt,
+ "-D T=%s -D DIST_TYPE=%d -D BLOCK_SIZE=%d",
+ T_ARR[query.depth()], distType, block_size);
if(globalSize[0] != 0)
{
vector< pair<size_t, const void *> > args;
char opt [OPT_SIZE] = "";
- sprintf(opt, "-D DIST_TYPE=%d -D BLOCK_SIZE=%d -D MAX_DESC_LEN=%d", distType, block_size, m_size);
+ sprintf(opt,
+ "-D T=%s -D DIST_TYPE=%d -D BLOCK_SIZE=%d -D MAX_DESC_LEN=%d",
+ T_ARR[query.depth()], distType, block_size, m_size);
if(globalSize[0] != 0)
{
vector< pair<size_t, const void *> > args;
char opt [OPT_SIZE] = "";
- sprintf(opt, "-D DIST_TYPE=%d -D BLOCK_SIZE=%d", distType, block_size);
+ sprintf(opt,
+ "-D T=%s -D DIST_TYPE=%d -D BLOCK_SIZE=%d",
+ T_ARR[query.depth()], distType, block_size);
if(globalSize[0] != 0)
{
vector< pair<size_t, const void *> > args;
char opt [OPT_SIZE] = "";
- sprintf(opt, "-D DIST_TYPE=%d -D BLOCK_SIZE=%d -D MAX_DESC_LEN=%d", distType, block_size, m_size);
+ sprintf(opt,
+ "-D T=%s -D DIST_TYPE=%d -D BLOCK_SIZE=%d -D MAX_DESC_LEN=%d",
+ T_ARR[query.depth()], distType, block_size, m_size);
if(globalSize[0] != 0)
{
vector< pair<size_t, const void *> > args;
char opt [OPT_SIZE] = "";
- sprintf(opt, "-D DIST_TYPE=%d -D BLOCK_SIZE=%d", distType, block_size);
+ sprintf(opt,
+ "-D T=%s -D DIST_TYPE=%d -D BLOCK_SIZE=%d",
+ T_ARR[query.depth()], distType, block_size);
if(globalSize[0] != 0)
{
vector< pair<size_t, const void *> > args;
char opt [OPT_SIZE] = "";
- sprintf(opt, "-D DIST_TYPE=%d", distType);
+ sprintf(opt,
+ "-D T=%s -D DIST_TYPE=%d -D BLOCK_SIZE=%d -D MAX_DESC_LEN=%d",
+ T_ARR[query.depth()], distType, block_size, m_size);
+
if(globalSize[0] != 0)
{
args.push_back( make_pair( sizeof(cl_mem), (void *)&query.data ));
vector< pair<size_t, const void *> > args;
char opt [OPT_SIZE] = "";
- sprintf(opt, "-D DIST_TYPE=%d", distType);
+ sprintf(opt,
+ "-D T=%s -D DIST_TYPE=%d -D BLOCK_SIZE=%d",
+ T_ARR[query.depth()], distType, block_size);
+
if(globalSize[0] != 0)
{
args.push_back( make_pair( sizeof(cl_mem), (void *)&query.data ));