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
gaoqiong
MIGraphX
Commits
0b5fa390
"runner/vscode:/vscode.git/clone" did not exist on "1a2feb2a970c8331e1d34f68877190c169999c44"
Commit
0b5fa390
authored
Aug 04, 2018
by
Paul
Browse files
Formatting
parent
5b1e442e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
31 additions
and
19 deletions
+31
-19
src/targets/cpu/gemm.cpp
src/targets/cpu/gemm.cpp
+29
-18
src/targets/cpu/include/migraph/cpu/gemm.hpp
src/targets/cpu/include/migraph/cpu/gemm.hpp
+2
-1
No files found.
src/targets/cpu/gemm.cpp
View file @
0b5fa390
...
@@ -29,18 +29,23 @@ static void visit_mat(tensor_view<T> x, F f)
...
@@ -29,18 +29,23 @@ static void visit_mat(tensor_view<T> x, F f)
f
(
mat
);
f
(
mat
);
}
}
template
<
class
T
>
template
<
class
T
>
struct
is_fast_gemm_type
struct
is_fast_gemm_type
:
std
::
false_type
:
std
::
false_type
{
{
};
};
template
<
>
template
<
>
struct
is_fast_gemm_type
<
float
>
struct
is_fast_gemm_type
<
float
>
:
std
::
true_type
:
std
::
true_type
{
{
};
};
template
<
class
T
>
template
<
class
T
>
void
migemm_impl
(
tensor_view
<
T
>
cmat
,
tensor_view
<
T
>
amat
,
tensor_view
<
T
>
bmat
,
float
alpha
,
float
beta
,
std
::
true_type
)
void
migemm_impl
(
tensor_view
<
T
>
cmat
,
tensor_view
<
T
>
amat
,
tensor_view
<
T
>
bmat
,
float
alpha
,
float
beta
,
std
::
true_type
)
{
{
visit_mat
(
amat
,
[
&
](
const
auto
&
a
)
{
visit_mat
(
amat
,
[
&
](
const
auto
&
a
)
{
visit_mat
(
bmat
,
[
&
](
const
auto
&
b
)
{
visit_mat
(
bmat
,
[
&
](
const
auto
&
b
)
{
...
@@ -53,8 +58,13 @@ void migemm_impl(tensor_view<T> cmat, tensor_view<T> amat, tensor_view<T> bmat,
...
@@ -53,8 +58,13 @@ void migemm_impl(tensor_view<T> cmat, tensor_view<T> amat, tensor_view<T> bmat,
});
});
}
}
template
<
class
T
>
template
<
class
T
>
void
migemm_impl
(
tensor_view
<
T
>
cmat
,
tensor_view
<
T
>
amat
,
tensor_view
<
T
>
bmat
,
float
alpha
,
float
beta
,
std
::
false_type
)
void
migemm_impl
(
tensor_view
<
T
>
cmat
,
tensor_view
<
T
>
amat
,
tensor_view
<
T
>
bmat
,
float
alpha
,
float
beta
,
std
::
false_type
)
{
{
(
void
)
cmat
;
(
void
)
cmat
;
(
void
)
amat
;
(
void
)
amat
;
...
@@ -64,17 +74,18 @@ void migemm_impl(tensor_view<T> cmat, tensor_view<T> amat, tensor_view<T> bmat,
...
@@ -64,17 +74,18 @@ void migemm_impl(tensor_view<T> cmat, tensor_view<T> amat, tensor_view<T> bmat,
assert
(
true
&&
"TODO"
);
assert
(
true
&&
"TODO"
);
}
}
template
<
class
T
>
template
<
class
T
>
void
migemm_impl
(
tensor_view
<
T
>
cmat
,
tensor_view
<
T
>
amat
,
tensor_view
<
T
>
bmat
,
float
alpha
,
float
beta
)
void
migemm_impl
(
tensor_view
<
T
>
cmat
,
tensor_view
<
T
>
amat
,
tensor_view
<
T
>
bmat
,
float
alpha
,
float
beta
)
{
{
migemm_impl
(
cmat
,
amat
,
bmat
,
alpha
,
beta
,
is_fast_gemm_type
<
T
>
{});
migemm_impl
(
cmat
,
amat
,
bmat
,
alpha
,
beta
,
is_fast_gemm_type
<
T
>
{});
}
}
void
migemm
(
const
argument
&
c_arg
,
const
argument
&
a_arg
,
const
argument
&
b_arg
,
float
alpha
,
float
beta
)
void
migemm
(
const
argument
&
c_arg
,
const
argument
&
a_arg
,
const
argument
&
b_arg
,
float
alpha
,
float
beta
)
{
{
visit_all
(
c_arg
,
a_arg
,
b_arg
)([
&
](
auto
cmat
,
auto
amat
,
auto
bmat
)
{
visit_all
(
c_arg
,
a_arg
,
b_arg
)(
migemm_impl
(
cmat
,
amat
,
bmat
,
alpha
,
beta
);
[
&
](
auto
cmat
,
auto
amat
,
auto
bmat
)
{
migemm_impl
(
cmat
,
amat
,
bmat
,
alpha
,
beta
);
});
});
}
}
}
// namespace cpu
}
// namespace cpu
...
...
src/targets/cpu/include/migraph/cpu/gemm.hpp
View file @
0b5fa390
...
@@ -6,7 +6,8 @@
...
@@ -6,7 +6,8 @@
namespace
migraph
{
namespace
migraph
{
namespace
cpu
{
namespace
cpu
{
void
migemm
(
const
argument
&
c_arg
,
const
argument
&
a_arg
,
const
argument
&
b_arg
,
float
alpha
,
float
beta
);
void
migemm
(
const
argument
&
c_arg
,
const
argument
&
a_arg
,
const
argument
&
b_arg
,
float
alpha
,
float
beta
);
}
// namespace cpu
}
// namespace cpu
...
...
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