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

Method do_exec_ct

dnn/src/cambricon/powc/opr_impl.cpp:35–56  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

33
34template <typename T>
35void PowCImpl::do_exec_ct(
36 _megdnn_tensor_in src, _megdnn_tensor_out dst, _megdnn_workspace workspace) {
37 auto handle = concrete_handle(this->handle());
38 auto ws_bundle = make_bundle(src.layout, dst.layout);
39 ws_bundle.set(workspace.raw_ptr);
40
41 CnnlTensorDescriptor desc_inp, desc_exp, desc_out;
42 auto cnnl_layout = CNNL_LAYOUT_ARRAY;
43 desc_inp.set(src.layout, cnnl_layout);
44 desc_out.set(dst.layout, cnnl_layout);
45 std::vector<size_t> dims = {1};
46 desc_exp.set(1, dims, convert_to_cnnl_datatype(DTypeTrait<T>::enumv), cnnl_layout);
47 T v_exp = static_cast<T>(param().exp);
48 T* dev_exp = static_cast<T*>(ws_bundle.get(0));
49 cnnl_check(cnnlFill_v3(
50 handle->cnnl_handle(), CNNL_POINTER_MODE_HOST, (void*)&v_exp,
51 desc_exp.desc(), dev_exp));
52 cnnl_check(cnnlPow(
53 handle->cnnl_handle(), CNNL_COMPUTATION_HIGH_PRECISION, desc_inp.desc(),
54 src.raw_ptr(), desc_exp.desc(), dev_exp, ws_bundle.get(1),
55 ws_bundle.get_size(1), desc_out.desc(), dst.raw_ptr()));
56}
57
58void PowCImpl::exec(
59 _megdnn_tensor_in src, _megdnn_tensor_out dst, _megdnn_workspace workspace) {

Callers

nothing calls this directly

Calls 11

make_bundleFunction · 0.85
convert_to_cnnl_datatypeFunction · 0.85
cnnl_handleMethod · 0.80
concrete_handleFunction · 0.50
paramFunction · 0.50
handleMethod · 0.45
setMethod · 0.45
getMethod · 0.45
descMethod · 0.45
raw_ptrMethod · 0.45
get_sizeMethod · 0.45

Tested by

no test coverage detected