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