logsoftmax.cpp 824 Bytes
Newer Older
1
#include <migraphx/gpu/logsoftmax.hpp>
2
#include <migraphx/gpu/device/logsoftmax.hpp>
3
#include <migraphx/op/logsoftmax.hpp>
4
5
6
7
8
9
10
11
#include <migraphx/manage_ptr.hpp>
#include <migraphx/gpu/miopen.hpp>
#include <utility>

namespace migraphx {
inline namespace MIGRAPHX_INLINE_NS {
namespace gpu {

12
shape hip_logsoftmax::compute_shape(const std::vector<shape>& inputs) const
13
14
15
16
17
{
    check_shapes{inputs, *this}.has(2).standard();
    return op.compute_shape({inputs.at(0)});
}

18
argument hip_logsoftmax::compute(context& ctx,
19
                                 const shape&,
Shucai Xiao's avatar
Shucai Xiao committed
20
                                 const std::vector<argument>& args) const
21
{
22
23
    device::logsoftmax(ctx.get_stream().get(), args.back(), args.front(), op.axis);
    return args.back();
24
25
26
27
28
}

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