CUV  0.9.201304091348
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
Files | Functions
Input/Output functions

input and output operations More...

Files

file  io.hpp
 serialization for tensors

Functions

template<class V , class T , class I >
ostream & std::operator<< (ostream &o, const cuv::dia_matrix< V, T, I > &w2)
 Return stream containing matrix entries for debugging.
template<class Archive , class V , class M >
void boost::serialization::load (Archive &ar, cuv::memory< V, M > &m, const unsigned int version)
 load a memory
template<class Archive , class V , class M >
void boost::serialization::save (Archive &ar, const cuv::memory< V, M > &m, const unsigned int version)
 save a memory
template<class Archive , class V , class M >
void boost::serialization::serialize (Archive &ar, cuv::memory< V, M > &m, const unsigned int version)
 load/save dev memory (dispatch to load/save)
template<class Archive , class V >
void boost::serialization::serialize (Archive &ar, cuv::pitched_memory< V, cuv::dev_memory_space > &m, const unsigned int version)
 load/save dev pitched memory (dispatch to load/save)
template<class Archive , class V , class MS >
void boost::serialization::serialize (Archive &ar, cuv::linear_memory< V, MS > &m, const unsigned int version)
 load/save linear memory (dispatch to load/save)
template<class Archive , class V , class MS , class ML >
void boost::serialization::save (Archive &ar, const cuv::tensor< V, MS, ML > &t, const unsigned int version)
 serialize a tensor
template<class Archive , class V , class MS , class ML >
void boost::serialization::load (Archive &ar, cuv::tensor< V, MS, ML > &t, const unsigned int version)
 deserialize a tensor
template<class Archive , class V , class MS , class ML >
void boost::serialization::serialize (Archive &ar, cuv::tensor< V, MS, ML > &t, const unsigned int version)
 load/save tensor (dispatch to load/save)

Detailed Description

input and output operations

Loading and saving of CUV data structures

File and string I/O is implemented using boost::serialization. Nothing surprising here.

Example usage:

tensor<...> m, n; // ...
{
std::ofstream os("test.dat");
boost::archive::binary_oarchive oa(os);
oa << m;
}
{
std::ifstream is("test.dat");
boost::archive::binary_iarchive ia(is);
ia >> n;
}
Warning
This probably will not work in .cu files which are processed by nvcc.

Function Documentation

template<class Archive , class V , class MS , class ML >
void boost::serialization::load ( Archive &  ar,
cuv::tensor< V, MS, ML > &  t,
const unsigned int  version 
)

deserialize a tensor

Parameters
aran archive to save to
ta memory to be restored
version(unused) protocol version

Definition at line 189 of file io.hpp.

template<class V , class T , class I >
ostream& std::operator<< ( ostream &  o,
const cuv::dia_matrix< V, T, I > &  w2 
)

Return stream containing matrix entries for debugging.

Parameters
oOutput stream
w2Matrix to output

Definition at line 289 of file dia_matrix.hpp.

template<class Archive , class V , class MS , class ML >
void boost::serialization::save ( Archive &  ar,
const cuv::tensor< V, MS, ML > &  t,
const unsigned int  version 
)

serialize a tensor

Parameters
aran archive to save to
ta memory to be stored
version(unused) protocol version

Definition at line 172 of file io.hpp.

template<class Archive , class V , class M >
void boost::serialization::serialize ( Archive &  ar,
cuv::memory< V, M > &  m,
const unsigned int  version 
)

load/save dev memory (dispatch to load/save)

Parameters
aran archive to save to
ma memory to be stored
version(unused) protocol version

Definition at line 123 of file io.hpp.

template<class Archive , class V >
void boost::serialization::serialize ( Archive &  ar,
cuv::pitched_memory< V, cuv::dev_memory_space > &  m,
const unsigned int  version 
)

load/save dev pitched memory (dispatch to load/save)

Parameters
aran archive to save to
ma memory to be stored
version(unused) protocol version

Definition at line 135 of file io.hpp.

template<class Archive , class V , class MS >
void boost::serialization::serialize ( Archive &  ar,
cuv::linear_memory< V, MS > &  m,
const unsigned int  version 
)

load/save linear memory (dispatch to load/save)

Parameters
aran archive to save to
ma memory to be stored
version(unused) protocol version

Definition at line 155 of file io.hpp.

template<class Archive , class V , class MS , class ML >
void boost::serialization::serialize ( Archive &  ar,
cuv::tensor< V, MS, ML > &  t,
const unsigned int  version 
)

load/save tensor (dispatch to load/save)

Parameters
aran archive to save to
ta memory to be stored/restored
version(unused) protocol version

Definition at line 207 of file io.hpp.