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 endDistLMult(ValueType alpha, SYCLVector<ValueType>
const& x, SYCLVector<ValueType>& y)
const;
186 void addUMult(ValueType alpha, SYCLVector<ValueType>
const& x, SYCLVector<ValueType>& y)
const;
187 void endDistUMult(ValueType alpha, SYCLVector<ValueType>
const& x, SYCLVector<ValueType>& y)
const;
189 void multDiag(SYCLVector<ValueType>
const& x, SYCLVector<ValueType>& y)
const;
191 void multDiag(SYCLVector<ValueType>& y)
const ;
192 void computeDiag(SYCLVector<ValueType>& y)
const;
194 void multInvDiag(SYCLVector<ValueType>& y)
const;
195 void computeInvDiag(SYCLVector<ValueType>& y)
const;
197 void scal(SYCLVector<ValueType>
const& diag) ;
199 const DistStructInfo& getDistStructInfo()
const {
return m_matrix_dist_info; }
201 Alien::SimpleCSRInternal::CommProperty::ePolicyType getSendPolicy()
const
203 return m_send_policy;
206 Alien::SimpleCSRInternal::CommProperty::ePolicyType getRecvPolicy()
const
208 return m_recv_policy;
211 MatrixInternalType* internal() {
return m_matrixPKSIZE.get(); }
213 MatrixInternalType
const* internal()
const {
return m_matrixPKSIZE.get(); }
215 void allocateDevicePointers(std::size_t nrows,
220 ValueType** values)
const ;
222 void freeDevicePointers(IndexType* rows,
225 ValueType* values)
const ;
227 void copyDevicePointers(std::size_t nrows,
232 ValueType* values)
const ;
239 IsLocal(
const ConstArrayView<Integer> offset,
const Integer myrank)
243 bool operator()(Arccore::Integer col)
const
245 return (col >= m_offset[m_myrank]) && (col < m_offset[m_myrank + 1]);
249 const ConstArrayView<Integer> m_offset;
250 const Integer m_myrank;
254 std::unique_ptr<ProfileInternalType> m_profilePKSIZE;
255 std::unique_ptr<MatrixInternalType> m_matrixPKSIZE;
257 std::unique_ptr<ProfileInternalType> m_ext_profilePKSIZE;
259 int m_ellpack_size = PKSIZE ;
260 std::vector<int> m_block_row_offset ;
261 std::vector<int> m_ext_block_row_offset ;
263 Integer m_own_block_size = 1 ;
265 bool m_is_parallel =
false;
266 IMessagePassingMng* m_parallel_mng =
nullptr;
268 Integer m_myrank = 0;
270 Integer m_local_size = 0;
271 Integer m_local_offset = 0;
272 Integer m_global_size = 0;
273 Integer m_ghost_size = 0;
277 DistStructInfo m_matrix_dist_info;
278 SimpleCSRInternal::CommProperty::ePolicyType m_send_policy;
279 SimpleCSRInternal::CommProperty::ePolicyType m_recv_policy;
280 ITraceMng* m_trace =
nullptr;
286#ifdef ALIEN_USE_PERF_TIMER
288 mutable TimerType m_timer;
291 TimerType& timer()
const