Commit e5abda1e authored by GG4mida's avatar GG4mida

refactor: improve the performance of kernel functions

parent f45322d0
......@@ -35,7 +35,7 @@ jobs:
with:
artifacts: "${{ github.workspace }}/dist/windows.zip"
token: ${{ secrets.GH_TOKEN }}
tag: v1.1.4
tag: v2.0.1
draft: true
allowUpdates: true
replacesArtifacts: true
\ No newline at end of file
# Makefile artifacts
*.o
*.so
.DS_store
cache-opencl.*
bin
.DS_store
profanity.x64
README_dev.md
......@@ -453,10 +453,9 @@ void profanity_result_update(
const size_t id,
__global const uchar * const hash,
__global result * const pResult,
const uchar score,
const uchar scoreMax)
{
if (score && score > scoreMax) {
uchar score = scoreMax + 1;
uchar hasResult = atomic_inc(&pResult[score].found);
if (hasResult == 0) {
pResult[score].foundId = id;
......@@ -464,7 +463,6 @@ void profanity_result_update(
pResult[score].foundHash[i] = hash[i];
}
}
}
}
__kernel void profanity_score_matching(
......@@ -494,12 +492,11 @@ __kernel void profanity_score_matching(
}
}
for(uint j = 0; j < matchingCount; j++) {
uint scorePrefix = 0;
uint scorePrefix = 1;
uint scoreSuffix = 0;
uint scoreTotal = 0;
uint dataIndex = 0;
if(prefixCount > 0) {
for (uint i = 0; i < 10; ++i) {
if(prefixCount > 1) {
for (uint i = 1; i < 10; ++i) {
dataIndex = j * 20 + i;
if (data1[dataIndex] > 0 && (matchingHash[i] & data1[dataIndex]) == data2[dataIndex]) {
++scorePrefix;
......@@ -519,8 +516,7 @@ __kernel void profanity_score_matching(
}
}
if(scorePrefix >= prefixCount && scoreSuffix >= suffixCount){
scoreTotal = scoreMax + 1;
profanity_result_update(id, hash, pResult, scoreTotal, scoreMax);
profanity_result_update(id, hash, pResult, scoreMax);
break;
}
}
......
No preview for this file type
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