36 #ifndef __CUV_BASICS_IO_HPP__
37 #define __CUV_BASICS_IO_HPP__
38 #include <boost/serialization/base_object.hpp>
39 #include <boost/serialization/vector.hpp>
40 #include <boost/serialization/shared_ptr.hpp>
41 #include <boost/serialization/array.hpp>
42 #include <boost/serialization/split_free.hpp>
49 namespace serialization
83 template<
class Archive,
class V,
class M>
89 ar >> make_array(tmp,size);
93 a.
alloc(&tmpo,
sizeof(V)*size);
102 template<
class Archive,
class V,
class M>
108 V* tmp =
new V[size];
111 ar << make_array(tmp, size);
122 template<
class Archive,
class V,
class M>
124 boost::serialization::split_free(ar, m, version);
134 template<
class Archive,
class V>
136 ar & boost::serialization::base_object<cuv::memory<V,cuv::dev_memory_space> >(m);
154 template<
class Archive,
class V,
class MS>
156 ar & boost::serialization::base_object<cuv::memory<V,MS> >(m);
171 template<
class Archive,
class V,
class MS,
class ML>
173 ar << t.
info().host_shape
174 << t.
info().host_stride;
177 long int i = (
long int)t.
ptr() - (
long int)t.
mem()->ptr();
188 template<
class Archive,
class V,
class MS,
class ML>
190 ar >> t.
info().host_shape;
191 ar >> t.
info().host_stride;
206 template<
class Archive,
class V,
class MS,
class ML>
208 boost::serialization::split_free(ar, t, version);