| 28 | |
| 29 | template <typename ctype> |
| 30 | void fuse_mul_add4(ctype* dest, const ElemwiseOpParamN<4>& param) { |
| 31 | auto iter0 = tensor_iter_valonly<ctype>(param[0]).begin(); |
| 32 | auto iter1 = tensor_iter_valonly<ctype>(param[1]).begin(); |
| 33 | auto p2 = param[2].ptr<ctype>(), p3 = param[3].ptr<ctype>(); |
| 34 | |
| 35 | for (size_t i = 0; i < param.size; ++i) { |
| 36 | auto off0 = iter0.offset(), off1 = iter1.offset(); |
| 37 | dest[i] = (*iter0) * (*iter1) + p2[off0] * p3[off1]; |
| 38 | ++iter0; |
| 39 | ++iter1; |
| 40 | } |
| 41 | } |
| 42 | |
| 43 | } // anonymous namespace |
| 44 |
no test coverage detected