Skip to content

Commit 3b23c85

Browse files
committed
CI fixes
1 parent 94bbb7e commit 3b23c85

2 files changed

Lines changed: 38 additions & 3 deletions

File tree

include/openPMD/IO/HDF5/ParallelHDF5IOHandler.hpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,6 @@ class ParallelHDF5IOHandler : public AbstractIOHandler
4444
#else
4545
ParallelHDF5IOHandler(
4646
internal::AbstractIOHandlerInitFrom &&initialize_from,
47-
std::string const &path,
48-
Access,
4947
json::TracingJSON config);
5048
#endif
5149
~ParallelHDF5IOHandler() override;

include/openPMD/RecordComponent.tpp

Lines changed: 38 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,41 @@ RecordComponent::storeChunk(Offset o, Extent e, F &&createBuffer)
8282
.enqueueStore<T>(std::forward<F>(createBuffer));
8383
}
8484

85+
namespace detail
86+
{
87+
template <typename T>
88+
struct pointer_as_void;
89+
90+
template <typename T>
91+
struct pointer_as_void<std::shared_ptr<T>>
92+
{
93+
static auto call(std::shared_ptr<T> const &ptr)
94+
-> std::shared_ptr<void const>
95+
{
96+
return std::static_pointer_cast<void const>(ptr);
97+
}
98+
};
99+
100+
template <typename T>
101+
struct pointer_as_void<std::unique_ptr<T>>
102+
{
103+
static auto call(std::unique_ptr<T> &&ptr) -> UniquePtrWithLambda<void>
104+
{
105+
return UniquePtrWithLambda<void>(std::move(ptr));
106+
}
107+
};
108+
template <typename T>
109+
struct pointer_as_void<std::unique_ptr<T[]>>
110+
{
111+
static auto call(std::unique_ptr<T[]> &&ptr)
112+
-> UniquePtrWithLambda<void>
113+
{
114+
return UniquePtrWithLambda<T[]>(std::move(ptr))
115+
.template static_cast_<void>();
116+
}
117+
};
118+
} // namespace detail
119+
85120
template <typename T, typename F>
86121
inline DynamicMemoryView<T> RecordComponent::storeChunkSpanCreateBuffer_impl(
87122
internal::LoadStoreConfig cfg, F &&createBuffer)
@@ -155,10 +190,12 @@ inline DynamicMemoryView<T> RecordComponent::storeChunkSpanCreateBuffer_impl(
155190
getBufferView.out->ptr = static_cast<void *>(data.get());
156191
if (size > 0)
157192
{
193+
using ptr_type = decltype(data);
158194
internal::LoadStoreConfigWithBuffer ls_cfg{
159195
std::move(o), std::move(e), std::nullopt};
160196
storeChunk_impl(
161-
auxiliary::WriteBuffer(std::move(data)),
197+
auxiliary::WriteBuffer(
198+
detail::pointer_as_void<ptr_type>::call(std::move(data))),
162199
getBufferView.dtype,
163200
std::move(ls_cfg),
164201
/*flush_immediately=*/false);

0 commit comments

Comments
 (0)