MCPcopy Create free account
hub / github.com/MegEngine/MegEngine / exec_internal

Method exec_internal

dnn/src/rocm/param_pack/opr_impl.cpp:15–33  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

13
14template <typename T>
15void ParamPackConcatImpl::exec_internal(
16 _megdnn_tensor_in srcs, _megdnn_tensor_in offsets, _megdnn_tensor_out dst,
17 _megdnn_workspace workspace) {
18 size_t inp_size = srcs.layout.shape[0], out_size = dst.layout.total_nr_elems();
19 auto stream = hip_stream(this->handle());
20
21 auto src_cpu = static_cast<const T**>(srcs.raw_ptr());
22 megdnn_assert_internal(src_cpu);
23 auto src_gpu = reinterpret_cast<const T**>(workspace.raw_ptr);
24
25 auto offsets_gpu = offsets.ptr<int32_t>();
26
27 hip_check(hipMemcpyAsync(
28 src_gpu, src_cpu, sizeof(const T*) * inp_size, hipMemcpyHostToDevice,
29 stream));
30
31 param_pack::concat_proxy<T>(
32 src_gpu, dst.ptr<T>(), inp_size, out_size, offsets_gpu, stream);
33}
34
35void ParamPackConcatImpl::exec(
36 _megdnn_tensor_in srcs, _megdnn_tensor_in offsets, _megdnn_tensor_out dst,

Callers

nothing calls this directly

Calls 4

hip_streamFunction · 0.85
total_nr_elemsMethod · 0.45
handleMethod · 0.45
raw_ptrMethod · 0.45

Tested by

no test coverage detected