TiledArray::detail::TensorImpl< Policy > Class Template Reference
Inheritance diagram for TiledArray::detail::TensorImpl< Policy >:
Collaboration diagram for TiledArray::detail::TensorImpl< Policy >:

Documentation

template<typename Policy>
class TiledArray::detail::TensorImpl< Policy >

Tensor implementation and base for other tensor implementation objects.

This implementation object holds the meta data for tensor object, which includes tiled range, shape, and process map.

Note
The process map must be set before data elements can be set.
It is the users responsibility to ensure the process maps on all nodes are identical.

Definition at line 39 of file tensor_impl.h.

Public Types

typedef TensorImpl< Policy > TensorImpl_
 
typedef Policy policy_type
 Policy type. More...
 
typedef Policy::trange_type trange_type
 Tiled range type. More...
 
typedef Policy::range_type range_type
 Element/tile range type. More...
 
typedef Policy::index1_type index1_type
 1-index type More...
 
typedef Policy::ordinal_type ordinal_type
 Ordinal type. More...
 
typedef Policy::shape_type shape_type
 Tensor shape type. More...
 
typedef Policy::pmap_interface pmap_interface
 Process map interface type. More...
 

Public Member Functions

 TensorImpl (World &world, const trange_type &trange, const shape_type &shape, const std::shared_ptr< pmap_interface > &pmap)
 Constructor. More...
 
virtual ~TensorImpl ()
 Virtual destructor. More...
 
const std::shared_ptr< pmap_interface > & pmap () const
 Tensor process map accessor. More...
 
const range_typetiles_range () const
 Tiles range accessor. More...
 
ordinal_type size () const
 Tensor tile volume accessor. More...
 
ordinal_type local_size () const
 Local element count. More...
 
template<typename Index >
ProcessID owner (const Index &i) const
 Query a tile owner. More...
 
template<typename Index >
bool is_local (const Index &i) const
 Query for a locally owned tile. More...
 
template<typename Index >
bool is_zero (const Index &i) const
 Query for a zero tile. More...
 
bool is_dense () const
 Query the density of the tensor. More...
 
const shape_typeshape () const
 Tensor shape accessor. More...
 
const trange_typetrange () const
 Tiled range accessor. More...
 
World & get_world () const
 
World & world () const
 World accessor. More...
 

Member Typedef Documentation

◆ index1_type

template<typename Policy >
typedef Policy::index1_type TiledArray::detail::TensorImpl< Policy >::index1_type

1-index type

Definition at line 45 of file tensor_impl.h.

◆ ordinal_type

template<typename Policy >
typedef Policy::ordinal_type TiledArray::detail::TensorImpl< Policy >::ordinal_type

Ordinal type.

Definition at line 46 of file tensor_impl.h.

◆ pmap_interface

template<typename Policy >
typedef Policy::pmap_interface TiledArray::detail::TensorImpl< Policy >::pmap_interface

Process map interface type.

Definition at line 49 of file tensor_impl.h.

◆ policy_type

template<typename Policy >
typedef Policy TiledArray::detail::TensorImpl< Policy >::policy_type

Policy type.

Definition at line 42 of file tensor_impl.h.

◆ range_type

template<typename Policy >
typedef Policy::range_type TiledArray::detail::TensorImpl< Policy >::range_type

Element/tile range type.

Definition at line 44 of file tensor_impl.h.

◆ shape_type

template<typename Policy >
typedef Policy::shape_type TiledArray::detail::TensorImpl< Policy >::shape_type

Tensor shape type.

Definition at line 47 of file tensor_impl.h.

◆ TensorImpl_

template<typename Policy >
typedef TensorImpl<Policy> TiledArray::detail::TensorImpl< Policy >::TensorImpl_

Definition at line 41 of file tensor_impl.h.

◆ trange_type

template<typename Policy >
typedef Policy::trange_type TiledArray::detail::TensorImpl< Policy >::trange_type

Tiled range type.

Definition at line 43 of file tensor_impl.h.

Constructor & Destructor Documentation

◆ TensorImpl()

template<typename Policy >
TiledArray::detail::TensorImpl< Policy >::TensorImpl ( World &  world,
const trange_type trange,
const shape_type shape,
const std::shared_ptr< pmap_interface > &  pmap 
)
inline

Constructor.

The size of shape must be equal to the volume of the tiled range tiles.

Parameters
worldThe world where this tensor will live
trangeThe tiled range for this tensor
shapeThe shape of this tensor
pmapThe tile-process map
Exceptions
TiledArray::ExceptionWhen the size of shape is not equal to zero

Definition at line 67 of file tensor_impl.h.

Here is the call graph for this function:

◆ ~TensorImpl()

template<typename Policy >
virtual TiledArray::detail::TensorImpl< Policy >::~TensorImpl ( )
inlinevirtual

Virtual destructor.

Definition at line 83 of file tensor_impl.h.

Member Function Documentation

◆ get_world()

template<typename Policy >
World& TiledArray::detail::TensorImpl< Policy >::get_world ( ) const
inline
Deprecated:
use TensorImpl::world()

Definition at line 170 of file tensor_impl.h.

◆ is_dense()

template<typename Policy >
bool TiledArray::detail::TensorImpl< Policy >::is_dense ( ) const
inline

Query the density of the tensor.

Returns
true if the tensor is dense, otherwise false
Exceptions
nothing

Definition at line 156 of file tensor_impl.h.

Here is the caller graph for this function:

◆ is_local()

template<typename Policy >
template<typename Index >
bool TiledArray::detail::TensorImpl< Policy >::is_local ( const Index &  i) const
inline

Query for a locally owned tile.

Template Parameters
IndexThe index type
Parameters
iThe tile index to query
Returns
true if the tile is owned by this node, otherwise false
Exceptions
TiledArray::ExceptionWhen the process map has not been set

Definition at line 134 of file tensor_impl.h.

Here is the caller graph for this function:

◆ is_zero()

template<typename Policy >
template<typename Index >
bool TiledArray::detail::TensorImpl< Policy >::is_zero ( const Index &  i) const
inline

Query for a zero tile.

Template Parameters
IndexThe index type
Parameters
iThe tile index to query
Returns
true if the tile is zero, otherwise false
Exceptions
TiledArray::ExceptionWhen i is outside the tiled range tile range

Definition at line 147 of file tensor_impl.h.

Here is the caller graph for this function:

◆ local_size()

template<typename Policy >
ordinal_type TiledArray::detail::TensorImpl< Policy >::local_size ( ) const
inline

Local element count.

This function is primarily available for debugging purposes. The returned value is volatile and may change at any time; you should not rely on it in your algorithms.

Returns
The current number of local tiles stored in the tensor.

Definition at line 109 of file tensor_impl.h.

◆ owner()

template<typename Policy >
template<typename Index >
ProcessID TiledArray::detail::TensorImpl< Policy >::owner ( const Index &  i) const
inline

Query a tile owner.

Template Parameters
IndexThe index type
Parameters
iThe tile index to query
Returns
The process ID of the node that owns tile i
Exceptions
TiledArray::ExceptionWhen i is outside the tiled range tile range
TiledArray::ExceptionWhen the process map has not been set

Definition at line 122 of file tensor_impl.h.

Here is the caller graph for this function:

◆ pmap()

template<typename Policy >
const std::shared_ptr<pmap_interface>& TiledArray::detail::TensorImpl< Policy >::pmap ( ) const
inline

Tensor process map accessor.

Returns
A shared pointer to the process map of this tensor
Exceptions
nothing

Definition at line 89 of file tensor_impl.h.

Here is the caller graph for this function:

◆ shape()

template<typename Policy >
const shape_type& TiledArray::detail::TensorImpl< Policy >::shape ( ) const
inline

Tensor shape accessor.

Returns
A reference to the tensor shape map
Exceptions
TiledArray::ExceptionWhen this tensor is dense

Definition at line 162 of file tensor_impl.h.

Here is the caller graph for this function:

◆ size()

template<typename Policy >
ordinal_type TiledArray::detail::TensorImpl< Policy >::size ( ) const
inline

Tensor tile volume accessor.

Returns
The number of tiles in the tensor
Exceptions
nothing

Definition at line 101 of file tensor_impl.h.

Here is the caller graph for this function:

◆ tiles_range()

template<typename Policy >
const range_type& TiledArray::detail::TensorImpl< Policy >::tiles_range ( ) const
inline

Tiles range accessor.

Returns
The range of tile indices
Exceptions
nothing

Definition at line 95 of file tensor_impl.h.

Here is the caller graph for this function:

◆ trange()

template<typename Policy >
const trange_type& TiledArray::detail::TensorImpl< Policy >::trange ( ) const
inline

Tiled range accessor.

Returns
The tiled range of the tensor

Definition at line 167 of file tensor_impl.h.

Here is the caller graph for this function:

◆ world()

template<typename Policy >
World& TiledArray::detail::TensorImpl< Policy >::world ( ) const
inline

World accessor.

Returns
A reference to the world that contains this tensor

Definition at line 175 of file tensor_impl.h.

Here is the caller graph for this function:

The documentation for this class was generated from the following file: