Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Opus
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
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
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Xiph.Org
Opus
Commits
60d6eab6
Commit
60d6eab6
authored
3 years ago
by
Jean-Marc Valin
Browse files
Options
Downloads
Patches
Plain Diff
Doing a bit of unrolling to speed things up
parent
3e7ab9ff
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
dnn/vec_avx.h
+34
-1
34 additions, 1 deletion
dnn/vec_avx.h
with
34 additions
and
1 deletion
dnn/vec_avx.h
+
34
−
1
View file @
60d6eab6
...
...
@@ -502,7 +502,40 @@ static inline void sparse_sgemv_accum8x4(float *_out, const qweight *w, int rows
colblocks
=
*
idx
++
;
y
=
&
out
[
i
];
vy0
=
_mm256_loadu_si256
((
const
__m256i
*
)
&
y
[
0
]);
for
(
j
=
0
;
j
<
colblocks
;
j
++
)
j
=
0
;
#if 1
/* Unrolling by 4 gives some gain, comment out if it does not. */
for
(;
j
<
colblocks
-
3
;
j
+=
4
)
{
__m256i
tmp
;
__m256i
vxj
;
__m256i
vw
;
vxj
=
_mm256_set1_epi32
(
*
(
int
*
)
&
x
[
*
idx
++
]);
vw
=
_mm256_loadu_si256
((
const
__m256i
*
)
w
);
//_mm256_lddqu_si256?
tmp
=
_mm256_maddubs_epi16
(
vxj
,
vw
);
//swap?
tmp
=
_mm256_madd_epi16
(
tmp
,
ones
);
vy0
=
_mm256_add_epi32
(
vy0
,
tmp
);
w
+=
32
;
vxj
=
_mm256_set1_epi32
(
*
(
int
*
)
&
x
[
*
idx
++
]);
vw
=
_mm256_loadu_si256
((
const
__m256i
*
)
w
);
//_mm256_lddqu_si256?
tmp
=
_mm256_maddubs_epi16
(
vxj
,
vw
);
//swap?
tmp
=
_mm256_madd_epi16
(
tmp
,
ones
);
vy0
=
_mm256_add_epi32
(
vy0
,
tmp
);
w
+=
32
;
vxj
=
_mm256_set1_epi32
(
*
(
int
*
)
&
x
[
*
idx
++
]);
vw
=
_mm256_loadu_si256
((
const
__m256i
*
)
w
);
//_mm256_lddqu_si256?
tmp
=
_mm256_maddubs_epi16
(
vxj
,
vw
);
//swap?
tmp
=
_mm256_madd_epi16
(
tmp
,
ones
);
vy0
=
_mm256_add_epi32
(
vy0
,
tmp
);
w
+=
32
;
vxj
=
_mm256_set1_epi32
(
*
(
int
*
)
&
x
[
*
idx
++
]);
vw
=
_mm256_loadu_si256
((
const
__m256i
*
)
w
);
//_mm256_lddqu_si256?
tmp
=
_mm256_maddubs_epi16
(
vxj
,
vw
);
//swap?
tmp
=
_mm256_madd_epi16
(
tmp
,
ones
);
vy0
=
_mm256_add_epi32
(
vy0
,
tmp
);
w
+=
32
;
}
#endif
for
(;
j
<
colblocks
;
j
++
)
{
__m256i
tmp
;
__m256i
vxj
;
...
...
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