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

Added declaration and initialization of a list of beamline elements. #21

Merged
merged 6 commits into from
Dec 5, 2021

Conversation

cemitch99
Copy link
Member

This is a first attempt at initializing a list of beamline elements defining the lattice. For now, the list includes only drift elements. The main work is done in the function initElements() in ImpactX.cpp.

Request sanity check that this makes some sense before proceeding further.

@cemitch99 cemitch99 requested a review from ax3l December 4, 2021 01:20
@ax3l ax3l self-assigned this Dec 5, 2021
@ax3l ax3l added the enhancement New feature or request label Dec 5, 2021
src/ImpactX.cpp Outdated Show resolved Hide resolved
src/ImpactX.cpp Outdated Show resolved Hide resolved
src/ImpactX.H Outdated Show resolved Hide resolved
src/ImpactX.H Outdated Show resolved Hide resolved
src/ImpactX.cpp Outdated Show resolved Hide resolved
@ax3l ax3l force-pushed the list-of-elements branch 3 times, most recently from 99dbc93 to 097d1fa Compare December 5, 2021 02:32
@ax3l ax3l force-pushed the list-of-elements branch 2 times, most recently from 97711fc to 7038848 Compare December 5, 2021 02:43
This allows us to create a list of multiple (known) types.
CUDA builds for NVCC 11.0.2 fail with
```
  error #3206-D: An extended __device__ lambda cannot be defined inside a generic lambda expression("operator()").
```
if we try to nest out `std::visit` and `ParallelFor` device lambdas.
So, as a work-around, we isolate the single particle push out into a
C++ functor.

Wow, 2010 feels.
@ax3l ax3l merged commit 1bc4a6e into ECP-WarpX:development Dec 5, 2021
@ax3l
Copy link
Member

ax3l commented Dec 5, 2021

Work-around for CUDA: submitted as Nvidia request for Enhancement with BugID 3458976

Tiny demonstrator in https://cuda.godbolt.org/z/39e4q53Ye

ax3l added a commit that referenced this pull request Dec 5, 2021
More context for the work-around used in #21
@ax3l ax3l added this to the First Release Version milestone Apr 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants