max.cpp 719 Bytes
Newer Older
Khalique's avatar
Khalique committed
1
2
3
#include <migraphx/gpu/max.hpp>
#include <migraphx/operators.hpp>
#include <migraphx/manage_ptr.hpp>
Khalique's avatar
Khalique committed
4
#include <migraphx/config.hpp>
Khalique's avatar
Khalique committed
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#include <migraphx/gpu/miopen.hpp>
#include <utility>

namespace migraphx {
inline namespace MIGRAPH_INLINE_NS {
namespace gpu {

shape hip_max::compute_shape(const std::vector<shape>& inputs) const
{
    // check_shapes{inputs, *this}.has(3).standard();
    check_shapes{inputs, *this}.has(3);
    return inputs.at(0);
}

argument hip_max::compute(context& ctx, const shape&, const std::vector<argument>& args) const
{
    device::max(ctx.get_stream().get(), args[2], args[0], args[1]);
    return args[2];
}

} // namespace gpu
} // namespace MIGRAPH_INLINE_NS
} // namespace migraphx