26#include <alien/kernels/simple_csr/SimpleCSRVector.h>
34using namespace Arccore;
108 for (MultiVectorImplMap::iterator i =
m_impls2.begin(); i !=
m_impls2.end(); ++i) {
120 for (MultiVectorImplMap::iterator i =
m_impls2.begin(); i !=
m_impls2.end(); ++i) {
157 vectorCloned->setTimestamp(impl, vectorToClone.
timestamp());
159 impl->m_impls2.insert(
188 auto* candidate = impl.second;
190 if (candidate->timestamp() !=
timestamp())
195 if (converter ==
nullptr)
198 converter->convert(candidate, target);
204 UniqueArray<IVectorImpl*> candidates;
206 auto* candidate = impl.second;
207 if (candidate->timestamp() ==
timestamp())
208 candidates.add(candidate);
210 if (candidates.empty()) {
211 auto msg = String::format(
"Vector converter to: ", target->
backend(),
212 " internal error: no timestamp matching");
213 throw FatalErrorException(A_FUNCINFO, msg);
220 auto print_error = [&] {
222 cout() <<
"ALIEN FATAL ERROR \n"
223 <<
"Vector converting to target backend '" << target->
backend() <<
"' :\n"
224 <<
"* no converter available from source backend(s)";
226 for (
auto* candidate : candidates) {
227 cout() <<
" ** '" << candidate->backend() <<
"'";
237 auto* simplecsr_target =
241 if (simplecsr_target ==
nullptr)
245 for (
auto* candidate : candidates) {
247 candidate->backend(), simplecsr->backend());
249 if (candidat_simplecsr !=
nullptr) {
251 candidat_simplecsr->convert(candidate, simplecsr);
252 simplecsr->copyTimestamp(*candidate);
254 simplecsr_target->convert(simplecsr, target);
Block elements for block matrices.
std::shared_ptr< Block > clone() const
Clone this object.
Interface to handle abstract vectors implementation.
virtual BackEndId backend() const
std::shared_ptr< ISpace > m_space
The vector space.
std::shared_ptr< VectorDistribution > m_distribution
The vector distribution.
std::shared_ptr< Block > m_block
The uniform block datas.
~MultiVectorImpl() override
Free resources.
void free()
Free resources.
void updateImpl(IVectorImpl *target) const
Update a vector implementation.
MultiVectorImplMap m_impls2
The vectors container.
void clear()
Clear resources.
MultiVectorImpl * clone() const
Clone this object.
const AlgebraTraits< tag >::vector_type & get() const
Get a specific vector implementation.
const Block * block() const
Get uniform block datas.
const VectorDistribution & distribution() const
Get the vector distribution.
void setBlockInfos(const Block *blocks)
Set uniform block information.
std::shared_ptr< VBlock > m_variable_block
The variable block datas.
const ISpace & space() const
Get the space associated with the vector.
IVectorImpl *& getImpl(BackEndId backend) const
Get a specific vector implementation.
const VBlock * vblock() const
Get variable block datas.
Int64 timestamp() const
Valeur du timestamp de référence.
virtual Int64 timestamp() const
Donne la valeur courante du timestamp.
void updateTimestamp()
Met à jour le timestamp.
void copyTimestamp(const Timestamp &v)
Copy un autre timestamp.
Variable size block elements for block matrices.
std::shared_ptr< VBlock > clone() const
Copy this object.
static IVectorConverter * getConverter(BackEndId from, BackEndId to)
Get the converter from one vector format to another one.
MultiVectorImpl()
Multi vectors representation container.
-- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature --