| 894 | |
| 895 | template <typename Op, typename FunctionImpl = ArithmeticFunction> |
| 896 | std::shared_ptr<ScalarFunction> MakeArithmeticFunction(std::string name, |
| 897 | FunctionDoc doc) { |
| 898 | auto func = std::make_shared<FunctionImpl>(name, Arity::Binary(), std::move(doc)); |
| 899 | for (const auto& ty : NumericTypes()) { |
| 900 | auto exec = ArithmeticExecFromOp<ScalarBinaryEqualTypes, Op>(ty); |
| 901 | DCHECK_OK(func->AddKernel({ty, ty}, ty, exec)); |
| 902 | } |
| 903 | AddNullExec(func.get()); |
| 904 | return func; |
| 905 | } |
| 906 | |
| 907 | // Like MakeArithmeticFunction, but for arithmetic ops that need to run |
| 908 | // only on non-null output. |
nothing calls this directly
no test coverage detected