Skip to content

Commit 746245e

Browse files
committed
CI fixes
1 parent c00fa7a commit 746245e

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
@@ -84,6 +84,41 @@ RecordComponent::storeChunk(Offset o, Extent e, F &&createBuffer)
8484
.storeSpan<T>(std::forward<F>(createBuffer));
8585
}
8686

87+
namespace detail
88+
{
89+
template <typename T>
90+
struct pointer_as_void;
91+
92+
template <typename T>
93+
struct pointer_as_void<std::shared_ptr<T>>
94+
{
95+
static auto call(std::shared_ptr<T> const &ptr)
96+
-> std::shared_ptr<void const>
97+
{
98+
return std::static_pointer_cast<void const>(ptr);
99+
}
100+
};
101+
102+
template <typename T>
103+
struct pointer_as_void<std::unique_ptr<T>>
104+
{
105+
static auto call(std::unique_ptr<T> &&ptr) -> UniquePtrWithLambda<void>
106+
{
107+
return UniquePtrWithLambda<void>(std::move(ptr));
108+
}
109+
};
110+
template <typename T>
111+
struct pointer_as_void<std::unique_ptr<T[]>>
112+
{
113+
static auto call(std::unique_ptr<T[]> &&ptr)
114+
-> UniquePtrWithLambda<void>
115+
{
116+
return UniquePtrWithLambda<T[]>(std::move(ptr))
117+
.template static_cast_<void>();
118+
}
119+
};
120+
} // namespace detail
121+
87122
template <typename T, typename F>
88123
inline DynamicMemoryView<T> RecordComponent::storeChunkSpanCreateBuffer_impl(
89124
internal::LoadStoreConfig cfg, F &&createBuffer)
@@ -157,10 +192,12 @@ inline DynamicMemoryView<T> RecordComponent::storeChunkSpanCreateBuffer_impl(
157192
getBufferView.out->ptr = static_cast<void *>(data.get());
158193
if (size > 0)
159194
{
195+
using ptr_type = decltype(data);
160196
internal::LoadStoreConfigWithBuffer ls_cfg{
161197
std::move(o), std::move(e), std::nullopt};
162198
storeChunk_impl(
163-
auxiliary::WriteBuffer(std::move(data)),
199+
auxiliary::WriteBuffer(
200+
detail::pointer_as_void<ptr_type>::call(std::move(data))),
164201
getBufferView.dtype,
165202
std::move(ls_cfg),
166203
/*flush_immediately=*/false);

0 commit comments

Comments
 (0)