20 #ifndef TILEDARRAY_DIST_EVAL_UNARY_EVAL_H__INCLUDED 21 #define TILEDARRAY_DIST_EVAL_UNARY_EVAL_H__INCLUDED 35 template <
typename Arg,
typename Op,
typename Policy>
38 public std::enable_shared_from_this<UnaryEvalImpl<Arg, Op, Policy> >
101 typedef typename std::conditional<op_type::is_consumable,
102 typename arg_type::value_type&,
103 const typename arg_type::value_type&>::type
110 void eval_tile(
const size_type i, tile_argument_type tile) {
121 virtual int internal_eval() {
123 std::shared_ptr<UnaryEvalImpl_>
self =
124 std::enable_shared_from_this<UnaryEvalImpl_>::shared_from_this();
133 const typename pmap_interface::const_iterator end = arg_.pmap()->end();
134 typename pmap_interface::const_iterator it = arg_.pmap()->begin();
135 for(; it != end; ++it) {
139 if(! arg_.is_zero(index)) {
145 target_index, arg_.get(index));
164 #endif // TILEDARRAY_DIST_EVAL_UNARY_EVAL_H__INCLUDED TensorImpl_::size_type size_type
Size type.
const shape_type & shape() const
Tensor shape accessor.
const trange_type & trange() const
Tiled range accessor.
DistEvalImpl_::range_type range_type
Range type.
Distributed evaluator implementation object.
UnaryEvalImpl(const arg_type &arg, World &world, const trange_type &trange, const shape_type &shape, const std::shared_ptr< pmap_interface > &pmap, const Permutation &perm, const op_type &op)
Constructor.
Arg arg_type
The argument tensor type.
UnaryEvalImpl< Arg, Op, Policy > UnaryEvalImpl_
This object type.
TensorImpl_::pmap_interface pmap_interface
process map interface type
Tensor implementation and base for other tensor implementation objects.
void set_tile(size_type i, const value_type &value)
Set tensor value.
TensorImpl_::trange_type trange_type
Tiled range type for this object.
size_type perm_index_to_target(size_type index) const
Permute index from a source index to a target index.
DistEvalImpl< typename Op::result_type, Policy > DistEvalImpl_
The base class type.
DistEvalImpl_::size_type size_type
Size type.
DistEvalImpl_::eval_type eval_type
Tile evaluation type.
Op op_type
Tile evaluation operator type.
TensorImpl_::shape_type shape_type
Shape type.
bool is_local(const Index &i) const
Query for a locally owned tile.
const madness::uniqueidT & id() const
Unique object id accessor.
Tensor that is composed from an argument tensor.
DistEvalImpl_::pmap_interface pmap_interface
Process map interface type.
bool is_zero(const Index &i) const
Query for a zero tile.
DistEvalImpl_::TensorImpl_ TensorImpl_
The base, base class type.
TensorImpl_::range_type range_type
Range type this tensor.
eval_trait< value_type >::type eval_type
Tile evaluation type.
DistEvalImpl_::shape_type shape_type
Shape type.
Permutation of a sequence of objects indexed by base-0 indices.
virtual Future< value_type > get_tile(size_type i) const
Get tile at index i.
DistEvalImpl_::trange_type trange_type
Tiled range type.
virtual ~UnaryEvalImpl()
Virtual destructor.
World & world() const
World accessor.
size_type perm_index_to_source(size_type index) const
Permute index from a target index to a source index.
const std::shared_ptr< pmap_interface > & pmap() const
Tensor process map accessor.
DistEvalImpl_::value_type value_type
Tile type.
An N-dimensional shallow copy wrapper for tile objects.
virtual void discard_tile(size_type i) const
Discard a tile that is not needed.