Exemple #1
0
  static void exec(LHS &lhs, RHS const &rhs)
  {
    if (parallel::has_same_map<D>(lhs.map(), rhs))
    {
      // Maps are same, no communication required.
      typedef typename distributed_local_block<LHS>::type lhs_local_block_type;
      typedef typename distributed_local_block<RHS>::type rhs_local_block_type;
      typedef typename block_traits<lhs_local_block_type>::plain_type 
	lhs_local_storage_type;
      typedef typename block_traits<rhs_local_block_type>::plain_type 
	rhs_local_storage_type;

      lhs_local_storage_type lhs_local_block = get_local_block(lhs);
      rhs_local_storage_type rhs_local_block = get_local_block(rhs);

      Dispatcher<D, lhs_local_block_type, rhs_local_block_type>::exec(lhs_local_block,
								      rhs_local_block);
    }
    else
    {
      // Maps are different, fall out to general expression.
      lhs_view_type lhs_view(lhs);
      rhs_view_type rhs_view(const_cast<RHS&>(rhs));
      parallel::expr(lhs_view, rhs_view);
    }
  }
Exemple #2
0
  static void exec(LHS &lhs, RHS const &rhs)
  {
    if (parallel::has_same_map<D>(lhs.map(), rhs))
    {
      // Maps are same, no communication required.
      typedef typename distributed_local_block<LHS>::type lhs_local_block_type;
      typedef typename distributed_local_block<RHS>::type rhs_local_block_type;
      typedef typename block_traits<lhs_local_block_type>::plain_type 
	lhs_local_storage_type;
      typedef typename block_traits<rhs_local_block_type>::plain_type
	rhs_local_storage_type;

      lhs_local_storage_type lhs_local_block = get_local_block(lhs);
      rhs_local_storage_type rhs_local_block = get_local_block(rhs);

      Dispatcher<D, lhs_local_block_type, rhs_local_block_type>::exec(lhs_local_block,
								      rhs_local_block);
    }
    else
    {
      OVXX_DO_THROW(unimplemented("Expression cannot be reorganized"));
    }
  }