File indexing completed on 2025-09-15 08:54:50
0001
0002
0003
0004
0005
0006
0007 #pragma once
0008
0009 #include "corecel/Types.hh"
0010 #include "corecel/data/CollectionMirror.hh"
0011 #include "corecel/data/Filler.hh"
0012 #include "corecel/data/ParamsDataInterface.hh"
0013
0014 #include "TrackInitData.hh"
0015
0016 namespace celeritas
0017 {
0018
0019
0020
0021
0022
0023
0024
0025 class TrackInitParams final : public ParamsDataInterface<TrackInitParamsData>
0026 {
0027 public:
0028
0029 struct Input
0030 {
0031 size_type capacity{};
0032 size_type max_events{};
0033 TrackOrder track_order{TrackOrder::none};
0034 };
0035
0036 public:
0037
0038 explicit TrackInitParams(Input const&);
0039
0040
0041 size_type capacity() const { return host_ref().capacity; }
0042
0043
0044 size_type max_events() const { return host_ref().max_events; }
0045
0046
0047 TrackOrder track_order() const { return host_ref().track_order; }
0048
0049
0050 HostRef const& host_ref() const final { return data_.host_ref(); }
0051
0052
0053 DeviceRef const& device_ref() const final { return data_.device_ref(); }
0054
0055
0056 template<MemSpace M>
0057 inline void
0058 reset_track_ids(StreamId stream,
0059 TrackInitStateData<Ownership::reference, M>* state) const;
0060
0061 private:
0062
0063 CollectionMirror<TrackInitParamsData> data_;
0064 };
0065
0066
0067
0068
0069
0070 template<MemSpace M>
0071 void TrackInitParams::reset_track_ids(
0072 StreamId stream, TrackInitStateData<Ownership::reference, M>* state) const
0073 {
0074 CELER_EXPECT(state);
0075
0076 Filler<size_type, M> fill_zero{0, stream};
0077 fill_zero(state->track_counters[AllItems<size_type, M>{}]);
0078 }
0079
0080
0081 }