Kaydet (Commit) 1b519473 authored tarafından haochen's avatar haochen Kaydeden (comit) I-Jui (Ray) Sung

GPU Calc: Optimize Vlookup

AMLOEXT-406

Change-Id: Ibd1ad4e93ccfa1bb3a64545f4f007e4116691791
Signed-off-by: 's avatarhaochen <haochen@multicorewareinc.com>
Signed-off-by: 's avatarWei Wei <weiwei@multicorewareinc.com>
Signed-off-by: 's avatarI-Jui (Ray) Sung <ray@multicorewareinc.com>
üst 85c40170
...@@ -73,9 +73,8 @@ void OpVLookup::GenSlidingWindowFunction(std::stringstream &ss, ...@@ -73,9 +73,8 @@ void OpVLookup::GenSlidingWindowFunction(std::stringstream &ss,
size_t nCurWindowSize = pCurDVR->GetArrayLength() < size_t nCurWindowSize = pCurDVR->GetArrayLength() <
pCurDVR->GetRefRowSize() ? pCurDVR->GetArrayLength(): pCurDVR->GetRefRowSize() ? pCurDVR->GetArrayLength():
pCurDVR->GetRefRowSize() ; pCurDVR->GetRefRowSize() ;
int unrollSize = 16; int unrollSize = 8;
ss << " int loop;\n"; ss << " int loop;\n";
ss << " int remainder;\n";
if (!pCurDVR->IsStartFixed() && pCurDVR->IsEndFixed()) { if (!pCurDVR->IsStartFixed() && pCurDVR->IsEndFixed()) {
ss << " loop = ("<<nCurWindowSize<<" - gid0)/"; ss << " loop = ("<<nCurWindowSize<<" - gid0)/";
ss << unrollSize<<";\n"; ss << unrollSize<<";\n";
...@@ -126,7 +125,6 @@ void OpVLookup::GenSlidingWindowFunction(std::stringstream &ss, ...@@ -126,7 +125,6 @@ void OpVLookup::GenSlidingWindowFunction(std::stringstream &ss,
ss << 1+i; ss << 1+i;
ss << ";\n"; ss << ";\n";
ss << " }\n"; ss << " }\n";
ss << " i++;\n"; ss << " i++;\n";
ss << " doubleIndex++;\n"; ss << " doubleIndex++;\n";
} }
...@@ -143,12 +141,28 @@ void OpVLookup::GenSlidingWindowFunction(std::stringstream &ss, ...@@ -143,12 +141,28 @@ void OpVLookup::GenSlidingWindowFunction(std::stringstream &ss,
ss << " {\n"; ss << " {\n";
ss << " rowNum = doubleIndex;\n"; ss << " rowNum = doubleIndex;\n";
ss << " }\n"; ss << " }\n";
ss << " i++;\n"; ss << " i++;\n";
ss << " doubleIndex++;\n"; ss << " doubleIndex++;\n";
} }
ss << " }\n\n"; ss << " }\n\n";
ss << " }\n";
ss << " if(rowNum!=-1)\n";
ss << " {\n";
for(int j=0;j< secondParaWidth; j++)
{
ss << " if(tmp";
ss << 2+(secondParaWidth-1);
ss << " == ";
ss << j+1;
ss << ")\n";
ss << " tmp = ";
vSubArguments[1+j]->GenDeclRef(ss);
ss << "[rowNum];\n";
}
ss << " return tmp;\n";
ss << " }\n"; ss << " }\n";
ss << " for (int i = "; ss << " for (int i = ";
if (!pCurDVR->IsStartFixed() && pCurDVR->IsEndFixed()) { if (!pCurDVR->IsStartFixed() && pCurDVR->IsEndFixed()) {
...@@ -196,9 +210,6 @@ void OpVLookup::GenSlidingWindowFunction(std::stringstream &ss, ...@@ -196,9 +210,6 @@ void OpVLookup::GenSlidingWindowFunction(std::stringstream &ss,
ss << " }\n"; ss << " }\n";
ss << " }\n\n"; ss << " }\n\n";
}
ss << " if(rowNum!=-1)\n"; ss << " if(rowNum!=-1)\n";
ss << " {\n"; ss << " {\n";
...@@ -213,8 +224,13 @@ void OpVLookup::GenSlidingWindowFunction(std::stringstream &ss, ...@@ -213,8 +224,13 @@ void OpVLookup::GenSlidingWindowFunction(std::stringstream &ss,
ss << " tmp = "; ss << " tmp = ";
vSubArguments[1+j]->GenDeclRef(ss); vSubArguments[1+j]->GenDeclRef(ss);
ss << "[rowNum];\n"; ss << "[rowNum];\n";
} }
ss << " return tmp;\n";
ss << " }\n"; ss << " }\n";
}
} }
else else
{ {
...@@ -228,7 +244,6 @@ void OpVLookup::GenSlidingWindowFunction(std::stringstream &ss, ...@@ -228,7 +244,6 @@ void OpVLookup::GenSlidingWindowFunction(std::stringstream &ss,
ss << " tmp = tmp1;\n"; ss << " tmp = tmp1;\n";
ss << " }\n"; ss << " }\n";
} }
ss << " return tmp;\n"; ss << " return tmp;\n";
ss << "}"; ss << "}";
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment