Skip to content

Various fixes for heterogeneous utilities #47605

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

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

fwyzard
Copy link
Contributor

@fwyzard fwyzard commented Mar 17, 2025

PR description:

Add missing #includes under DataFormats/SoATemplate.

Implement alpaka::atomicInc variants:

  • deduce the limit from the type;
  • saturate to the limit instead of wrapping to 0.

Fix a typo in the documentation.

PR validation:

None.

If this PR is a backport please specify the original PR and why you need to backport that PR. If this PR will be backported please specify to which release cycle the backport is meant for:

To be backported to 15.0.x for data taking.

@cmsbuild
Copy link
Contributor

cmsbuild commented Mar 17, 2025

cms-bot internal usage

@fwyzard fwyzard changed the title Various fixes for heterogeneous code Various fixes for heterogeneous utilities Mar 17, 2025
@fwyzard
Copy link
Contributor Author

fwyzard commented Mar 17, 2025

type bugfix

@fwyzard
Copy link
Contributor Author

fwyzard commented Mar 17, 2025

enable gpu

@fwyzard
Copy link
Contributor Author

fwyzard commented Mar 17, 2025

please test

@cmsbuild
Copy link
Contributor

+code-checks

Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-47605/44115

@cmsbuild
Copy link
Contributor

A new Pull Request was created by @fwyzard for master.

It involves the following packages:

  • DataFormats/SoATemplate (heterogeneous)
  • HeterogeneousCore/AlpakaCore (heterogeneous)
  • HeterogeneousCore/AlpakaInterface (heterogeneous)

@fwyzard, @makortel can you please review it and eventually sign? Thanks.
@makortel, @missirol, @mmusich, @rovere this is something you requested to watch as well.
@antoniovilela, @mandrenguyen, @rappoccio, @sextonkennedy you are the release manager for this.

cms-bot commands are listed here

This was referenced Mar 17, 2025
T const& limit,
THierarchy const& hierarchy = THierarchy()) -> T {
T assumed;
T old = *address;
Copy link
Contributor

Choose a reason for hiding this comment

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

On host parallel backends (that we don't use at the moment) this line is not thread safe (actually, strictly speaking with the default Grids hierarchy level this line is not thread safe even with host serial backend if the same address is accessed concurrently from multiple kernels). To guarantee thread safety on host the load from address would have to be atomic.

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 see.
I will have to think how it can be implemented in a portable way, or specialised for the various backends.

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