Repository navigation
Conversation
|
@zanmato1984 This is what I had in mind in #55169 (comment) |
6b9e004 to
4eda8a8
Compare
4eda8a8 to
b025a34
Compare
|
This is ready for review @zanmato1984 @HuaHuaY . |
zanmato1984
left a comment
There was a problem hiding this comment.
Thanks for the cleanup! The new generator interface looks good to me. I left two minor documentation comments inline.
| // For example, GenerateNumeric<FUNCTOR>(int32()) will select a kernel | ||
| // instantiated like FUNCTOR<Int32Type>. Any additional variadic |
There was a problem hiding this comment.
Nit: could we also update the overview above? It still says a fixed Type0 argument is required and precedes the selected type, whereas the default is now FUNCTOR<Type, Args...>. It would also help to mention WithType0<T> and WithFirstTypeTwice for the alternative layouts.
| @@ -531,14 +531,14 @@ void AddQuantileKernels(VectorFunction* func) { | |||
| for (const auto& ty : NumericTypes()) { | |||
| base.signature = KernelSignature::Make({InputType(ty)}, OutputType(ResolveOutput)); | |||
| // output type is determined at runtime, set template argument to nulltype | |||
There was a problem hiding this comment.
Nit: the nulltype placeholder is no longer passed here. Could we simplify this comment to “The output type is determined at runtime by ResolveOutput”?
Rationale for this change
Our kernel generation utilities in
arrow/compute/kernels/codegen_internal.hare a hodge-podge of hand-written switch statements with inconsistent template parameter signatures and semantics.This PR makes those more flexible, more consistent and more reusable.
What changes are included in this PR?
kAllTypeIds,kIntegerTypeIds...)TypeIdTraitsspecializationstype_idstatic member definitions onRunEndEncodedTypeandExtensionTypeAre these changes tested?
Yes, by existing tests and new unit tests around type id traits.
Are there any user-facing changes?
No.
Was AI used for this PR?
In accordance to the AI generation guidelines, please disclose below whether and how AI was used in this PR.
PR code and description written by:
Reviewed before submission by: