CUDA: the missing files

This commit is contained in:
Vitor Santos Costa
2016-04-22 18:21:05 +01:00
parent f966a5b912
commit ea90785c6a
11 changed files with 3071 additions and 0 deletions

30
packages/cuda/CC_CSSTree.cu Executable file
View File

@@ -0,0 +1,30 @@
#include "CC_CSSTree.h"
//return the start position of searching the key.
int CC_CSSTree::search(int key)
{
int i=0;
int curIndex=0;
int curNode=0;
int j=0;
//search
for(i=0;i<level;i++)
{
for(j=0;j<blockSize;j++)
{
if(ntree[curIndex+j]==-1)
break;
if(key<=ntree[curIndex+j])
break;
}
curNode=(fanout*(curNode)+j+1);
curIndex=curNode*blockSize;
//#ifdef DEBUG
// cout<<curNode<<", "<<j<<", "<<ntree[curIndex]<<"; ";
//#endif
}
curIndex=(curNode-numNode)*blockSize;
if(curIndex>numRecord) curIndex=numRecord-1;
//cout<<"I: "<<curIndex<<", ";//cout<<endl;
return curIndex;
}