Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
gaoqiong
MIGraphX
Commits
318dbc15
Commit
318dbc15
authored
Aug 27, 2019
by
Shucai Xiao
Browse files
clang format
parent
5e951d3b
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
14 deletions
+7
-14
src/quantization.cpp
src/quantization.cpp
+1
-3
tools/include/target.hpp
tools/include/target.hpp
+6
-11
No files found.
src/quantization.cpp
View file @
318dbc15
...
@@ -516,9 +516,7 @@ capture_arguments(program& prog, const target& t, const std::vector<std::string>
...
@@ -516,9 +516,7 @@ capture_arguments(program& prog, const target& t, const std::vector<std::string>
// consider shift, so set shift to 0
// consider shift, so set shift to 0
std
::
vector
<
float
>
vec_val
;
std
::
vector
<
float
>
vec_val
;
auto
&&
arg
=
t
.
copy_from
(
args
.
front
());
auto
&&
arg
=
t
.
copy_from
(
args
.
front
());
arg
.
visit
([
&
](
auto
output
)
{
arg
.
visit
([
&
](
auto
output
)
{
vec_val
.
assign
(
output
.
begin
(),
output
.
end
());
});
vec_val
.
assign
(
output
.
begin
(),
output
.
end
());
});
auto
max_val
=
*
std
::
max_element
(
vec_val
.
begin
(),
vec_val
.
end
());
auto
max_val
=
*
std
::
max_element
(
vec_val
.
begin
(),
vec_val
.
end
());
auto
min_val
=
*
std
::
min_element
(
vec_val
.
begin
(),
vec_val
.
end
());
auto
min_val
=
*
std
::
min_element
(
vec_val
.
begin
(),
vec_val
.
end
());
auto
max_abs
=
std
::
max
(
std
::
fabs
(
max_val
),
std
::
fabs
(
min_val
));
auto
max_abs
=
std
::
max
(
std
::
fabs
(
max_val
),
std
::
fabs
(
min_val
));
...
...
tools/include/target.hpp
View file @
318dbc15
...
@@ -57,14 +57,12 @@ struct target
...
@@ -57,14 +57,12 @@ struct target
* @return Allocated argument in the target.
* @return Allocated argument in the target.
*/
*/
argument
allocate
(
const
shape
&
s
)
const
;
argument
allocate
(
const
shape
&
s
)
const
;
};
};
#else
#else
template
<
class
T
>
template
<
class
T
>
auto
target_allocate
(
rank
<
1
>
,
T
&
x
,
const
shape
&
s
)
auto
target_allocate
(
rank
<
1
>
,
T
&
x
,
const
shape
&
s
)
->
decltype
(
x
.
allocate
(
s
))
->
decltype
(
x
.
allocate
(
s
))
{
{
return
x
.
allocate
(
s
);
return
x
.
allocate
(
s
);
}
}
...
@@ -84,8 +82,7 @@ argument target_allocate(T& x, const shape& s)
...
@@ -84,8 +82,7 @@ argument target_allocate(T& x, const shape& s)
}
}
template
<
class
T
>
template
<
class
T
>
auto
copy_to_target
(
rank
<
1
>
,
T
&
x
,
const
argument
&
arg
)
auto
copy_to_target
(
rank
<
1
>
,
T
&
x
,
const
argument
&
arg
)
->
decltype
(
x
.
copy_to
(
arg
))
->
decltype
(
x
.
copy_to
(
arg
))
{
{
return
x
.
copy_to
(
arg
);
return
x
.
copy_to
(
arg
);
}
}
...
@@ -106,9 +103,7 @@ argument copy_to_target(T& x, const argument& arg)
...
@@ -106,9 +103,7 @@ argument copy_to_target(T& x, const argument& arg)
}
}
template
<
class
T
>
template
<
class
T
>
auto
copy_from_target
(
auto
copy_from_target
(
rank
<
1
>
,
T
&
x
,
const
argument
&
arg
)
->
decltype
(
x
.
copy_from
(
arg
))
rank
<
1
>
,
T
&
x
,
const
argument
&
arg
)
->
decltype
(
x
.
copy_from
(
arg
))
{
{
return
x
.
copy_from
(
arg
);
return
x
.
copy_from
(
arg
);
}
}
...
...
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