Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
LightMotif
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Martin Larralde
LightMotif
Commits
f355192d
Commit
f355192d
authored
9 months ago
by
Martin Larralde
Browse files
Options
Downloads
Patches
Plain Diff
Fix AVX2 implementation of `Maximum::argmax`
parent
cd75a905
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
lightmotif/src/pli/dispatch.rs
+0
-1
0 additions, 1 deletion
lightmotif/src/pli/dispatch.rs
lightmotif/src/pli/platform/avx2.rs
+2
-2
2 additions, 2 deletions
lightmotif/src/pli/platform/avx2.rs
with
2 additions
and
3 deletions
lightmotif/src/pli/dispatch.rs
+
0
−
1
View file @
f355192d
...
@@ -198,7 +198,6 @@ impl<A: Alphabet> Maximum<u8, <Dispatch as Backend>::LANES> for Pipeline<A, Disp
...
@@ -198,7 +198,6 @@ impl<A: Alphabet> Maximum<u8, <Dispatch as Backend>::LANES> for Pipeline<A, Disp
scores
:
&
StripedScores
<
u8
,
<
Dispatch
as
Backend
>
::
LANES
>
,
scores
:
&
StripedScores
<
u8
,
<
Dispatch
as
Backend
>
::
LANES
>
,
)
->
Option
<
MatrixCoordinates
>
{
)
->
Option
<
MatrixCoordinates
>
{
match
self
.backend
{
match
self
.backend
{
// FIXME !!!!
#[cfg(any(target_arch
=
"x86"
,
target_arch
=
"x86_64"
))]
#[cfg(any(target_arch
=
"x86"
,
target_arch
=
"x86_64"
))]
Dispatch
::
Avx2
=>
Avx2
::
argmax_u8
(
scores
),
Dispatch
::
Avx2
=>
Avx2
::
argmax_u8
(
scores
),
// #[cfg(any(target_arch = "x86", target_arch = "x86_64"))]
// #[cfg(any(target_arch = "x86", target_arch = "x86_64"))]
...
...
This diff is collapsed.
Click to expand it.
lightmotif/src/pli/platform/avx2.rs
+
2
−
2
View file @
f355192d
...
@@ -438,8 +438,8 @@ unsafe fn argmax_u8_avx2(
...
@@ -438,8 +438,8 @@ unsafe fn argmax_u8_avx2(
let
r1
=
_mm256_unpacklo_epi8
(
r
,
_mm256_setzero_si256
());
let
r1
=
_mm256_unpacklo_epi8
(
r
,
_mm256_setzero_si256
());
let
r2
=
_mm256_unpackhi_epi8
(
r
,
_mm256_setzero_si256
());
let
r2
=
_mm256_unpackhi_epi8
(
r
,
_mm256_setzero_si256
());
// compare scores to local maximums
// compare scores to local maximums
let
c1
=
_mm256_or_si256
(
_mm256_cmpgt_epi16
(
r1
,
s1
)
,
_mm256_cmpeq_epi16
(
r1
,
s1
)
);
let
c1
=
_mm256_cmpgt_epi16
(
s1
,
r1
);
let
c2
=
_mm256_or_si256
(
_mm256_cmpgt_epi16
(
r2
,
s2
)
,
_mm256_cmpeq_epi16
(
r2
,
s2
)
);
let
c2
=
_mm256_cmpgt_epi16
(
s2
,
r2
);
// replace indices of new local maximums
// replace indices of new local maximums
p1
=
_mm256_blendv_epi8
(
p1
,
index
,
c1
);
p1
=
_mm256_blendv_epi8
(
p1
,
index
,
c1
);
p2
=
_mm256_blendv_epi8
(
p2
,
index
,
c2
);
p2
=
_mm256_blendv_epi8
(
p2
,
index
,
c2
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment