10#include <alien/core/backend/IMatrixConverter.h>
13#include <alien/kernels/sycl/data/SYCLBEllPackMatrix.h>
14#include <alien/kernels/sycl/data/HCSRMatrix.h>
17#include <alien/kernels/sycl/SYCLBackEnd.h>
18#include <alien/kernels/simple_csr/CSRStructInfo.h>
20#include "alien/kernels/sycl/data/SYCLBEllPackInternal.h"
21#include "alien/kernels/sycl/data/HCSRMatrixInternal.h"
24using namespace Alien::SimpleCSRInternal;
31 HCSRtoSYCLMatrixConverter();
32 virtual ~HCSRtoSYCLMatrixConverter() {}
46HCSRtoSYCLMatrixConverter::HCSRtoSYCLMatrixConverter()
61 [&] { cout() <<
"Converting HCSRMatrix: " << &v <<
" to SYCLBEllPackMatrix " << &v2; });
66void HCSRtoSYCLMatrixConverter::_build(
69 typedef HCSRMatrix<Real>::MatrixInternal HCSRMatrixType;
74 const Integer localOffset = dist.
rowOffset();
75 auto const& matrixInternal = *sourceImpl.internal();
78 auto const& matrix_profile = sourceImpl.internal()->getCSRProfile();
79 int nrows = matrix_profile.getNRow();
80 int const* kcol = matrix_profile.getRowOffset().unguardedBasePointer();
81 int const* cols = matrix_profile.getCols().unguardedBasePointer();
89 sourceImpl.getDistStructInfo())) {
90 throw FatalErrorException(A_FUNCINFO,
"SYCL Initialisation failed");
93 if (not targetImpl.internal()->setMatrixValues(matrixInternal.values())) {
94 throw FatalErrorException(A_FUNCINFO,
"Cannot set SYCL Matrix Values");
MatrixConverterRegisterer.h.
#define REGISTER_MATRIX_CONVERTER(converter)
Macro to register a matrix converter.
Alien::BackEndId BackEndId
Type of matrix backend.
Alien::IMatrixImpl IMatrixImpl
Type of matrix implementation.
static T & cast(IMatrixImpl *impl, BackEndId backend)
Cast a matrix implementation in its actual type.
Interface to handle abstract matrices implementation.
virtual const MatrixDistribution & distribution() const
Get the distribution of the matrix.
Computes a matrix distribution.
Arccore::Integer globalRowSize() const
Get the global row size.
Arccore::Integer rowOffset() const
Get the row offset.
Arccore::MessagePassing::IMessagePassingMng * parallelMng() const
Get the parallel manager.
void convert(const IMatrixImpl *sourceImpl, IMatrixImpl *targetImpl) const
Convert a matrix from one format to another.
BackEndId targetBackend() const
Get the target backend id.
BackEndId sourceBackend() const
Get the source backend id.
-- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature --