diff --git a/include/openPMD/RecordComponent.tpp b/include/openPMD/RecordComponent.tpp index 5a37e49ad7..c5e3a994c8 100644 --- a/include/openPMD/RecordComponent.tpp +++ b/include/openPMD/RecordComponent.tpp @@ -96,7 +96,11 @@ RecordComponent::loadChunkAllocate_impl(internal::LoadStoreConfig cfg) (defined(__apple_build_version__) && __clang_major__ < 14) auto newData = std::shared_ptr(new T[numPoints], [](T *p) { delete[] p; }); - loadChunk(newData, offset, extent); + prepareLoadStore() + .offset(std::move(o)) + .extent(std::move(e)) + .fromSharedPtr(newData) + .enqueueLoad(); return newData; #else auto newData = std::shared_ptr(new T[numPoints]); diff --git a/src/LoadStoreChunk.cpp b/src/LoadStoreChunk.cpp index 7917090597..c229844dab 100644 --- a/src/LoadStoreChunk.cpp +++ b/src/LoadStoreChunk.cpp @@ -108,14 +108,14 @@ auto ConfigureLoadStore::storeChunkConfig() template auto ConfigureLoadStore::extent(Extent extent) -> return_type & { - m_extent = std::move(extent); + m_extent = std::make_optional(std::move(extent)); return *static_cast(this); } template auto ConfigureLoadStore::offset(Offset offset) -> return_type & { - m_offset = std::move(offset); + m_offset = std::make_optional(std::move(offset)); return *static_cast(this); } @@ -215,23 +215,33 @@ OPENPMD_FOREACH_DATASET_DATATYPE(INSTANTIATE_METHOD_TEMPLATES_FOR_BASE) #undef INSTANTIATE_METHOD_TEMPLATES_FOR_BASE +/* + * In the following macro, we replace `dtype` with `std::remove_cv_t` since otherwise clang-tidy won't understand it's a type and we cannot + * surround it with parentheses. The type names are surrounded with angle + * brackets, so the warning is useless. + */ + #define INSTANTIATE_STORE_CHUNK_FROM_BUFFER(dtype) \ - template class ConfigureLoadStoreFromBuffer>; \ + template class ConfigureLoadStoreFromBuffer< \ + std::shared_ptr>>; \ template class ConfigureStoreChunkFromBuffer< \ std::shared_ptr, \ - ConfigureLoadStoreFromBuffer>>; \ - template class ConfigureLoadStore< \ - ConfigureLoadStoreFromBuffer>>; \ + ConfigureLoadStoreFromBuffer< \ + std::shared_ptr>>>; \ + template class ConfigureLoadStore>>>; \ INSTANTIATE_METHOD_TEMPLATES( \ - ConfigureLoadStore< \ - ConfigureLoadStoreFromBuffer>>, \ + ConfigureLoadStore>>>, \ dtype) \ - template class ConfigureStoreChunkFromBuffer>; \ - template class ConfigureLoadStore< \ - ConfigureStoreChunkFromBuffer>>; \ + template class ConfigureStoreChunkFromBuffer< \ + UniquePtrWithLambda>>; \ + template class ConfigureLoadStore>>>; \ INSTANTIATE_METHOD_TEMPLATES( \ - ConfigureLoadStore< \ - ConfigureStoreChunkFromBuffer>>, \ + ConfigureLoadStore>>>, \ dtype) \ template class ConfigureStoreChunkFromBuffer< \ std::shared_ptr>; \