CUV  0.9.201304091348
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
Classes | Namespaces | Typedefs | Functions
tensor.hpp File Reference

an n-dimensional array on host or device More...

#include <iostream>
#include <vector>
#include <stdexcept>
#include <numeric>
#include <boost/shared_ptr.hpp>
#include <boost/multi_array/extent_gen.hpp>
#include <boost/multi_array/index_gen.hpp>
#include <cuv/tools/cuv_general.hpp>
#include <cuv/tools/meta_programming.hpp>
#include "reference.hpp"
Include dependency graph for tensor.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  cuv::column_major
 Tag for column major matrices. More...
struct  cuv::row_major
 Tag for row major matrices. More...
struct  cuv::linear_memory_tag
 tag for linear memory More...
struct  cuv::pitched_memory_tag
 tag for pitched memory More...
struct  cuv::other_memory_layout< T >
 converts from column to row-major and vice versa More...
struct  cuv::other_memory_layout< column_major >
 specialisation: converts from column to row-major More...
struct  cuv::other_memory_layout< row_major >
 specialisation: converts from row to column-major More...
struct  cuv::other_memory_space< T >
 converts from dev to host memory space and vice versa More...
struct  cuv::other_memory_space< dev_memory_space >
 specialisation: converts from dev_memory_space to host_memory_space More...
struct  cuv::other_memory_space< host_memory_space >
 specialisation: converts from host_memory_space to dev_memory_space More...
class  cuv::memory< V, M >
 simply keeps a pointer and deallocates it when destroyed More...
class  cuv::linear_memory< V, M >
 represents contiguous memory More...
class  cuv::pitched_memory< V, M >
 represents 2D non-contiguous ("pitched") memory More...
struct  cuv::tensor_info< M, L >
 contains infos about shape and stride on host and in the tensor data space. More...
class  cuv::tensor< V, M, L >
 represents an n-dimensional array on GPU or CPU. More...
class  cuv::tensor_view< V, M, L >
 primarily used as result of tensor::operator[] More...
struct  cuv::switch_value_type< Mat, NewVT >
 create a tensor type with the same template parameters, but with switched value type More...
struct  cuv::switch_memory_layout_type< Mat, NewML >
 create a tensor type with the same template parameters, but with switched memory_layout_type More...
struct  cuv::switch_memory_space_type< Mat, NewMS >
 create a tensor type with the same template parameters, but with switched memory_space_type More...

Namespaces

namespace  boost
 cuv additions to the boost namespace
namespace  boost::serialization
 serialization functions for cuv data structures
namespace  cuv
 contains all cuv functionality

Typedefs

typedef
boost::detail::multi_array::index_range
< boost::detail::multi_array::index,
boost::detail::multi_array::size_type > 
cuv::index_range
 defines an index range, stolen from boost::multi_array
typedef index_range::index cuv::index
 the index type used in index_range, useful for comparator syntax in

Functions

template<class V , class M , class L , class S >
void cuv::fill (tensor< V, M, L > &v, const V &p)
 used in implementation of tensor.operator= for value_type argument
bool cuv::detail::is_c_contiguous (row_major, const linear_memory< unsigned int, host_memory_space > &shape, const linear_memory< int, host_memory_space > &stride)
 true iff there are no "holes" in memory
bool cuv::detail::is_c_contiguous (column_major, const linear_memory< unsigned int, host_memory_space > &shape, const linear_memory< int, host_memory_space > &stride)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
bool cuv::detail::is_2dcopyable (row_major, const linear_memory< unsigned int, host_memory_space > &shape, const linear_memory< int, host_memory_space > &stride)
 returns true iff memory can be copied using copy2d
bool cuv::detail::is_2dcopyable (column_major, const linear_memory< unsigned int, host_memory_space > &shape, const linear_memory< int, host_memory_space > &stride)
template<class index_type , class size_type >
void cuv::detail::get_pitched_params (size_type &rows, size_type &cols, size_type &pitch, const linear_memory< size_type, host_memory_space > &shape, const linear_memory< index_type, host_memory_space > &stride, row_major)
 this is intended for copying pitched memory.
template<class index_type , class size_type >
void cuv::detail::get_pitched_params (size_type &rows, size_type &cols, size_type &pitch, const linear_memory< size_type, host_memory_space > &shape, const linear_memory< index_type, host_memory_space > &stride, column_major)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
template<class V , class M0 , class M1 , class L0 , class L1 >
bool cuv::copy_memory (tensor< V, M0, L0 > &dst, const tensor< V, M1, L1 > &src, bool force_dst_contiguous)
 tries to copy memory, succeeds if shapes match AND both tensors are c_contiguous of 2dcopyable.
template<class V , class M0 , class M1 , class L0 , class L1 >
void cuv::copy_memory (tensor< V, M0, L0 > &dst, const tensor< V, M1, L1 > &src, linear_memory_tag)
 copies between different memory spaces
template<class V , class M0 , class M1 , class L0 , class L1 >
void cuv::copy_memory (tensor< V, M0, L0 > &dst, const tensor< V, M1, L1 > &src, pitched_memory_tag)
 copies between different memory spaces
template<class V , class V2 , class M , class M2 , class L >
bool cuv::equal_shape (const tensor< V, M, L > &a, const tensor< V2, M2, L > &b)
 test whether two tensors have the same shape
template<class V >
ostream & std::operator<< (ostream &o, const cuv::linear_memory< V, cuv::host_memory_space > &t)
 print a host linear memory to a stream
template<class V >
ostream & std::operator<< (ostream &o, const cuv::linear_memory< V, cuv::dev_memory_space > &t_)
 print a dev linear memory to a stream (copies first)
template<class V >
ostream & std::operator<< (ostream &o, const cuv::pitched_memory< V, cuv::host_memory_space > &t)
 print a host pitched memory to a stream
template<class V >
ostream & std::operator<< (ostream &o, const cuv::pitched_memory< V, cuv::dev_memory_space > &t_)
 print a dev pitched memory to a stream (copies first)
template<class V , class L >
ostream & std::operator<< (ostream &o, const cuv::tensor< V, cuv::dev_memory_space, L > &t)
 print a dev tensor to a stream (copying to host first)
template<class V , class L >
ostream & std::operator<< (ostream &o, const cuv::tensor< V, cuv::host_memory_space, L > &t)
 print a host tensor to a stream

Detailed Description

an n-dimensional array on host or device

Author
Hannes Schulz
Date
2012-01-25

Definition in file tensor.hpp.