Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
P
Profanity
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nanahira
Profanity
Commits
e5abda1e
Commit
e5abda1e
authored
Jul 11, 2023
by
GG4mida
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
refactor: improve the performance of kernel functions
parent
f45322d0
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
13 additions
and
16 deletions
+13
-16
.github/workflows/release.yml
.github/workflows/release.yml
+1
-1
.gitignore
.gitignore
+2
-1
kernel_profanity.hpp
kernel_profanity.hpp
+10
-14
profanity.x64
profanity.x64
+0
-0
No files found.
.github/workflows/release.yml
View file @
e5abda1e
...
@@ -35,7 +35,7 @@ jobs:
...
@@ -35,7 +35,7 @@ jobs:
with
:
with
:
artifacts
:
"
${{
github.workspace
}}/dist/windows.zip"
artifacts
:
"
${{
github.workspace
}}/dist/windows.zip"
token
:
${{ secrets.GH_TOKEN }}
token
:
${{ secrets.GH_TOKEN }}
tag
:
v
1.1.4
tag
:
v
2.0.1
draft
:
true
draft
:
true
allowUpdates
:
true
allowUpdates
:
true
replacesArtifacts
:
true
replacesArtifacts
:
true
\ No newline at end of file
.gitignore
View file @
e5abda1e
# Makefile artifacts
# Makefile artifacts
*.o
*.o
*.so
*.so
.DS_store
cache-opencl.*
cache-opencl.*
bin
bin
.DS_store
profanity.x64
README_dev.md
README_dev.md
kernel_profanity.hpp
View file @
e5abda1e
...
@@ -453,16 +453,14 @@ void profanity_result_update(
...
@@ -453,16 +453,14 @@ void profanity_result_update(
const size_t id,
const size_t id,
__global const uchar * const hash,
__global const uchar * const hash,
__global result * const pResult,
__global result * const pResult,
const uchar score,
const uchar scoreMax)
const uchar scoreMax)
{
{
if (score && score > scoreMax) {
uchar score = scoreMax + 1;
uchar hasResult = atomic_inc(&pResult[score].found);
uchar hasResult = atomic_inc(&pResult[score].found);
if (hasResult == 0) {
if (hasResult == 0) {
pResult[score].foundId = id;
pResult[score].foundId = id;
for (int i = 0; i < 20; ++i) {
for (int i = 0; i < 20; ++i) {
pResult[score].foundHash[i] = hash[i];
pResult[score].foundHash[i] = hash[i];
}
}
}
}
}
}
}
...
@@ -494,12 +492,11 @@ __kernel void profanity_score_matching(
...
@@ -494,12 +492,11 @@ __kernel void profanity_score_matching(
}
}
}
}
for(uint j = 0; j < matchingCount; j++) {
for(uint j = 0; j < matchingCount; j++) {
uint scorePrefix =
0
;
uint scorePrefix =
1
;
uint scoreSuffix = 0;
uint scoreSuffix = 0;
uint scoreTotal = 0;
uint dataIndex = 0;
uint dataIndex = 0;
if(prefixCount >
0
) {
if(prefixCount >
1
) {
for (uint i =
0
; i < 10; ++i) {
for (uint i =
1
; i < 10; ++i) {
dataIndex = j * 20 + i;
dataIndex = j * 20 + i;
if (data1[dataIndex] > 0 && (matchingHash[i] & data1[dataIndex]) == data2[dataIndex]) {
if (data1[dataIndex] > 0 && (matchingHash[i] & data1[dataIndex]) == data2[dataIndex]) {
++scorePrefix;
++scorePrefix;
...
@@ -519,8 +516,7 @@ __kernel void profanity_score_matching(
...
@@ -519,8 +516,7 @@ __kernel void profanity_score_matching(
}
}
}
}
if(scorePrefix >= prefixCount && scoreSuffix >= suffixCount){
if(scorePrefix >= prefixCount && scoreSuffix >= suffixCount){
scoreTotal = scoreMax + 1;
profanity_result_update(id, hash, pResult, scoreMax);
profanity_result_update(id, hash, pResult, scoreTotal, scoreMax);
break;
break;
}
}
}
}
...
...
profanity.x64
View file @
e5abda1e
No preview for this file type
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment