nmlp_base_iostream.hpp (3510B)
1 /** 2 * @file 3 * @brief nmlp base classe iostream function declarations. 4 * 5 * @attention This file can be included in multiple translation unit, but then, the file nmlp_iostream_exports.hpp must be included once per binary. 6 */ 7 8 #ifndef NMLP_BASE_IOSTREAM_HPP_INCLUDED 9 #define NMLP_BASE_IOSTREAM_HPP_INCLUDED 10 11 #include <boost/serialization/export.hpp> 12 #include <boost/serialization/split_free.hpp> 13 #include <nmlp/CPUMatrix.h> 14 #include <nmlp/CPUSparseMatrix.h> 15 #include <nmlp/GPUMatrix.h> 16 #include <nmlp/Tensor.h> 17 18 /** @brief Serialization save operator of CPUMatrix. */ 19 template<class Archive> 20 void save(Archive &ar, CPUMatrix const &rhs, unsigned const version); 21 /** @brief Serialization pre-save operator of CPUMatrix. */ 22 template<class Archive> 23 void save_construct_data(Archive &ar, CPUMatrix const *rhs, unsigned const version); 24 25 /** @brief Serialization load operator of CPUMatrix. */ 26 template<class Archive> 27 void load(Archive &ar, CPUMatrix &rhs, unsigned const version); 28 /** @brief Serialization pre-load operator of CPUMatrix. */ 29 template<class Archive> 30 void load_construct_data(Archive &ar, CPUMatrix *rhs, unsigned const version); 31 32 /** @brief Serialization save operator of GPUMatrix. */ 33 template<class Archive> 34 void save(Archive &ar, GPUMatrix const &rhs, unsigned const version); 35 /** @brief Serialization pre-save operator of GPUMatrix. */ 36 template<class Archive> 37 void save_construct_data(Archive &ar, GPUMatrix const *rhs, unsigned const version); 38 39 /** @brief Serialization load operator of GPUMatrix. */ 40 template<class Archive> 41 void load(Archive &ar, GPUMatrix &rhs, unsigned const version); 42 /** @brief Serialization pre-load operator of GPUMatrix. */ 43 template<class Archive> 44 void load_construct_data(Archive &ar, GPUMatrix *rhs, unsigned const version); 45 46 /** 47 * @brief Serialization save operator of CPUSparseMatrix. 48 * 49 * @attention CPUSparseMatrix is accessed through a member iterator, it is set to end after this function is called. 50 */ 51 template<class Archive> 52 void save(Archive &ar, CPUSparseMatrix const &rhs, unsigned const version); 53 /** @brief Serialization pre-save operator of CPUSparseMatrix. */ 54 template<class Archive> 55 void save_construct_data(Archive &ar, CPUSparseMatrix const *rhs, unsigned const version); 56 57 /** @brief Serialization load operator of CPUSparseMatrix. 58 * 59 * @attention CPUSparseMatrix is accessed through a member iterator, it is set to end after this function is called. 60 */ 61 template<class Archive> 62 void load(Archive &ar, CPUSparseMatrix &rhs, unsigned const version); 63 /** @brief Serialization pre-load operator of CPUSparseMatrix. */ 64 template<class Archive> 65 void load_construct_data(Archive &ar, CPUSparseMatrix *rhs, unsigned const version); 66 67 /** @brief Serialization save operator of Tensor. */ 68 template<class Archive> 69 void save(Archive &ar, Tensor const &rhs, unsigned const version); 70 /** @brief Serialization pre-save operator of Tensor. */ 71 template<class Archive> 72 void save_construct_data(Archive &ar, Tensor const *rhs, unsigned const version); 73 74 /** @brief Serialization load operator of Tensor. */ 75 template<class Archive> 76 void load(Archive &ar, Tensor &rhs, unsigned const version); 77 /** @brief Serialization pre-load operator of Tensor. */ 78 template<class Archive> 79 void load_construct_data(Archive &ar, Tensor *rhs, unsigned const version); 80 81 BOOST_SERIALIZATION_SPLIT_FREE(CPUMatrix) 82 BOOST_SERIALIZATION_SPLIT_FREE(GPUMatrix) 83 BOOST_SERIALIZATION_SPLIT_FREE(CPUSparseMatrix) 84 BOOST_SERIALIZATION_SPLIT_FREE(Tensor) 85 86 #include "nmlp_base_iostream.ipp" 87 88 #endif 89