Skip to content

Proposed cudf::type_dispatcher refactor per @bdice#9

Open
simoneves wants to merge 8 commits into
simoneves/decimal_pr3from
simoneves/decimal_pr3_type_dispatcher_refactor
Open

Proposed cudf::type_dispatcher refactor per @bdice#9
simoneves wants to merge 8 commits into
simoneves/decimal_pr3from
simoneves/decimal_pr3_type_dispatcher_refactor

Conversation

@simoneves

Copy link
Copy Markdown
Owner

No description provided.

stream);
}

template void fillOffsetsForDecimalSumState<int32_t>(

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Are these explicit instantiations necessary?

cudf::size_type numRows;
rmm::cuda_stream_view stream;

template <typename OffsetT>

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Use SFINAE or a requires clause. We only want to compile the valid paths here, not all possible type dispatches. (Currently the invalid type dispatches are compiled to a function that does nothing, but we want to eliminate them with SFINAE/requires if possible.) That way you can have a non-void return type where it makes sense.

@simoneves
simoneves force-pushed the simoneves/decimal_pr3_type_dispatcher_refactor branch 3 times, most recently from 73a340e to 270f9db Compare June 11, 2026 22:17
@simoneves
simoneves requested a review from bdice June 11, 2026 23:52
@simoneves
simoneves force-pushed the simoneves/decimal_pr3_type_dispatcher_refactor branch from d3f98fa to 1273f63 Compare June 11, 2026 23:58
stream);
}
template <>
void fillOffsetsForDecimalSumState::operator()<int32_t, 0>(

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Why do we have duplicated explicit template instances? The body of the int32 and int64 are identical. This should be a template parameter.

void operator()(
cudf::mutable_column_view offsetsView,
cudf::size_type numRows,
rmm::cuda_stream_view stream) const {}

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

Cursor says the stub "all other types" instantations are required. Not sure if your SFINAE/requires comment suggested some other way where they wouldn't be. Please advise.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants