Move initialization of General and UniformMagneticField to InitializeGPU#467
Merged
JuanGonzalezCaminero merged 1 commit intoapt-sim:masterfrom Jan 13, 2026
Merged
Conversation
|
Can one of the admins verify this patch? |
ae5eba2 to
74217a1
Compare
1a55794 to
e8bb5b7
Compare
Collaborator
SeverinDiederichs
left a comment
There was a problem hiding this comment.
Thanks for the cleaning!
See two very minor leftovers
e8bb5b7 to
a4ae138
Compare
SeverinDiederichs
approved these changes
Jan 13, 2026
a4ae138 to
15e4be3
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
GeneralMagneticField.hwas being included by non-CUDA headers, and compiled by gcc, despite containing CUDA API calls and__device__functions. This worked since, for the API calls, the correct headers and library were provided, so the linking was done correctly, and for the__device__functions since the copcoreMacros.hheader defines the__host__and__device__keywords when compiling with gcc.These functions would not work when called from host however, but this was never done,
GeneralMagneticField.hwas also being compiled by nvcc in a different translation unit, and the correct versions of these functions were linked with the kernels using them.The file has been renamed to
GeneralMagneticField.cuh, and the initialization moved toInitializeGPUinAdePTTransport.cuhandAsyncAdePTTransport.cuh, the pointer to the general magnetic field, which was held by the host instance of AdePT Transport, is now stored byGPUState.The same situation occurred with
UniformMagneticField.h, which has now also been renamed and its initialization moved.