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
f4178abd
Commit
f4178abd
authored
Apr 29, 2019
by
Khalique
Browse files
formatting
parent
9a2c7339
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
14 additions
and
13 deletions
+14
-13
src/onnx/onnx.cpp
src/onnx/onnx.cpp
+3
-1
src/targets/cpu/lowering.cpp
src/targets/cpu/lowering.cpp
+1
-1
src/targets/gpu/clip.cpp
src/targets/gpu/clip.cpp
+2
-3
src/targets/gpu/device/clip.cpp
src/targets/gpu/device/clip.cpp
+4
-4
src/targets/gpu/include/migraphx/gpu/device/clip.hpp
src/targets/gpu/include/migraphx/gpu/device/clip.hpp
+4
-4
No files found.
src/onnx/onnx.cpp
View file @
f4178abd
...
@@ -226,7 +226,9 @@ struct onnx_parser
...
@@ -226,7 +226,9 @@ struct onnx_parser
});
});
}
}
instruction_ref
parse_clip
(
const
std
::
string
&
,
const
attribute_map
&
attributes
,
std
::
vector
<
instruction_ref
>
args
)
instruction_ref
parse_clip
(
const
std
::
string
&
,
const
attribute_map
&
attributes
,
std
::
vector
<
instruction_ref
>
args
)
{
{
op
::
clip
op
;
op
::
clip
op
;
if
(
contains
(
attributes
,
"max"
))
if
(
contains
(
attributes
,
"max"
))
...
...
src/targets/cpu/lowering.cpp
View file @
f4178abd
...
@@ -148,7 +148,7 @@ struct clip_op
...
@@ -148,7 +148,7 @@ struct clip_op
{
{
auto
&
max
=
op
.
max_val
;
auto
&
max
=
op
.
max_val
;
auto
&
min
=
op
.
min_val
;
auto
&
min
=
op
.
min_val
;
return
[
max
,
min
](
auto
x
)
{
return
x
>
min
?
(
x
<
max
?
x
:
max
)
:
min
;
};
return
[
max
,
min
](
auto
x
)
{
return
x
>
min
?
(
x
<
max
?
x
:
max
)
:
min
;
};
}
}
};
};
...
...
src/targets/gpu/clip.cpp
View file @
f4178abd
...
@@ -12,9 +12,8 @@ shape hip_clip::compute_shape(std::vector<shape> inputs) const
...
@@ -12,9 +12,8 @@ shape hip_clip::compute_shape(std::vector<shape> inputs) const
return
op
.
compute_shape
(
inputs
);
return
op
.
compute_shape
(
inputs
);
}
}
argument
hip_clip
::
compute
(
context
&
ctx
,
argument
const
shape
&
output_shape
,
hip_clip
::
compute
(
context
&
ctx
,
const
shape
&
output_shape
,
const
std
::
vector
<
argument
>&
args
)
const
const
std
::
vector
<
argument
>&
args
)
const
{
{
assert
(
output_shape
==
args
.
back
().
get_shape
());
assert
(
output_shape
==
args
.
back
().
get_shape
());
(
void
)
output_shape
;
(
void
)
output_shape
;
...
...
src/targets/gpu/device/clip.cpp
View file @
f4178abd
...
@@ -7,10 +7,10 @@ namespace gpu {
...
@@ -7,10 +7,10 @@ namespace gpu {
namespace
device
{
namespace
device
{
void
clip
(
hipStream_t
stream
,
void
clip
(
hipStream_t
stream
,
const
argument
&
result
,
const
argument
&
result
,
const
argument
&
arg1
,
const
argument
&
arg1
,
const
float
&
max
,
const
float
&
max
,
const
float
&
min
)
const
float
&
min
)
{
{
nary
(
stream
,
result
,
arg1
)(
nary
(
stream
,
result
,
arg1
)(
[
max
,
min
](
auto
x
)
{
return
std
::
min
<
decltype
(
x
)
>
(
std
::
max
<
decltype
(
x
)
>
(
min
,
x
),
max
);
});
[
max
,
min
](
auto
x
)
{
return
std
::
min
<
decltype
(
x
)
>
(
std
::
max
<
decltype
(
x
)
>
(
min
,
x
),
max
);
});
...
...
src/targets/gpu/include/migraphx/gpu/device/clip.hpp
View file @
f4178abd
...
@@ -11,10 +11,10 @@ namespace gpu {
...
@@ -11,10 +11,10 @@ namespace gpu {
namespace
device
{
namespace
device
{
void
clip
(
hipStream_t
stream
,
void
clip
(
hipStream_t
stream
,
const
argument
&
result
,
const
argument
&
result
,
const
argument
&
arg1
,
const
argument
&
arg1
,
const
float
&
max
,
const
float
&
max
,
const
float
&
min
);
const
float
&
min
);
}
// namespace device
}
// namespace device
}
// namespace gpu
}
// namespace gpu
...
...
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