contiguous.cpp 875 Bytes
Newer Older
Paul's avatar
Paul committed
1
2
3
4
#include <migraphx/gpu/contiguous.hpp>
#include <migraphx/operators.hpp>
#include <migraphx/manage_ptr.hpp>
#include <migraphx/gpu/miopen.hpp>
5
6
#include <utility>

Paul's avatar
Paul committed
7
namespace migraphx {
8
inline namespace MIGRAPH_INLINE_NS {
9
10
11
12
13
14
15
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
16
17
18
argument miopen_contiguous::compute(context& ctx,
                                    shape output_shape,
                                    const std::vector<argument>& args) const
19
20
21
22
{
    assert(output_shape == args[1].get_shape());
    assert(output_shape.standard());
    (void)output_shape;
Paul's avatar
Paul committed
23
    device::contiguous(ctx.get_stream().get(), args.at(1), args.at(0));
24
25
26
27
    return args.at(1);
}

} // namespace gpu
28
} // namespace MIGRAPH_INLINE_NS
Paul's avatar
Paul committed
29
} // namespace migraphx