Commit 752d3ac5 authored by Shucai Xiao's avatar Shucai Xiao
Browse files

clang format

parent cbfbd04c
......@@ -40,7 +40,7 @@ struct convert : unary<convert>
{
return [&](auto x) {
float res = scale * x + shift;
if (target_type == shape::int8_type)
if(target_type == shape::int8_type)
{
res = res > 127.0 ? 127.0 : res;
res = res < -128.0 ? -128.0 : res;
......
......@@ -19,11 +19,10 @@ void convert(hipStream_t stream,
auto* output_ptr = device_cast(output.data());
if(target_type == shape::int8_type)
{
gs_launch(stream, result.get_shape().elements())(
[=](auto i) {
output_ptr[i] = std::min<int8_t>(std::max<float>(-128, input_ptr[i]
* scale + shift), 127);
});
gs_launch(stream, result.get_shape().elements())([=](auto i) {
output_ptr[i] =
std::min<int8_t>(std::max<float>(-128, input_ptr[i] * scale + shift), 127);
});
}
else
{
......
......@@ -11,8 +11,12 @@ inline namespace MIGRAPHX_INLINE_NS {
namespace gpu {
namespace device {
void convert(
hipStream_t stream, const argument& result, const argument& arg, float scale, float shift, shape::type_t target_type);
void convert(hipStream_t stream,
const argument& result,
const argument& arg,
float scale,
float shift,
shape::type_t target_type);
} // namespace device
} // namespace gpu
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment