27#include <alien/kernels/simple_csr/SimpleCSRMatrix.h>
37using namespace Arccore;
52 std::shared_ptr<ISpace> col_space, std::shared_ptr<MatrixDistribution> dist)
204 matrixCloned->setTimestamp(impl, matrixToClone.
timestamp());
206 impl->m_impls2.insert(
235 auto* candidate = impl.second;
237 if (candidate->timestamp() !=
timestamp())
242 if (converter ==
nullptr)
245 converter->convert(candidate, target);
251 UniqueArray<IMatrixImpl*> candidates;
253 auto* candidate = impl.second;
254 if (candidate->timestamp() ==
timestamp())
255 candidates.add(candidate);
257 if (candidates.empty()) {
258 auto msg = String::format(
"Matrix converter to: ", target->
backend(),
259 " internal error: no timestamp matching");
260 throw FatalErrorException(A_FUNCINFO, msg);
267 auto print_error = [&] {
269 cout() <<
"ALIEN FATAL ERROR \n"
270 <<
"Matrix converting to target backend '" << target->
backend() <<
"' :\n"
271 <<
"* no converter available from source backend(s)";
273 for (
auto* candidate : candidates) {
274 cout() <<
" ** '" << candidate->backend() <<
"'";
284 auto* simplecsr_target =
288 if (simplecsr_target ==
nullptr)
292 for (
auto* candidate : candidates) {
294 candidate->backend(), simplecsr->backend());
296 if (candidat_simplecsr !=
nullptr) {
298 candidat_simplecsr->convert(candidate, simplecsr);
299 simplecsr->copyTimestamp(*candidate);
301 simplecsr_target->convert(simplecsr, target);
Block elements for block matrices.
std::shared_ptr< Block > clone() const
Clone this object.
Interface to handle abstract matrices implementation.
virtual BackEndId backend() const
static IMatrixConverter * getConverter(BackEndId from, BackEndId to)
Get the converter from one matrix format to another one.
Multi matrices representation container.
void setColBlockInfos(const VBlock *blocks)
Set variable col block information.
std::shared_ptr< ISpace > m_row_space
The matrix row space.
std::shared_ptr< MatrixDistribution > m_distribution
The matrix distribution.
void setRowBlockInfos(const VBlock *blocks)
Set variable row block information.
void updateImpl(IMatrixImpl *target) const
Update a matrix implementation.
MultiMatrixImpl * clone() const
Clone this object.
MultiMatrixImpl()
Default constructor.
std::shared_ptr< VBlock > m_cols_block
The variable col block datas.
std::shared_ptr< Block > m_block
The uniform block datas.
void clear()
Clear resources.
void free()
Free resources.
IMatrixImpl *& getImpl(BackEndId backend) const
Get a specific matrix implementation.
std::shared_ptr< ISpace > m_col_space
The matrix column space.
virtual ~MultiMatrixImpl()
Free resources.
std::shared_ptr< VBlock > m_rows_block
The variable row block datas.
const Block * block() const
Get uniform block datas.
const VBlock * colBlock() const
Get variable col block datas.
MultiMatrixImplMap m_impls2
The matrices container.
const AlgebraTraits< tag >::matrix_type & get() const
Get a specific matrix implementation.
const VBlock * rowBlock() const
Get variable row block datas.
const VBlock * vblock() const
Get variable block datas.
void setBlockInfos(Arccore::Integer block_size)
Set uniform block information.
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.
-- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature --