Skip to content

Do not pretend to default initialize a device lambda #5015

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
May 17, 2025

Conversation

miscco
Copy link
Contributor

@miscco miscco commented Apr 3, 2025

Found in CCCL CI

@miscco miscco requested a review from a team as a code owner April 3, 2025 19:07
@bdice bdice added improvement Improvement / enhancement to an existing function non-breaking Non-breaking change labels Apr 11, 2025
VertexValueInputIterator vertex_value_input_first{};
VertexOp v_op{};
vertex_t local_vertex_partition_range_first;
VertexValueInputIterator vertex_value_input_first;
Copy link
Contributor

Choose a reason for hiding this comment

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

Can't we default initialize iterators as well? Or is this because of possible thrust::transform_iterator with lambda?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

My reasoning with removing all default initializers is that partially initializing the struct does not make any sense and it is only ever initialized in a single place, so it feels "cleaner" to initialize all or nothing

Nothing I feel strongly about though

Copy link
Contributor

Choose a reason for hiding this comment

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

OK, I am more inclined to default initializing variables that can be default initialized (it helps to prevent random non-deterministic behaviors due to garbage values), but I also don't feel strongly, either.

vertex_t local_vertex_partition_range_first{};
VertexValueInputIterator vertex_value_input_first{};
VertexOp v_op{};
vertex_t local_vertex_partition_range_first;
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we can default initializing vertex_t (which is either int32_t or int64_t) or can this be also problematic?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I believe we should be consistent, we only construct these types in one place

@bdice
Copy link
Contributor

bdice commented May 14, 2025

@miscco @seunghwak Checking status here. Can we land this in 25.06?

VertexValueInputIterator vertex_value_input_first{};
VertexOp v_op{};
vertex_t local_vertex_partition_range_first;
VertexValueInputIterator vertex_value_input_first;
Copy link
Contributor

Choose a reason for hiding this comment

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

OK, I am more inclined to default initializing variables that can be default initialized (it helps to prevent random non-deterministic behaviors due to garbage values), but I also don't feel strongly, either.

@seunghwak
Copy link
Contributor

@bdice Sorry I just found that I've been neglecting my reviewer duty, just approved.

@ChuckHastings
Copy link
Collaborator

/merge

@rapids-bot rapids-bot bot merged commit 735c3f3 into rapidsai:branch-25.06 May 17, 2025
93 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cuGraph improvement Improvement / enhancement to an existing function non-breaking Non-breaking change
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants