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
ff811f37
Commit
ff811f37
authored
9 months ago
by
Martin Larralde
Browse files
Options
Downloads
Patches
Plain Diff
Use `_mm256_permutevar8x32_ps` in AVX2 `Score` to avoid special case for default Dna symbol
parent
a0bb4e2b
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/dense.rs
+3
-1
3 additions, 1 deletion
lightmotif/src/dense.rs
lightmotif/src/pli/platform/avx2.rs
+6
-17
6 additions, 17 deletions
lightmotif/src/pli/platform/avx2.rs
with
9 additions
and
18 deletions
lightmotif/src/dense.rs
+
3
−
1
View file @
ff811f37
...
...
@@ -14,7 +14,9 @@ use crate::num::Unsigned;
// --- DefaultAlignment --------------------------------------------------------
#[cfg(any(target_arch
=
"x86"
,
target_arch
=
"x86_64"
))]
#[cfg(target_arch
=
"x86_64"
)]
type
_DefaultAlignment
=
typenum
::
consts
::
U64
;
#[cfg(target_arch
=
"x86"
)]
type
_DefaultAlignment
=
typenum
::
consts
::
U32
;
#[cfg(not(any(target_arch
=
"x86"
,
target_arch
=
"x86_64"
)))]
type
_DefaultAlignment
=
typenum
::
consts
::
U16
;
...
...
This diff is collapsed.
Click to expand it.
lightmotif/src/pli/platform/avx2.rs
+
6
−
17
View file @
ff811f37
...
...
@@ -150,23 +150,12 @@ unsafe fn score_avx2_permute<A>(
let
x3
=
_mm256_shuffle_epi8
(
x
,
m3
);
let
x4
=
_mm256_shuffle_epi8
(
x
,
m4
);
// load row for current weight matrix position
let
t
=
_mm256_broadcast_ps
(
&*
(
pssmptr
as
*
const
__m128
));
let
u
=
_mm256_broadcast_ss
(
&*
(
pssmptr
.add
(
<
A
as
Alphabet
>
::
K
::
USIZE
-
1
)));
// check which bases from the sequence are unknown
let
unk1
=
_mm256_castsi256_ps
(
_mm256_cmpeq_epi32
(
x1
,
n
));
let
unk2
=
_mm256_castsi256_ps
(
_mm256_cmpeq_epi32
(
x2
,
n
));
let
unk3
=
_mm256_castsi256_ps
(
_mm256_cmpeq_epi32
(
x3
,
n
));
let
unk4
=
_mm256_castsi256_ps
(
_mm256_cmpeq_epi32
(
x4
,
n
));
// index A/T/G/C lookup table with the bases
let
p1
=
_mm256_permutevar_ps
(
t
,
x1
);
let
p2
=
_mm256_permutevar_ps
(
t
,
x2
);
let
p3
=
_mm256_permutevar_ps
(
t
,
x3
);
let
p4
=
_mm256_permutevar_ps
(
t
,
x4
);
// blend together known and unknown scores
let
b1
=
_mm256_blendv_ps
(
p1
,
u
,
unk1
);
let
b2
=
_mm256_blendv_ps
(
p2
,
u
,
unk2
);
let
b3
=
_mm256_blendv_ps
(
p3
,
u
,
unk3
);
let
b4
=
_mm256_blendv_ps
(
p4
,
u
,
unk4
);
let
t
=
_mm256_load_ps
(
pssmptr
);
// index A/T/G/C/N lookup table with the bases
let
b1
=
_mm256_permutevar8x32_ps
(
t
,
x1
);
let
b2
=
_mm256_permutevar8x32_ps
(
t
,
x2
);
let
b3
=
_mm256_permutevar8x32_ps
(
t
,
x3
);
let
b4
=
_mm256_permutevar8x32_ps
(
t
,
x4
);
// add log odds to the running sum
s1
=
_mm256_add_ps
(
s1
,
b1
);
s2
=
_mm256_add_ps
(
s2
,
b2
);
...
...
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