76 static constexpr bool on_host_only = false ;
79 typedef ValueT ValueType;
80 typedef ValueT value_type ;
88 typedef typename ProfileType::IndexType IndexType ;
107 void setTraceMng(ITraceMng* trace_mng) { m_trace = trace_mng; }
109 ProfileType
const& getProfile()
const
111 return *m_profilePKSIZE;
114 HCSRView hcsrView(BackEnd::Memory::eType memory,
int nrows,
int nnz)
const;
116 ValueType* getAddressData();
119 ValueType
const* getAddressData()
const;
120 ValueType
const* data()
const;
122 IMessagePassingMng* getParallelMng()
124 return m_parallel_mng;
128 bool initMatrix(Arccore::MessagePassing::IMessagePassingMng* parallel_mng,
129 Integer local_offset,
134 SimpleCSRInternal::DistStructInfo
const& matrix_dist_info,
137 SYCLBEllPackMatrix* cloneTo(
const MultiMatrixImpl* multi)
const;
139 bool isParallel()
const {
return m_is_parallel; }
141 Integer getLocalSize()
const {
return m_local_size; }
143 Integer getLocalOffset()
const {
return m_local_offset; }
145 Integer getGlobalSize()
const {
return m_global_size; }
147 Integer getGhostSize()
const {
return m_ghost_size; }
149 Integer getAllocSize()
const {
return m_local_size + m_ghost_size; }
151 Integer blockSize()
const
155 return block()->size();
161 return m_own_block_size ;
165 void setBlockSize(Integer block_size)
167 if(this->m_multi_impl)
168 const_cast<MultiMatrixImpl*
>(this->m_multi_impl)->setBlockInfos(block_size) ;
170 m_own_block_size = block_size;
173 bool setMatrixValues(Arccore::Real
const* values,
bool only_host);
175 void copy(SYCLBEllPackMatrix
const& matrix) ;
177 void notifyChanges();
180 void mult(SYCLVector<ValueType>
const& x, SYCLVector<ValueType>& y)
const;
181 void endDistMult(SYCLVector<ValueType>
const& x, SYCLVector<ValueType>& y)
const;
183 void addLMult(ValueType alpha, SYCLVector<ValueType>
const& x, SYCLVector<ValueType>& y)
const;
184 void addUMult(ValueType alpha, SYCLVector<ValueType>
const& x, SYCLVector<ValueType>& y)
const;
186 void multDiag(SYCLVector<ValueType>
const& x, SYCLVector<ValueType>& y)
const;
188 void multDiag(SYCLVector<ValueType>& y)
const ;
189 void computeDiag(SYCLVector<ValueType>& y)
const;
191 void multInvDiag(SYCLVector<ValueType>& y)
const;
192 void computeInvDiag(SYCLVector<ValueType>& y)
const;
194 void scal(SYCLVector<ValueType>
const& diag) ;
196 const DistStructInfo& getDistStructInfo()
const {
return m_matrix_dist_info; }
198 Alien::SimpleCSRInternal::CommProperty::ePolicyType getSendPolicy()
const
200 return m_send_policy;
203 Alien::SimpleCSRInternal::CommProperty::ePolicyType getRecvPolicy()
const
205 return m_recv_policy;
208 MatrixInternalType* internal() {
return m_matrixPKSIZE.get(); }
210 MatrixInternalType
const* internal()
const {
return m_matrixPKSIZE.get(); }
212 void allocateDevicePointers(std::size_t nrows,
217 ValueType** values)
const ;
219 void freeDevicePointers(IndexType* rows,
222 ValueType* values)
const ;
224 void copyDevicePointers(std::size_t nrows,
229 ValueType* values)
const ;
236 IsLocal(
const ConstArrayView<Integer> offset,
const Integer myrank)
240 bool operator()(Arccore::Integer col)
const
242 return (col >= m_offset[m_myrank]) && (col < m_offset[m_myrank + 1]);
246 const ConstArrayView<Integer> m_offset;
247 const Integer m_myrank;
251 std::unique_ptr<ProfileInternalType> m_profilePKSIZE;
252 std::unique_ptr<MatrixInternalType> m_matrixPKSIZE;
254 std::unique_ptr<ProfileInternalType> m_ext_profilePKSIZE;
256 int m_ellpack_size = PKSIZE ;
257 std::vector<int> m_block_row_offset ;
258 std::vector<int> m_ext_block_row_offset ;
260 Integer m_own_block_size = 1 ;
262 bool m_is_parallel =
false;
263 IMessagePassingMng* m_parallel_mng =
nullptr;
265 Integer m_myrank = 0;
267 Integer m_local_size = 0;
268 Integer m_local_offset = 0;
269 Integer m_global_size = 0;
270 Integer m_ghost_size = 0;
274 DistStructInfo m_matrix_dist_info;
275 SimpleCSRInternal::CommProperty::ePolicyType m_send_policy;
276 SimpleCSRInternal::CommProperty::ePolicyType m_recv_policy;
277 ITraceMng* m_trace =
nullptr;
281 friend class SYCLInternal::SYCLBEllPackMatrixMultT<ValueType>;
283#ifdef ALIEN_USE_PERF_TIMER
285 mutable TimerType m_timer;
288 TimerType& timer()
const