Skip to content
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

Add MemoryLocation {Host, Device} member in bunch_particles to keep track of where particles are #261

Merged
merged 8 commits into from
Apr 25, 2024

Conversation

s-sajid-ali
Copy link
Member

@s-sajid-ali s-sajid-ali commented Apr 22, 2024

Fixes #248 with a broader solution that introduces a new enum member MemoryLocation { Host, Device } in the bunch_particles class to keep track of where the particles reside. This can also be used to track down issues later on, if for instance particle data lives on the host but some function was called with the assumption that data lives on the device.

An additional change that occurs due to the above is that any function that moves particles between device/host memories can no longer be const.

@s-sajid-ali s-sajid-ali marked this pull request as draft April 22, 2024 16:19
	modified:   src/synergia/bunch/bunch.h
	modified:   src/synergia/bunch/bunch_particles.cc
	modified:   src/synergia/bunch/bunch_particles.h
	modified:   src/synergia/bunch/tests/test_bunch.cc
	modified:   src/synergia/bunch/tests/test_bunch_particles.cc
	modified:   src/synergia/simulation/bunch_simulator.cc
	modified:   src/synergia/simulation/bunch_simulator.h
@s-sajid-ali s-sajid-ali marked this pull request as ready for review April 25, 2024 22:16
@s-sajid-ali s-sajid-ali changed the title WIP core diagnostics should know if particles are on device or not Add MemoryLocation {Host, Device} member in bunch_particles to keep track of where particles are Apr 25, 2024
@s-sajid-ali s-sajid-ali merged commit d7cd353 into devel3 Apr 25, 2024
6 checks passed
@s-sajid-ali s-sajid-ali deleted the fix_core_diagnostics branch April 25, 2024 23:11
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.

Core diagnostics methods should have checkin/checkout guards to ensure correct usage
1 participant