Skip to content

Commit 15bb74e

Browse files
committed
implement serialization for partition_data in 1d_stencil_5
Signed-off-by: the-ivii <divyanshitalreja12@gmail.com>
1 parent 43b8f63 commit 15bb74e

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

examples/1d_stencil/1d_stencil_5.cpp

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
#if !defined(HPX_COMPUTE_DEVICE_CODE)
2121
#include <hpx/hpx.hpp>
2222
#include <hpx/hpx_init.hpp>
23+
#include <hpx/serialization.hpp>
2324

2425
#include <memory>
2526

@@ -98,10 +99,22 @@ struct partition_data
9899
friend class hpx::serialization::access;
99100

100101
template <typename Archive>
101-
void serialize(Archive&, unsigned int const) const
102+
void save(Archive& ar, unsigned int const) const
102103
{
104+
ar & size_;
105+
ar& hpx::serialization::make_array(data_.get(), size_);
103106
}
104107

108+
template <typename Archive>
109+
void load(Archive& ar, unsigned int const)
110+
{
111+
ar & size_;
112+
data_.reset(new double[size_]);
113+
ar& hpx::serialization::make_array(data_.get(), size_);
114+
}
115+
116+
HPX_SERIALIZATION_SPLIT_MEMBER()
117+
105118
private:
106119
buffer_type data_;
107120
std::size_t size_;

0 commit comments

Comments
 (0)