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

Function get_workspace_in_bytes

dnn/src/common/rnn_cell.cpp:70–81  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

68namespace rnn_cell {
69
70size_t get_workspace_in_bytes(
71 const TensorLayout& input, const TensorLayout& weight_ih,
72 const TensorLayout& /*bias_ih*/, const TensorLayout& hx,
73 const TensorLayout& weight_hh, const TensorLayout& /*bias_hh*/,
74 const TensorLayout& dst, Handle* handle) {
75 auto opr = handle->create_operator<MatrixMulForward>();
76 opr->param().transposeB = true;
77 return dst.span().dist_byte() +
78 std::max(
79 opr->get_workspace_in_bytes(hx, weight_hh, dst),
80 opr->get_workspace_in_bytes(input, weight_ih, dst));
81}
82
83void exec(
84 _megdnn_tensor_in input, _megdnn_tensor_in weight_ih, _megdnn_tensor_in bias_ih,

Callers 15

check_execMethod · 0.70
check_execMethod · 0.70
check_execMethod · 0.70
check_execMethod · 0.70
check_execMethod · 0.70
check_execMethod · 0.70
check_execMethod · 0.70
check_execMethod · 0.70
check_execMethod · 0.70
check_execMethod · 0.70
check_execMethod · 0.70

Calls 5

maxFunction · 0.85
dist_byteMethod · 0.80
spanMethod · 0.80
paramMethod · 0.45

Tested by 2

check_execMethod · 0.56