| 587 | } |
| 588 | |
| 589 | void 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 |
nothing calls this directly
no test coverage detected