logsoftmax.cpp 758 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)});
}

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

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