Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
jerrrrry
infinicore
Commits
4f1244be
Commit
4f1244be
authored
Apr 07, 2025
by
xgqdut2016
Browse files
issue/130: use collapse
parent
23524591
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
26 deletions
+24
-26
src/infiniop/ops/gemm/cpu/gemm_cpu.cc
src/infiniop/ops/gemm/cpu/gemm_cpu.cc
+24
-26
No files found.
src/infiniop/ops/gemm/cpu/gemm_cpu.cc
View file @
4f1244be
...
...
@@ -42,14 +42,10 @@ void calculate(
if
(
info
.
is_transed
)
{
std
::
swap
(
a
,
b
);
}
#pragma omp parallel for
for
(
ptrdiff_t
index
=
0
;
index
<
ptrdiff_t
(
info
.
batch
*
info
.
m
*
info
.
n
);
++
index
)
{
size_t
ind
=
index
;
size_t
n_
=
ind
%
info
.
n
;
ind
/=
info
.
n
;
size_t
m_
=
ind
%
info
.
m
;
ind
/=
info
.
m
;
size_t
i
=
ind
;
#pragma omp parallel for collapse(3)
for
(
size_t
i
=
0
;
i
<
info
.
batch
;
++
i
)
{
for
(
size_t
m_
=
0
;
m_
<
info
.
m
;
++
m_
)
{
for
(
size_t
n_
=
0
;
n_
<
info
.
n
;
++
n_
)
{
auto
c_
=
reinterpret_cast
<
Tdata
*>
(
c
)
+
i
*
info
.
c_matrix
.
stride
+
m_
*
info
.
c_matrix
.
row_stride
+
n_
*
info
.
c_matrix
.
col_stride
;
float
sum
=
0
;
for
(
size_t
k_
=
0
;
k_
<
info
.
k
;
++
k_
)
{
...
...
@@ -71,6 +67,8 @@ void calculate(
*
c_
=
beta
*
(
*
c_
)
+
alpha
*
sum
;
}
}
}
}
}
infiniStatus_t
Descriptor
::
calculate
(
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment