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

Method exec

dnn/src/x86/elemwise/opr_impl.cpp:589–615  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

587}
588
589void ElemwiseImpl::exec(const TensorNDArray& srcs, _megdnn_tensor_out dst) {
590 if (!dst.layout.is_contiguous())
591 return fallback::ElemwiseImpl::exec(srcs, dst);
592
593 m_src = &srcs;
594 m_dst = &dst;
595
596 bool optimizing = false;
597 optimizing |= m_dst->layout.dtype == dtype::Float32();
598 optimizing |= m_dst->layout.dtype == dtype::Int32();
599 optimizing |= m_dst->layout.dtype == dtype::Int16();
600 optimizing |= m_dst->layout.dtype == dtype::Int8();
601 if (optimizing) {
602 if (exec_unary()) {
603 return;
604 }
605
606 if (exec_binary()) {
607 return;
608 }
609 if (exec_ternary_fma3()) {
610 return;
611 }
612 }
613
614 fallback::ElemwiseImpl::exec(srcs, dst);
615}
616
617// vim: syntax=cpp.doxygen

Callers

nothing calls this directly

Calls 4

exec_unaryFunction · 0.85
exec_binaryFunction · 0.85
execFunction · 0.50
is_contiguousMethod · 0.45

Tested by

no test coverage detected