| 204 | }; |
| 205 | |
| 206 | void MakeFunction(std::string name, FunctionDoc doc, std::vector<InputType> in_types, |
| 207 | OutputType out_type, ArrayKernelExec exec, FunctionRegistry* registry, |
| 208 | NullHandling::type null_handling, bool can_write_into_slices, |
| 209 | const FunctionOptions* default_options = NULLPTR, |
| 210 | KernelInit init = NULLPTR) { |
| 211 | Arity arity{static_cast<int>(in_types.size())}; |
| 212 | auto func = |
| 213 | std::make_shared<ScalarFunction>(name, arity, std::move(doc), default_options); |
| 214 | |
| 215 | ScalarKernel kernel(std::move(in_types), out_type, exec, init); |
| 216 | kernel.null_handling = null_handling; |
| 217 | kernel.can_write_into_slices = can_write_into_slices; |
| 218 | |
| 219 | DCHECK_OK(func->AddKernel(std::move(kernel))); |
| 220 | DCHECK_OK(registry->AddFunction(std::move(func))); |
| 221 | } |
| 222 | |
| 223 | template <typename InType, typename Op> |
| 224 | void AddFloatValidityKernel(const std::shared_ptr<DataType>& ty, ScalarFunction* func) { |
no test coverage detected