contiguous.cpp 836 Bytes
Newer Older
Paul's avatar
Paul committed
1
#include <migraphx/gpu/contiguous.hpp>
Paul's avatar
Paul committed
2
3
#include <migraphx/gpu/context.hpp>
#include <migraphx/gpu/device/contiguous.hpp>
4

Paul's avatar
Paul committed
5
namespace migraphx {
Paul's avatar
Paul committed
6
inline namespace MIGRAPHX_INLINE_NS {
7
8
9
10
11
12
13
namespace gpu {

shape miopen_contiguous::compute_shape(const std::vector<shape>& inputs) const
{
    check_shapes{inputs, *this}.has(2);
    return op.compute_shape({inputs.at(0)});
}
Paul's avatar
Paul committed
14
15
16
argument miopen_contiguous::compute(context& ctx,
                                    shape output_shape,
                                    const std::vector<argument>& args) const
17
18
19
20
{
    assert(output_shape == args[1].get_shape());
    assert(output_shape.standard());
    (void)output_shape;
Paul's avatar
Paul committed
21
    device::contiguous(ctx.get_stream().get(), args.at(1), args.at(0));
22
23
24
25
    return args.at(1);
}

} // namespace gpu
Paul's avatar
Paul committed
26
} // namespace MIGRAPHX_INLINE_NS
Paul's avatar
Paul committed
27
} // namespace migraphx