diff --git a/include/openPMD/LoadStoreChunk.hpp b/include/openPMD/LoadStoreChunk.hpp index 18af717c0a..451d6cd0cf 100644 --- a/include/openPMD/LoadStoreChunk.hpp +++ b/include/openPMD/LoadStoreChunk.hpp @@ -203,7 +203,7 @@ namespace core using ConfigureStoreChunkFromBuffer< Ptr_Type>::ConfigureStoreChunkFromBuffer; - auto enqueueLoad() -> void; + auto enqueueLoad() -> auxiliary::DeferredComputation; auto load(EnqueuePolicy) -> void; }; diff --git a/src/LoadStoreChunk.cpp b/src/LoadStoreChunk.cpp index 6d6d57386f..4571cf71e5 100644 --- a/src/LoadStoreChunk.cpp +++ b/src/LoadStoreChunk.cpp @@ -237,7 +237,8 @@ namespace core } template - auto ConfigureLoadStoreFromBuffer::enqueueLoad() -> void + auto ConfigureLoadStoreFromBuffer::enqueueLoad() + -> auxiliary::DeferredComputation { static_assert( std::is_same_v< @@ -249,6 +250,10 @@ namespace core "shared_ptr type."); this->m_rc.loadChunk_impl( std::move(this->m_buffer), this->storeChunkConfig()); + return auxiliary::DeferredComputation( + [rc_lambda = this->m_rc]() mutable -> void { + rc_lambda.seriesFlush(); + }); } template