Skip to content

Allow CUDA CCA algorithm to output cluster info #930

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

stephenswat
Copy link
Member

This commit allows the CUDA CCA algorithm (and, in the future, the SYCL and Alpaka equivalents) to output cluster information in the form of a disjoint set array. The design is such that the existing API is unchanged, but that extra function calls become available.

@stephenswat stephenswat added feature New feature or request cuda Changes related to CUDA shared Changes related to shared code labels Mar 28, 2025
@stephenswat
Copy link
Member Author

Tagging @paradajzblond as an interested party.

Copy link
Member

@krasznaa krasznaa left a comment

Choose a reason for hiding this comment

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

The internal implementation seems to make sense. But as I wrote earlier, I have some pretty concrete ideas about the API.

@stephenswat stephenswat force-pushed the feat/cca_cluster_data branch 2 times, most recently from 2eaa3d6 to 372a084 Compare March 28, 2025 16:52
Copy link
Member

@krasznaa krasznaa left a comment

Choose a reason for hiding this comment

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

Let's talk in person. Let's discuss how the SoA container should work. 🤔

@stephenswat stephenswat force-pushed the feat/cca_cluster_data branch 2 times, most recently from 1ad193a to 3b6c34d Compare March 31, 2025 09:36
@stephenswat
Copy link
Member Author

All good to go!

@stephenswat stephenswat requested a review from krasznaa March 31, 2025 09:37
@stephenswat stephenswat force-pushed the feat/cca_cluster_data branch 2 times, most recently from 94b755b to f1eaaee Compare March 31, 2025 09:49
Copy link
Member

@krasznaa krasznaa left a comment

Choose a reason for hiding this comment

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

To put it here as well, I personally would be a lot happier if the new function arguments would also be given to the functions via vecmem views. And in fact I plan to update the code myself to that formalism when upgrading the Alpaka and SYCL algorithms.

But other than that, only some small requests for updating the documentation. And don't forget to add the missing .cu file!

@stephenswat
Copy link
Member Author

And in fact I plan to update the code myself to that formalism when upgrading the Alpaka and SYCL algorithms.

Please feel free to try, but I will just warn you again that you are wasting your time. If you try this, you will notice that using vecmem views here is a lot of effort, adds a lot of complication, and yields no benefits.

@stephenswat stephenswat force-pushed the feat/cca_cluster_data branch 2 times, most recently from 50cef21 to 213979c Compare March 31, 2025 14:37
This commit allows the CUDA CCA algorithm (and, in the future, the SYCL
and Alpaka equivalents) to output cluster information in the form of a
disjoint set array. The design is such that the existing API is
unchanged, but that extra function calls become available.
@stephenswat stephenswat force-pushed the feat/cca_cluster_data branch from 213979c to c1b95a5 Compare March 31, 2025 14:38
Copy link

Copy link
Member

@krasznaa krasznaa left a comment

Choose a reason for hiding this comment

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

First time that I would ever see this word. 🤔

https://www.merriam-webster.com/dictionary/reify

Comment on lines +135 to +137
if (cluster_size.has_value()) {
(*cluster_size).get() = tmp_cluster_size;
}
Copy link
Member

Choose a reason for hiding this comment

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

😕 All I wrote was to try to get rid of this if-block. As long as the block is still here, the new function argument is completely useless. Please either

  • try the formalism that I suggested, and see what it does to the compiled code;
  • or go back to using a pointer.

This current version is the worst of all worlds. 😦

Comment on lines +13 to +17
template <device::concepts::thread_id1 thread_id_t>
TRACCC_HOST_DEVICE void reify_cluster_data(
const thread_id_t& thread_id, unsigned int* disjoint_set_ptr,
unsigned int num_cells,
traccc::edm::silicon_cluster_collection::view cluster_view) {
Copy link
Member

Choose a reason for hiding this comment

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

Please provide some function documentation.

@stephenswat
Copy link
Member Author

...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cuda Changes related to CUDA feature New feature or request shared Changes related to shared code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants