"docker/vscode:/vscode.git/clone" did not exist on "86058278b7d9370ac9c22e90aafda75d5d874488"
convert.cpp 735 Bytes
Newer Older
1
#include <migraphx/gpu/device/convert.hpp>
2
3
4
5
6
7
8
9
#include <migraphx/gpu/device/nary.hpp>

namespace migraphx {
inline namespace MIGRAPHX_INLINE_NS {
namespace gpu {
namespace device {

argument
10
convert(hipStream_t stream, const argument& result, const argument& arg)
11
{
12
13
    result.visit([&](auto output) {
        arg.visit([&](auto input) {
14
15
16
            const auto* input_ptr = device_cast(input.data());
            auto* output_ptr      = device_cast(output.data());
            gs_launch(stream,
17
                      result.get_shape().elements())([=](auto i) { output_ptr[i] = input_ptr[i]; });
18
19
20
        });
    });

21
    return result;
22
23
24
25
26
27
}

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