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
a96585d6
"src/targets/gpu/device/sub.cpp" did not exist on "a919e88a10412c23c7fa229422d217b5c83c9ed3"
Commit
a96585d6
authored
Mar 23, 2022
by
Shucai Xiao
Browse files
Merge branch 'ref_gemm_par' of github.com:ROCmSoftwarePlatform/AMDMIGraphX into layernorm_half2
parents
c1ec929c
9b19b73f
Changes
13
Show whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
11 additions
and
14 deletions
+11
-14
src/argument.cpp
src/argument.cpp
+5
-1
src/include/migraphx/op/as_shape.hpp
src/include/migraphx/op/as_shape.hpp
+0
-1
src/include/migraphx/op/broadcast.hpp
src/include/migraphx/op/broadcast.hpp
+0
-1
src/include/migraphx/op/flatten.hpp
src/include/migraphx/op/flatten.hpp
+0
-1
src/include/migraphx/op/multibroadcast.hpp
src/include/migraphx/op/multibroadcast.hpp
+0
-1
src/include/migraphx/op/reshape.hpp
src/include/migraphx/op/reshape.hpp
+0
-1
src/include/migraphx/op/scalar.hpp
src/include/migraphx/op/scalar.hpp
+0
-1
src/include/migraphx/op/squeeze.hpp
src/include/migraphx/op/squeeze.hpp
+0
-1
src/include/migraphx/op/step.hpp
src/include/migraphx/op/step.hpp
+0
-2
src/include/migraphx/op/transpose.hpp
src/include/migraphx/op/transpose.hpp
+0
-1
src/include/migraphx/op/unsqueeze.hpp
src/include/migraphx/op/unsqueeze.hpp
+0
-1
src/include/migraphx/shape.hpp
src/include/migraphx/shape.hpp
+2
-0
src/targets/ref/gemm.cpp
src/targets/ref/gemm.cpp
+4
-2
No files found.
src/argument.cpp
View file @
a96585d6
...
...
@@ -106,7 +106,11 @@ bool argument::empty() const { return not m_data.get and m_data.sub.empty(); }
const
shape
&
argument
::
get_shape
()
const
{
return
this
->
m_shape
;
}
argument
argument
::
reshape
(
const
shape
&
s
)
const
{
return
{
s
,
this
->
m_data
};
}
argument
argument
::
reshape
(
const
shape
&
s
)
const
{
assert
(
s
.
element_space
()
<=
this
->
get_shape
().
element_space
());
return
{
s
,
this
->
m_data
};
}
argument
::
data_t
argument
::
data_t
::
share
()
const
{
...
...
src/include/migraphx/op/as_shape.hpp
View file @
a96585d6
...
...
@@ -36,7 +36,6 @@ struct as_shape
{
return
args
.
front
().
reshape
(
output_shape
);
}
lifetime
get_lifetime
()
const
{
return
lifetime
::
borrow
;
}
std
::
ptrdiff_t
output_alias
(
const
std
::
vector
<
shape
>&
)
const
{
return
0
;
}
};
...
...
src/include/migraphx/op/broadcast.hpp
View file @
a96585d6
...
...
@@ -67,7 +67,6 @@ struct broadcast
{
return
args
[
0
].
reshape
(
output_shape
);
}
lifetime
get_lifetime
()
const
{
return
lifetime
::
borrow
;
}
std
::
ptrdiff_t
output_alias
(
const
std
::
vector
<
shape
>&
)
const
{
return
0
;
}
};
...
...
src/include/migraphx/op/flatten.hpp
View file @
a96585d6
...
...
@@ -51,7 +51,6 @@ struct flatten
{
return
args
[
0
].
reshape
(
output_shape
);
}
lifetime
get_lifetime
()
const
{
return
lifetime
::
borrow
;
}
std
::
ptrdiff_t
output_alias
(
const
std
::
vector
<
shape
>&
)
const
{
return
0
;
}
};
...
...
src/include/migraphx/op/multibroadcast.hpp
View file @
a96585d6
...
...
@@ -69,7 +69,6 @@ struct multibroadcast
{
return
args
[
0
].
reshape
(
output_shape
);
}
lifetime
get_lifetime
()
const
{
return
lifetime
::
borrow
;
}
std
::
ptrdiff_t
output_alias
(
const
std
::
vector
<
shape
>&
)
const
{
return
0
;
}
};
...
...
src/include/migraphx/op/reshape.hpp
View file @
a96585d6
...
...
@@ -75,7 +75,6 @@ struct reshape
return
args
[
0
].
reshape
(
output_shape
);
}
lifetime
get_lifetime
()
const
{
return
lifetime
::
borrow
;
}
std
::
ptrdiff_t
output_alias
(
const
std
::
vector
<
shape
>&
)
const
{
return
0
;
}
};
...
...
src/include/migraphx/op/scalar.hpp
View file @
a96585d6
...
...
@@ -40,7 +40,6 @@ struct scalar
{
return
args
[
0
].
reshape
(
output_shape
);
}
lifetime
get_lifetime
()
const
{
return
lifetime
::
borrow
;
}
std
::
ptrdiff_t
output_alias
(
const
std
::
vector
<
shape
>&
)
const
{
return
0
;
}
};
...
...
src/include/migraphx/op/squeeze.hpp
View file @
a96585d6
...
...
@@ -84,7 +84,6 @@ struct squeeze
{
return
args
[
0
].
reshape
(
output_shape
);
}
lifetime
get_lifetime
()
const
{
return
lifetime
::
borrow
;
}
std
::
ptrdiff_t
output_alias
(
const
std
::
vector
<
shape
>&
)
const
{
return
0
;
}
};
...
...
src/include/migraphx/op/step.hpp
View file @
a96585d6
...
...
@@ -72,8 +72,6 @@ struct step
return
args
[
0
].
reshape
(
output_shape
);
}
lifetime
get_lifetime
()
const
{
return
lifetime
::
borrow
;
}
std
::
ptrdiff_t
output_alias
(
const
std
::
vector
<
shape
>&
)
const
{
return
0
;
}
};
...
...
src/include/migraphx/op/transpose.hpp
View file @
a96585d6
...
...
@@ -56,7 +56,6 @@ struct transpose
{
return
args
[
0
].
reshape
(
output_shape
);
}
lifetime
get_lifetime
()
const
{
return
lifetime
::
borrow
;
}
std
::
ptrdiff_t
output_alias
(
const
std
::
vector
<
shape
>&
)
const
{
return
0
;
}
};
...
...
src/include/migraphx/op/unsqueeze.hpp
View file @
a96585d6
...
...
@@ -81,7 +81,6 @@ struct unsqueeze
{
return
args
[
0
].
reshape
(
output_shape
);
}
lifetime
get_lifetime
()
const
{
return
lifetime
::
borrow
;
}
std
::
ptrdiff_t
output_alias
(
const
std
::
vector
<
shape
>&
)
const
{
return
0
;
}
};
...
...
src/include/migraphx/shape.hpp
View file @
a96585d6
...
...
@@ -226,6 +226,8 @@ struct shape
const
std
::
vector
<
shape
>&
sub_shapes
()
const
;
std
::
size_t
element_space
()
const
;
std
::
size_t
element_space
()
const
;
private:
shape
(
std
::
shared_ptr
<
shape_impl
>
pimpl
);
std
::
shared_ptr
<
const
shape_impl
>
impl
;
...
...
src/targets/ref/gemm.cpp
View file @
a96585d6
#include <migraphx/ref/gemm.hpp>
#include <migraphx/dfor.hpp>
#include <migraphx/requires.hpp>
#include <migraphx/
shape_for_each
.hpp>
#include <migraphx/
par_for
.hpp>
#include <blaze/math/CustomMatrix.h>
namespace
migraphx
{
...
...
@@ -74,8 +74,10 @@ void migemm_impl(
assert
(
amat
.
get_shape
().
lens
()[
dim_1
]
==
bmat
.
get_shape
().
lens
()[
dim_0
]);
assert
(
cmat
.
get_shape
().
lens
()[
dim_0
]
==
amat
.
get_shape
().
lens
()[
dim_0
]);
assert
(
cmat
.
get_shape
().
lens
()[
dim_1
]
==
bmat
.
get_shape
().
lens
()[
dim_1
]);
auto
cs
=
cmat
.
get_shape
();
shape_for_each
(
cmat
.
get_shape
(),
[
&
](
const
auto
&
c_idx
)
{
par_for
(
cs
.
elements
(),
[
&
](
auto
i
)
{
auto
c_idx
=
cs
.
multi
(
i
);
auto
a_idx
=
c_idx
;
auto
b_idx
=
c_idx
;
double
s
=
0.0
;
...
...
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