clip.cpp 609 Bytes
Newer Older
Khalique's avatar
Khalique committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#include <migraphx/gpu/clip.hpp>
#include <migraphx/gpu/context.hpp>
#include <migraphx/gpu/device/clip.hpp>

namespace migraphx {
inline namespace MIGRAPHX_INLINE_NS {
namespace gpu {

shape hip_clip::compute_shape(std::vector<shape> inputs) const
{
    inputs.pop_back();
    return op.compute_shape(inputs);
}

Khalique's avatar
Khalique committed
15
argument hip_clip::compute(context& ctx, const shape&, const std::vector<argument>& args) const
Khalique's avatar
Khalique committed
16
17
18
19
20
21
22
23
{
    device::clip(ctx.get_stream().get(), args.back(), args.front(), op.max_val, op.min_val);
    return args.back();
}

} // namespace gpu
} // namespace MIGRAPHX_INLINE_NS
} // namespace migraphx