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;
174 const VectorDistribution& rowDistribution()
const
176 if(m_own_row_distribution.get())
177 return *m_own_row_distribution ;
179 return this->distribution().rowDistribution();
182 bool setMatrixValues(Arccore::Real
const* values,
bool only_host);
184 void copy(SYCLBEllPackMatrix
const& matrix) ;
185 void copy(SYCLBEllPackMatrix
const& matrix,
186 ConstArrayView<Integer> filter,
187 UniqueArray<Integer>& parent_lids) ;
189 void notifyChanges();
192 void mult(SYCLVector<ValueType>
const& x, SYCLVector<ValueType>& y)
const;
193 void endDistMult(SYCLVector<ValueType>
const& x, SYCLVector<ValueType>& y)
const;
195 void addLMult(ValueType alpha, SYCLVector<ValueType>
const& x, SYCLVector<ValueType>& y)
const;
196 void endDistLMult(ValueType alpha, SYCLVector<ValueType>
const& x, SYCLVector<ValueType>& y)
const;
198 void addUMult(ValueType alpha, SYCLVector<ValueType>
const& x, SYCLVector<ValueType>& y)
const;
199 void endDistUMult(ValueType alpha, SYCLVector<ValueType>
const& x, SYCLVector<ValueType>& y)
const;
201 void multDiag(SYCLVector<ValueType>
const& x, SYCLVector<ValueType>& y)
const;
203 void multDiag(SYCLVector<ValueType>& y)
const ;
204 void computeDiag(SYCLVector<ValueType>& y)
const;
206 void multInvDiag(SYCLVector<ValueType>& y)
const;
207 void computeInvDiag(SYCLVector<ValueType>& y)
const;
209 void scal(SYCLVector<ValueType>
const& diag) ;
211 const DistStructInfo& getDistStructInfo()
const {
return m_matrix_dist_info; }
213 Alien::SimpleCSRInternal::CommProperty::ePolicyType getSendPolicy()
const
215 return m_send_policy;
218 Alien::SimpleCSRInternal::CommProperty::ePolicyType getRecvPolicy()
const
220 return m_recv_policy;
223 MatrixInternalType* internal() {
return m_matrixPKSIZE.get(); }
225 MatrixInternalType
const* internal()
const {
return m_matrixPKSIZE.get(); }
227 void allocateDevicePointers(std::size_t nrows,
232 ValueType** values)
const ;
234 void freeDevicePointers(IndexType* rows,
237 ValueType* values)
const ;
239 void copyDevicePointers(std::size_t nrows,
244 ValueType* values)
const ;
251 IsLocal(
const ConstArrayView<Integer> offset,
const Integer myrank)
255 bool operator()(Arccore::Integer col)
const
257 return (col >= m_offset[m_myrank]) && (col < m_offset[m_myrank + 1]);
261 const ConstArrayView<Integer> m_offset;
262 const Integer m_myrank;
266 std::unique_ptr<ProfileInternalType> m_profilePKSIZE;
267 std::unique_ptr<MatrixInternalType> m_matrixPKSIZE;
269 std::unique_ptr<ProfileInternalType> m_ext_profilePKSIZE;
271 int m_ellpack_size = PKSIZE ;
272 std::vector<int> m_block_row_offset ;
273 std::vector<int> m_ext_block_row_offset ;
275 Integer m_own_block_size = 1 ;
276 std::unique_ptr<VectorDistribution> m_own_row_distribution;
278 bool m_is_parallel =
false;
279 IMessagePassingMng* m_parallel_mng =
nullptr;
281 Integer m_myrank = 0;
283 Integer m_local_size = 0;
284 Integer m_local_offset = 0;
285 Integer m_global_size = 0;
286 Integer m_ghost_size = 0;
290 DistStructInfo m_matrix_dist_info;
291 SimpleCSRInternal::CommProperty::ePolicyType m_send_policy;
292 SimpleCSRInternal::CommProperty::ePolicyType m_recv_policy;
293 ITraceMng* m_trace =
nullptr;
297 friend class SYCLInternal::SYCLBEllPackMatrixMultT<ValueType>;
299#ifdef ALIEN_USE_PERF_TIMER
301 mutable TimerType m_timer;
304 TimerType& timer()
const