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
e8f70128
Commit
e8f70128
authored
3 years ago
by
Jean-Marc Valin
Browse files
Options
Downloads
Patches
Plain Diff
same conversion cleanup as 3206cec for sgemv_accum8x4()
parent
7cef98ec
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
+7
-7
7 additions, 7 deletions
dnn/vec_avx.h
with
7 additions
and
7 deletions
dnn/vec_avx.h
+
7
−
7
View file @
e8f70128
...
...
@@ -392,10 +392,8 @@ static inline void sgemv_accum8x4(float *_out, const qweight *w, int rows, int c
__m256i
ones
;
int
i
,
j
;
unsigned
char
x
[
MAX_INPUTS
];
int
out
[
MAX_OUTPUTS
];
(
void
)
col_stride
;
ones
=
_mm256_set1_epi16
(
1
);
for
(
i
=
0
;
i
<
rows
;
i
++
)
out
[
i
]
=
SCALE
*
_out
[
i
];
//for (i=0;i<cols;i++) x[i] = 127+floor(.5+127*_x[i]);
__m256
const127
=
_mm256_set1_ps
(
127
.
f
);
for
(
i
=
0
;
i
<
cols
;
i
+=
8
)
{
...
...
@@ -415,10 +413,11 @@ static inline void sgemv_accum8x4(float *_out, const qweight *w, int rows, int c
}
for
(
i
=
0
;
i
<
rows
;
i
+=
8
)
{
int
*
restrict
y
;
__m256i
vy0
;
y
=
&
out
[
i
];
vy0
=
_mm256_loadu_si256
((
const
__m256i
*
)
&
y
[
0
]);
__m256
vout
;
vout
=
_mm256_loadu_ps
(
&
_out
[
i
]);
vout
=
_mm256_mul_ps
(
vout
,
_mm256_set1_ps
(
SCALE
));
vy0
=
_mm256_cvtps_epi32
(
vout
);
j
=
0
;
#if 1
/* Unrolling by 4 gives some gain, comment out if it does not. */
for
(;
j
<
cols
-
12
;
j
+=
16
)
...
...
@@ -464,9 +463,10 @@ static inline void sgemv_accum8x4(float *_out, const qweight *w, int rows, int c
vy0
=
_mm256_add_epi32
(
vy0
,
tmp
);
w
+=
32
;
}
_mm256_storeu_si256
((
__m256i
*
)
&
y
[
0
],
vy0
);
vout
=
_mm256_cvtepi32_ps
(
vy0
);
vout
=
_mm256_mul_ps
(
vout
,
_mm256_set1_ps
(
SCALE_1
));
_mm256_storeu_ps
(
&
_out
[
i
],
vout
);
}
for
(
i
=
0
;
i
<
rows
;
i
++
)
_out
[
i
]
=
SCALE_1
*
out
[
i
];
}
#else
static
inline
void
sgemv_accum8x4
(
float
*
out
,
const
qweight
*
w
,
int
rows
,
int
cols
,
int
col_stride
,
const
float
*
_x
)
...
...
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