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

ref: Move the full jacobian and bound track parameters to the parameter_transporter and merge it with the parameter_resetter #880

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 20 additions & 4 deletions core/include/detray/propagator/actor_chain.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
#include "detray/definitions/containers.hpp"
#include "detray/definitions/detail/qualifiers.hpp"
#include "detray/propagator/base_actor.hpp"
#include "detray/propagator/composite_actor.hpp"
#include "detray/utils/tuple.hpp"
#include "detray/utils/tuple_helpers.hpp"

Expand All @@ -28,7 +29,7 @@ namespace detray {
/// The states of the actors need to be passed to the chain in an external tuple
///
/// @tparam actors_t the types of the actors in the chain.
template <typename... actors_t>
template <concepts::actor... actors_t>
class actor_chain {

public:
Expand Down Expand Up @@ -62,7 +63,8 @@ class actor_chain {
DETRAY_HOST_DEVICE
static constexpr auto make_default_actor_states() {
// Only possible if each state is default initializable
if constexpr (std::default_initializable<state_tuple>) {
if constexpr ((std::default_initializable<typename actors_t::state> &&
...)) {
return state_tuple{};
} else {
return std::nullopt;
Expand All @@ -82,7 +84,7 @@ class actor_chain {
/// @param actr the actor (might be a composite actor)
/// @param states states of all actors (only bare actors)
/// @param p_state the state of the propagator (stepper and navigator)
template <typename actor_t, typename actor_states_t,
template <concepts::actor actor_t, typename actor_states_t,
typename propagator_state_t>
DETRAY_HOST_DEVICE inline void run(const actor_t &actr,
actor_states_t &states,
Expand Down Expand Up @@ -133,7 +135,7 @@ class actor_chain<> {
using state_ref_tuple = dtuple<>;

/// Empty states replaces a real actor states container
struct state {};
using state = state_tuple;

/// Call to actors does nothing.
///
Expand All @@ -145,11 +147,25 @@ class actor_chain<> {
/*Do nothing*/
}

/// @returns the actor list
DETRAY_HOST_DEVICE constexpr const actor_tuple &actors() const {
return m_actors;
}

/// @returns an empty state
DETRAY_HOST_DEVICE
static consteval state_tuple make_default_actor_states() {
return dtuple<>{};
}

/// @returns an empty state
DETRAY_HOST_DEVICE static constexpr state_ref_tuple setup_actor_states(
const state_tuple &) {
return {};
}

private:
[[no_unique_address]] actor_tuple m_actors = {};
};

} // namespace detray
4 changes: 2 additions & 2 deletions core/include/detray/propagator/actors.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@
// Include all core actors
#include "detray/propagator/actor_chain.hpp"
#include "detray/propagator/actors/aborters.hpp"
#include "detray/propagator/actors/parameter_resetter.hpp"
#include "detray/propagator/actors/parameter_transporter.hpp"
#include "detray/propagator/actors/parameter_updater.hpp"
#include "detray/propagator/actors/pointwise_material_interactor.hpp"
#include "detray/propagator/concepts.hpp"
45 changes: 0 additions & 45 deletions core/include/detray/propagator/actors/parameter_resetter.hpp

This file was deleted.

131 changes: 0 additions & 131 deletions core/include/detray/propagator/actors/parameter_transporter.hpp

This file was deleted.

Loading
Loading