Go to the documentation of this file.
26 #ifndef TILEDARRAY_DIST_EVAL_ARRAY_EVAL_H__INCLUDED
27 #define TILEDARRAY_DIST_EVAL_ARRAY_EVAL_H__INCLUDED
41 template <
typename Tile,
typename Op>
50 std::shared_ptr<op_type>
59 ((!Op::is_consumable) && consume_ ? op_->consume(tile_)
62 #ifdef TILEDARRAY_HAS_CUDA
72 #ifdef TILEDARRAY_HAS_CUDA
85 consume_(other.consume_)
86 #ifdef TILEDARRAY_HAS_CUDA
103 #ifdef TILEDARRAY_HAS_CUDA
116 consume_ = other.consume_;
117 #ifdef TILEDARRAY_HAS_CUDA
118 conversion_tile_ = other.conversion_tile_;
129 #ifdef TILEDARRAY_HAS_CUDA
133 std::move(((!Op::is_consumable) && consume_ ? op_->consume(tile_)
135 return conversion_tile_;
140 return ((!Op::is_consumable) && consume_ ? op_->consume(tile_)
151 template <
typename Archive>
169 template <
typename Array,
typename Op,
typename Policy>
171 :
public DistEvalImpl<LazyArrayTile<typename Array::value_type, Op>,
173 public std::enable_shared_from_this<ArrayEvalImpl<Array, Op, Policy>> {
193 using std::enable_shared_from_this<
198 std::shared_ptr<op_type> op_;
211 template <
typename Perm,
typename = std::enable_if_t<
212 TiledArray::detail::is_permutation_v<Perm>>>
215 const std::shared_ptr<pmap_interface>&
pmap,
const Perm& perm,
219 op_(std::make_shared<
op_type>(op)),
235 template <
typename Index1,
typename Index2,
typename Perm,
236 typename = std::enable_if_t<
237 TiledArray::detail::is_integral_range_v<Index1> &&
238 TiledArray::detail::is_integral_range_v<Index2> &&
239 TiledArray::detail::is_permutation_v<Perm>>>
242 const std::shared_ptr<pmap_interface>&
pmap,
const Perm& perm,
243 const op_type& op,
const Index1& lower_bound,
244 const Index2& upper_bound)
247 op_(std::make_shared<
op_type>(op)),
259 if (block_range_.
rank()) array_index = block_range_.
ordinal(array_index);
264 const bool consumable_tile = !array_.
is_local(array_index);
266 return eval_tile(tile, consumable_tile);
279 const bool consume)
const {
286 const bool consumable_tile)
const {
291 result.set(make_tile(tile, consumable_tile));
297 shared_from_this(), &ArrayEvalImpl_::make_tile, tile, consumable_tile,
298 madness::TaskAttributes::hipri());
308 virtual int internal_eval() {
317 typename array_type::pmap_interface::const_iterator it =
319 const typename array_type::pmap_interface::const_iterator
end =
322 for (; it !=
end; ++it) {
335 #endif // TILEDARRAY_DIST_EVAL_ARRAY_EVAL_H__INCLUDED
impl_type::value_type value_type
Tile type.
World & world() const
World accessor.
DistEvalImpl_::range_type range_type
Range type.
LazyArrayTile()
Default constructor.
ArrayEvalImpl(const array_type &array, World &world, const trange_type &trange, const shape_type &shape, const std::shared_ptr< pmap_interface > &pmap, const Perm &perm, const op_type &op)
Construct with full array range.
DistEvalImpl_::TensorImpl_ TensorImpl_
The base, base class type.
bool is_zero(const Index &i) const
Query for a zero tile.
bool is_dense() const
Query the density of the tensor.
LazyArrayTile_ & operator=(const LazyArrayTile_ &other)
Assignment operator.
Distributed evaluator for TiledArray::Array objects.
ArrayEvalImpl(const array_type &array, World &world, const trange_type &trange, const shape_type &shape, const std::shared_ptr< pmap_interface > &pmap, const Perm &perm, const op_type &op, const Index1 &lower_bound, const Index2 &upper_bound)
Constructor with sub-block range.
LazyArrayTile< Tile, Op > LazyArrayTile_
This class type.
const range_type & tiles_range() const
Tiles range accessor.
Lazy tile for on-the-fly evaluation of array tiles.
decltype(((!Op::is_consumable) &&consume_ ? op_->consume(tile_) :(*op_)(tile_))) conversion_result_type
conversion_type
const std::shared_ptr< pmap_interface > & pmap() const
Tensor process map accessor.
Range that references a subblock of another range.
ArrayEvalImpl< Array, Op, Policy > ArrayEvalImpl_
This object type.
virtual void discard_tile(ordinal_type) const
Discard a tile that is not needed.
Distributed evaluator implementation object.
constexpr auto end(Eigen::Matrix< _Scalar, _Rows, 1, _Options, _MaxRows, 1 > &m)
auto outer(const Permutation &p)
LazyArrayTile(const LazyArrayTile_ &other)
Copy constructor.
DistEvalImpl_::trange_type trange_type
tiled range type
Op op_type
Tile evaluation operator type.
virtual ~ArrayEvalImpl()
Virtual destructor.
Tensor implementation and base for other tensor implementation objects.
#define TA_ASSERT(EXPR,...)
Op op_type
The operation that will modify this tile.
DistEvalImpl_::pmap_interface pmap_interface
Process map interface type.
DistEvalImpl_::ordinal_type ordinal_type
Ordinal type.
ordinal_type perm_index_to_source(ordinal_type index) const
Permute index from a target index to a source index.
DistEvalImpl_::value_type value_type
value type = LazyArrayTile
ordinal_type ordinal(const Index &index) const
calculate the ordinal index of i
Future< value_type > find(const Index &i) const
Find local or remote tile by index.
bool is_consumable() const
Query runtime consumable status.
LazyArrayTile(const tile_type &tile, const std::shared_ptr< op_type > &op, const bool consume)
Construct from tile and operation.
TensorImpl_::ordinal_type ordinal_type
Ordinal type.
Tile tile_type
The input tile type.
const tile_type & tile() const
return ref to input tile
bool is_local(const Index &i) const
Check if the tile at index i is stored locally.
TensorImpl_::range_type range_type
Range type this tensor.
TensorImpl_::shape_type shape_type
Shape type.
virtual void notify()
Tile set notification.
void serialize(const Archive &)
Serialization (not implemented)
TensorImpl_::pmap_interface pmap_interface
process map interface type
op_type::result_type eval_type
DistEvalImpl_::shape_type shape_type
Shape type.
DistEvalImpl< LazyArrayTile< typename Array::value_type, Op >, Policy > DistEvalImpl_
The base class type.
Determine the object type used in the evaluation of tensor expressions.
virtual Future< value_type > get_tile(ordinal_type i) const
Get tile at index i.
const trange_type & trange() const
Tiled range accessor.
const shape_type & shape() const
Tensor shape accessor.
Array array_type
The array type.
TensorImpl_::trange_type trange_type
Tiled range type for this object.
unsigned int rank() const
Rank accessor.
An N-dimensional shallow copy wrapper for tile objects.