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
b0e78dc9
Commit
b0e78dc9
authored
1 year ago
by
Martin Larralde
Browse files
Options
Downloads
Patches
Plain Diff
Use `Backend::LANES` in `Sse2` code
parent
3c6ce734
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/platform/neon.rs
+1
-4
1 addition, 4 deletions
lightmotif/src/pli/platform/neon.rs
lightmotif/src/pli/platform/sse2.rs
+2
-2
2 additions, 2 deletions
lightmotif/src/pli/platform/sse2.rs
with
3 additions
and
6 deletions
lightmotif/src/pli/platform/neon.rs
+
1
−
4
View file @
b0e78dc9
...
@@ -131,10 +131,7 @@ unsafe fn score_neon<A: Alphabet, C: MultipleOf<U16>>(
...
@@ -131,10 +131,7 @@ unsafe fn score_neon<A: Alphabet, C: MultipleOf<U16>>(
let
zero_f32
=
vdupq_n_f32
(
0.0
);
let
zero_f32
=
vdupq_n_f32
(
0.0
);
// process columns of the striped matrix, any multiple of 16 is supported
// process columns of the striped matrix, any multiple of 16 is supported
let
data
=
scores
.matrix_mut
();
let
data
=
scores
.matrix_mut
();
for
offset
in
(
0
..
C
::
Quotient
::
USIZE
)
for
offset
in
(
0
..
C
::
Quotient
::
USIZE
)
.map
(|
i
|
i
*
<
Neon
as
Backend
>
::
LANES
::
USIZE
)
{
.into_iter
()
.map
(|
i
|
i
*
<
Neon
as
Backend
>
::
LANES
::
USIZE
)
{
// process every position of the sequence data
// process every position of the sequence data
for
i
in
0
..
seq
.data
.rows
()
-
seq
.wrap
{
for
i
in
0
..
seq
.data
.rows
()
-
seq
.wrap
{
// reset sums for current position
// reset sums for current position
...
...
This diff is collapsed.
Click to expand it.
lightmotif/src/pli/platform/sse2.rs
+
2
−
2
View file @
b0e78dc9
...
@@ -107,7 +107,7 @@ unsafe fn argmax_sse2<C: MultipleOf<U16>>(scores: &StripedScores<C>) -> Option<u
...
@@ -107,7 +107,7 @@ unsafe fn argmax_sse2<C: MultipleOf<U16>>(scores: &StripedScores<C>) -> Option<u
let
mut
best_col
=
[
0u32
;
16
];
let
mut
best_col
=
[
0u32
;
16
];
let
mut
best_pos
=
0
;
let
mut
best_pos
=
0
;
let
mut
best_score
=
-
f32
::
INFINITY
;
let
mut
best_score
=
-
f32
::
INFINITY
;
for
offset
in
(
0
..
C
::
Quotient
::
USIZE
)
.map
(|
i
|
i
*
16
)
{
for
offset
in
(
0
..
C
::
Quotient
::
USIZE
)
.map
(|
i
|
i
*
<
Sse2
as
Backend
>
::
LANES
::
USIZE
)
{
let
mut
dataptr
=
data
[
0
]
.as_ptr
()
.add
(
offset
);
let
mut
dataptr
=
data
[
0
]
.as_ptr
()
.add
(
offset
);
// the row index for the best score in each column
// the row index for the best score in each column
// (these are 32-bit integers but for use with `_mm256_blendv_ps`
// (these are 32-bit integers but for use with `_mm256_blendv_ps`
...
@@ -212,7 +212,7 @@ unsafe fn threshold_sse2<C: MultipleOf<U16>>(
...
@@ -212,7 +212,7 @@ unsafe fn threshold_sse2<C: MultipleOf<U16>>(
let
t
=
_mm_set1_ps
(
threshold
);
let
t
=
_mm_set1_ps
(
threshold
);
let
ones
=
_mm_set1_epi32
(
1
);
let
ones
=
_mm_set1_epi32
(
1
);
let
mut
dst
=
indices
.as_mut_ptr
()
as
*
mut
__m128i
;
let
mut
dst
=
indices
.as_mut_ptr
()
as
*
mut
__m128i
;
for
offset
in
(
0
..
C
::
Quotient
::
USIZE
)
.map
(|
i
|
i
*
16
)
{
for
offset
in
(
0
..
C
::
Quotient
::
USIZE
)
.map
(|
i
|
i
*
<
Sse2
as
Backend
>
::
LANES
::
USIZE
)
{
// compute real sequence index for each column of the striped scores
// compute real sequence index for each column of the striped scores
let
mut
x1
=
_mm_set_epi32
(
let
mut
x1
=
_mm_set_epi32
(
((
offset
+
3
)
*
rows
)
as
i32
,
((
offset
+
3
)
*
rows
)
as
i32
,
...
...
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