| 1254 | // non-null output. |
| 1255 | template <template <typename, RoundMode, typename...> class Op, typename OptionsType> |
| 1256 | std::shared_ptr<ScalarFunction> MakeUnaryRoundFunction(std::string name, |
| 1257 | FunctionDoc doc) { |
| 1258 | static const OptionsType kDefaultOptions = OptionsType::Defaults(); |
| 1259 | auto func = std::make_shared<RoundFunction>(name, Arity::Unary(), std::move(doc), |
| 1260 | &kDefaultOptions); |
| 1261 | RoundKernelGenerator<Op, RoundKernel, OptionsType> kernel_generator; |
| 1262 | for (const auto& tys : {NumericTypes(), {decimal128(1, 0), decimal256(1, 0)}}) { |
| 1263 | for (const auto& ty : tys) { |
| 1264 | ArrayKernelExec exec = nullptr; |
| 1265 | KernelInit init; |
| 1266 | DCHECK_OK(VisitTypeInline(*ty, &kernel_generator, &exec, &init)); |
| 1267 | DCHECK_OK(func->AddKernel( |
| 1268 | {InputType(ty->id())}, |
| 1269 | is_decimal(ty->id()) ? OutputType(FirstType) : OutputType(ty), exec, init)); |
| 1270 | } |
| 1271 | } |
| 1272 | AddNullExec(func.get()); |
| 1273 | return func; |
| 1274 | } |
| 1275 | |
| 1276 | template <template <typename, RoundMode, typename...> class Op, typename OptionsType> |
| 1277 | std::shared_ptr<ScalarFunction> MakeBinaryRoundFunction(const std::string& name, |
nothing calls this directly
no test coverage detected