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
d4b83ad4
Commit
d4b83ad4
authored
Apr 19, 2022
by
Paul
Browse files
Format
parent
063ba0c4
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
6 deletions
+7
-6
src/targets/gpu/jit/pointwise.cpp
src/targets/gpu/jit/pointwise.cpp
+3
-2
src/targets/gpu/kernels/include/migraphx/kernels/vectorize.hpp
...argets/gpu/kernels/include/migraphx/kernels/vectorize.hpp
+4
-4
No files found.
src/targets/gpu/jit/pointwise.cpp
View file @
d4b83ad4
...
@@ -43,10 +43,11 @@ struct pointwise_compiler : compiler<pointwise_compiler>
...
@@ -43,10 +43,11 @@ struct pointwise_compiler : compiler<pointwise_compiler>
static
std
::
size_t
oversubscribe
(
const
std
::
vector
<
shape
>&
inputs
)
static
std
::
size_t
oversubscribe
(
const
std
::
vector
<
shape
>&
inputs
)
{
{
// if(std::any_of(inputs.begin(), inputs.end(), [](const auto& s) { return s.broadcasted(); }))
// if(std::any_of(inputs.begin(), inputs.end(), [](const auto& s) { return s.broadcasted();
// }))
// return 1;
// return 1;
// else
// else
return
4
;
return
4
;
}
}
static
std
::
size_t
vectorize_elements
(
const
std
::
vector
<
shape
>&
inputs
)
static
std
::
size_t
vectorize_elements
(
const
std
::
vector
<
shape
>&
inputs
)
{
{
...
...
src/targets/gpu/kernels/include/migraphx/kernels/vectorize.hpp
View file @
d4b83ad4
...
@@ -110,14 +110,14 @@ template <class... Shapes>
...
@@ -110,14 +110,14 @@ template <class... Shapes>
constexpr
index_int
find_vector_axis_c
(
Shapes
...
ss
)
constexpr
index_int
find_vector_axis_c
(
Shapes
...
ss
)
{
{
// const bool all_broadcasted = (ss.broadcasted() and ...);
// const bool all_broadcasted = (ss.broadcasted() and ...);
index_int
axis
=
0
;
index_int
axis
=
0
;
bool
b
=
false
;
bool
b
=
false
;
by
([
&
](
auto
s
)
{
by
([
&
](
auto
s
)
{
if
(
b
)
if
(
b
)
return
;
return
;
// Skip broadcasted shapes if there are shapes not broadcasted
// Skip broadcasted shapes if there are shapes not broadcasted
// if(not all_broadcasted and s.broadcasted())
// if(not all_broadcasted and s.broadcasted())
// return;
// return;
axis
=
find_vector_axis_c
(
s
);
axis
=
find_vector_axis_c
(
s
);
if
(
s
.
strides
[
axis
]
==
1
)
if
(
s
.
strides
[
axis
]
==
1
)
b
=
true
;
b
=
true
;
...
@@ -154,7 +154,7 @@ constexpr auto find_vectorize_size(P pred)
...
@@ -154,7 +154,7 @@ constexpr auto find_vectorize_size(P pred)
{
{
// if constexpr(decltype(pred(_c<4>)){})
// if constexpr(decltype(pred(_c<4>)){})
// return _c<4>;
// return _c<4>;
// else
// else
if
constexpr
(
decltype
(
pred
(
_c
<
2
>
)){})
if
constexpr
(
decltype
(
pred
(
_c
<
2
>
)){})
return
_c
<
2
>
;
return
_c
<
2
>
;
else
else
...
...
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