Skip to content

GH-55312: [C++][Compute] More flexible kernel exec generation - #55291

Merged
pitrou merged 2 commits into
apache:mainfrom
pitrou:kernel-generator
Nov 2, 2026
Merged

pitrou merged 2 commits into
apache:mainfrom
pitrou:kernel-generator

Conversation

@pitrou

@pitrou pitrou commented Oct 27, 2026 •

Copy link
Copy Markdown
Member

Rationale for this change

Our kernel generation utilities in arrow/compute/kernels/codegen_internal.h are 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?

  • Rewrite kernel generation utilities to make them more generic, allowing to pass compile-time arrays of type ids
  • Add compile-time constant arrays of type ids (kAllTypeIds, kIntegerTypeIds...)
  • Add missing TypeIdTraits specializations
  • Add missing type_id static member definitions on RunEndEncodedType and ExtensionType
  • Reduce code duplication in numeric cast kernel generation

Are 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:

  • Human
  • AI

Reviewed before submission by:

  • Human
  • AI
  • Not reviewed

@pitrou
pitrou marked this pull request as draft October 27, 2026 19:25
@pitrou

pitrou commented Oct 27, 2026

Copy link
Copy Markdown
Member Author

@zanmato1984 This is what I had in mind in #55169 (comment)

@pitrou pitrou changed the title WIP: [C++] More flexible kernel exec generation EXP: [C++] More flexible kernel exec generation Oct 27, 2026
@pitrou
pitrou force-pushed the kernel-generator branch 6 times, most recently from 6b9e004 to 4eda8a8 Compare October 29, 2026 14:13
@pitrou
pitrou marked this pull request as ready for review October 29, 2026 14:13
@pitrou pitrou changed the title EXP: [C++] More flexible kernel exec generation GH-55312: [C++][Compute] More flexible kernel exec generation Oct 29, 2026
@pitrou

pitrou commented Oct 29, 2026

Copy link
Copy Markdown
Member Author

This is ready for review @zanmato1984 @HuaHuaY .

@zanmato1984 zanmato1984 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the cleanup! The new generator interface looks good to me. I left two minor documentation comments inline.

@github-actions github-actions Bot added awaiting committer review Awaiting committer review and removed awaiting review Awaiting review labels Oct 30, 2026
@pitrou

pitrou commented Nov 2, 2026

Copy link
Copy Markdown
Member Author

I've addressed the review comments now. I'll watch for CI and merge if green. Thank you @zanmato1984 !

Comment thread cpp/src/arrow/type_traits.h Resolved
@pitrou

pitrou commented Nov 2, 2026

Copy link
Copy Markdown
Member Author

CI failure is unrelated.

@pitrou
pitrou merged commit 95237d9 into apache:main Nov 2, 2026
67 of 69 checks passed
@pitrou pitrou removed the awaiting committer review Awaiting committer review label Nov 2, 2026
@pitrou
pitrou deleted the kernel-generator branch November 2, 2026 13:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants