-
Notifications
You must be signed in to change notification settings - Fork 31
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 optical generator data and update pre-generators #1182
Add optical generator data and update pre-generators #1182
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @amandalund ! Feel free to accept or reject the two suggestions and merge when you decide.
* Immutable problem data for generating optical photon distributions. | ||
*/ | ||
template<Ownership W, MemSpace M> | ||
struct OpticalGenParamsData |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since all these data are scalars, I think you might be able to define an OpticalGenParamsScalars
and then add
template<Ownership, MemSpace>
using OpticalGenParamsData = OpticalGenParamsScalars;
Then you won't have to write the operator=
? Or maybe that's not worth it...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like that, but get some errors when using it in the StreamStore
so maybe I'll hold off, unless you see what I'm missing?
/home/alund/celeritas_project/celeritas/src/corecel/data/StreamStore.hh: In instantiation of ‘S<celeritas::Ownership::reference, M>& celeritas::StreamStore<P, S>::state(celeritas::StreamId, celeritas::size_type) [with celeritas::MemSpace M = celeritas::MemSpace::host; P = celeritas::OpticalGenParamsData; S = celeritas::OpticalGenStateData; celeritas::StreamId = celeritas::OpaqueId<celeritas::Stream_>; celeritas::size_type = unsigned int]’:
/home/alund/celeritas_project/celeritas/src/celeritas/optical/detail/PreGenAction.cc:126:69: required from here
/home/alund/celeritas_project/celeritas/src/corecel/data/StreamStore.hh:206:21: error: no match for ‘operator=’ (operand types are ‘celeritas::CollectionStateStore<celeritas::OpticalGenStateData, celeritas::MemSpace::host>’ and ‘<brace-enclosed initializer list>’)
206 | state_store = {this->params<MemSpace::host>(), stream_id, size};
| ~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /home/alund/celeritas_project/celeritas/src/celeritas/global/CoreState.hh:14,
from /home/alund/celeritas_project/celeritas/src/celeritas/global/ActionLauncher.hh:17,
from /home/alund/celeritas_project/celeritas/src/celeritas/optical/detail/PreGenAction.cc:13:
/home/alund/celeritas_project/celeritas/src/corecel/data/CollectionStateStore.hh:77:34: note: candidate: ‘template<celeritas::Ownership W2, celeritas::MemSpace M2> celeritas::CollectionStateStore<S, M>& celeritas::CollectionStateStore<S, M>::operator=(const S<W2, M2>&) [with celeritas::Ownership W2 = W2; celeritas::MemSpace M2 = M2; S = celeritas::OpticalGenStateData; celeritas::MemSpace M = celeritas::MemSpace::host]’
77 | inline CollectionStateStore& operator=(S<W2, M2> const& other);
| ^~~~~~~~
/home/alund/celeritas_project/celeritas/src/corecel/data/CollectionStateStore.hh:77:34: note: template argument deduction/substitution failed:
In file included from /home/alund/celeritas_project/celeritas/src/celeritas/optical/detail/OpticalGenStorage.hh:12,
from /home/alund/celeritas_project/celeritas/src/celeritas/optical/detail/PreGenAction.cc:22:
/home/alund/celeritas_project/celeritas/src/corecel/data/StreamStore.hh:206:21: note: couldn’t deduce template parameter ‘W2’
206 | state_store = {this->params<MemSpace::host>(), stream_id, size};
...
This adds the pre-step data and buffers needed for generating and storing the optical distribution data and updates the pre-generators in preparation for #1173.