Commit 355d2dc8 authored by Samuel Debionne's avatar Samuel Debionne
Browse files

[SMX] Use acc_nb_frames_xfer as main switch to enable accumulation

parent 37be4fa1
Pipeline #77149 passed with stages
in 9 minutes and 36 seconds
......@@ -117,7 +117,7 @@ namespace processing::fai
bool do_absorption = !absorption_d.empty();
bool do_mask = !mask_d.empty();
bool do_dummy = false;
bool do_acc = (acc_nb_frames_reset > 0);
bool do_acc = (acc_nb_frames_xfer > 0);
bcl::vector<bcl::float4_> preprocessed_d(nb_pixels, context); //!< Preprocessed data
bcl::copy(mask.begin(), mask.end(), mask_d.begin(), queue);
bcl::kernel stage2(stage2_program, "corrections4");
......@@ -150,7 +150,6 @@ namespace processing::fai
bcl::vector<float> acc_peak_d(acc_nb_pixels, 0.0f, queue); //!< Accum pixels after peak find
std::uint32_t curr_acc_frames = 0;
const bool reset_acc = false;
return [=, //
gain = std::move(gain_d),
......@@ -248,16 +247,21 @@ namespace processing::fai
// Stage 6 - Accumulate corr & peaks
std::size_t ret_acc_frames = 0;
if (do_acc) {
// Increment nb of accumulated samples and check if update is needed
if ((++curr_acc_frames % acc_nb_frames_xfer == 0) || acc_always_xfer) {
// Increment nb of accumulated frames
curr_acc_frames++;
// Check if transfer is needed
if ((curr_acc_frames % acc_nb_frames_xfer == 0) || acc_always_xfer) {
ret_acc_frames = curr_acc_frames;
bcl::copy(acc_corr_d.begin(), acc_corr_d.end(), acc_corr.begin(), queue);
bcl::copy(acc_peak_d.begin(), acc_peak_d.end(), acc_peak.begin(), queue);
if (reset_acc) {
curr_acc_frames = 0;
bcl::fill(acc_corr_d.begin(), acc_corr_d.end(), 0.0f, queue);
bcl::fill(acc_peak_d.begin(), acc_peak_d.end(), 0.0f, queue);
}
}
// Check if reset is needed (0 means "accumulate indefinitely")
if ((acc_nb_frames_reset) && (curr_acc_frames % acc_nb_frames_reset == 0)) {
curr_acc_frames = 0;
bcl::fill(acc_corr_d.begin(), acc_corr_d.end(), 0.0f, queue);
bcl::fill(acc_peak_d.begin(), acc_peak_d.end(), 0.0f, queue);
}
}
......
......@@ -160,11 +160,11 @@ namespace processing::pipelines
checkpoint_hdf5_sparse.emplace(m_graph, tbb::flow::unlimited, m_nb_frames_sparse_saved);
// Accumulation HDF5 node
bool do_acc = (proc_params.fai.acc_nb_frames_reset > 0);
bool do_acc = (proc_params.fai.acc_nb_frames_xfer > 0);
if (do_acc) {
accum_split.emplace(m_graph);
auto acc_nb_frames =
(acq_params.xfer.time_slice.count - 1) / proc_params.fai.acc_nb_frames_reset + 1;
(acq_params.xfer.time_slice.count - 1) / proc_params.fai.acc_nb_frames_xfer + 1;
acc_saving_corrected.emplace(m_graph, proc_params.saving_accumulation_corrected, rank,
acc_nb_frames, frame_info.dimensions(), pixel_enum::gray32f);
checkpoint_hdf5_acc_corrected.emplace(m_graph, tbb::flow::unlimited,
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment