|
29 | 29 | #pragma once |
30 | 30 |
|
31 | 31 | #include "../../include/mpi_structure.hpp" |
| 32 | +#include "../../include/omp_structure.hpp" |
32 | 33 | #include "CSysVector.hpp" |
33 | 34 | #include "CPastixWrapper.hpp" |
34 | 35 |
|
@@ -169,58 +170,60 @@ class CSysMatrix { |
169 | 170 | * \param[in] vector |
170 | 171 | * \param[out] product |
171 | 172 | */ |
172 | | - inline void MatrixVectorProduct(const ScalarType *matrix, const ScalarType *vector, ScalarType *product) const; |
| 173 | + void MatrixVectorProduct(const ScalarType *matrix, const ScalarType *vector, ScalarType *product) const; |
173 | 174 |
|
174 | 175 | /*! |
175 | 176 | * \brief Calculates the matrix-vector product: product += matrix*vector |
176 | 177 | * \param[in] matrix |
177 | 178 | * \param[in] vector |
178 | 179 | * \param[in,out] product |
179 | 180 | */ |
180 | | - inline void MatrixVectorProductAdd(const ScalarType *matrix, const ScalarType *vector, ScalarType *product) const; |
| 181 | + void MatrixVectorProductAdd(const ScalarType *matrix, const ScalarType *vector, ScalarType *product) const; |
181 | 182 |
|
182 | 183 | /*! |
183 | 184 | * \brief Calculates the matrix-vector product: product -= matrix*vector |
184 | 185 | * \param[in] matrix |
185 | 186 | * \param[in] vector |
186 | 187 | * \param[in,out] product |
187 | 188 | */ |
188 | | - inline void MatrixVectorProductSub(const ScalarType *matrix, const ScalarType *vector, ScalarType *product) const; |
| 189 | + void MatrixVectorProductSub(const ScalarType *matrix, const ScalarType *vector, ScalarType *product) const; |
189 | 190 |
|
190 | 191 | /*! |
191 | 192 | * \brief Calculates the matrix-vector product: product += matrix^T * vector |
192 | 193 | * \param[in] matrix |
193 | 194 | * \param[in] vector |
194 | 195 | * \param[in,out] product |
195 | 196 | */ |
196 | | - inline void MatrixVectorProductTransp(const ScalarType *matrix, const ScalarType *vector, ScalarType *product) const; |
| 197 | + void MatrixVectorProductTransp(const ScalarType *matrix, const ScalarType *vector, ScalarType *product) const; |
197 | 198 |
|
198 | 199 | /*! |
199 | 200 | * \brief Calculates the matrix-matrix product |
200 | 201 | */ |
201 | | - inline void MatrixMatrixProduct(const ScalarType *matrix_a, const ScalarType *matrix_b, ScalarType *product) const; |
| 202 | + void MatrixMatrixProduct(const ScalarType *matrix_a, const ScalarType *matrix_b, ScalarType *product) const; |
202 | 203 |
|
203 | 204 | /*! |
204 | 205 | * \brief Subtract b from a and store the result in c. |
205 | 206 | */ |
206 | | - inline void VectorSubtraction(const ScalarType *a, const ScalarType *b, ScalarType *c) const { |
| 207 | + FORCEINLINE void VectorSubtraction(const ScalarType *a, const ScalarType *b, ScalarType *c) const { |
207 | 208 | for(unsigned long iVar = 0; iVar < nVar; iVar++) |
208 | 209 | c[iVar] = a[iVar] - b[iVar]; |
209 | 210 | } |
210 | 211 |
|
211 | 212 | /*! |
212 | 213 | * \brief Subtract b from a and store the result in c. |
213 | 214 | */ |
214 | | - inline void MatrixSubtraction(const ScalarType *a, const ScalarType *b, ScalarType *c) const { |
| 215 | + FORCEINLINE void MatrixSubtraction(const ScalarType *a, const ScalarType *b, ScalarType *c) const { |
| 216 | + SU2_OMP_SIMD |
215 | 217 | for(unsigned long iVar = 0; iVar < nVar*nEqn; iVar++) |
216 | 218 | c[iVar] = a[iVar] - b[iVar]; |
217 | 219 | } |
218 | 220 |
|
219 | 221 | /*! |
220 | 222 | * \brief Copy matrix src into dst, transpose if required. |
221 | 223 | */ |
222 | | - inline void MatrixCopy(const ScalarType *src, ScalarType *dst, bool transposed = false) const { |
| 224 | + FORCEINLINE void MatrixCopy(const ScalarType *src, ScalarType *dst, bool transposed = false) const { |
223 | 225 | if (!transposed) { |
| 226 | + SU2_OMP_SIMD |
224 | 227 | for(auto iVar = 0ul; iVar < nVar*nEqn; ++iVar) |
225 | 228 | dst[iVar] = src[iVar]; |
226 | 229 | } |
@@ -446,6 +449,7 @@ class CSysMatrix { |
446 | 449 |
|
447 | 450 | auto mat_ij = GetBlock(block_i, block_j); |
448 | 451 | if (!mat_ij) return; |
| 452 | + SU2_OMP_SIMD |
449 | 453 | for (auto iVar = 0ul; iVar < nVar*nEqn; ++iVar) { |
450 | 454 | mat_ij[iVar] = (Overwrite? ScalarType(0) : mat_ij[iVar]) + PassiveAssign(alpha * val_block[iVar]); |
451 | 455 | } |
@@ -657,6 +661,7 @@ class CSysMatrix { |
657 | 661 | unsigned long iVar, index = dia_ptr[block_i]*nVar*nVar; |
658 | 662 |
|
659 | 663 | /*--- Clear entire block before setting its diagonal. ---*/ |
| 664 | + SU2_OMP_SIMD |
660 | 665 | for (iVar = 0; iVar < nVar*nVar; iVar++) |
661 | 666 | matrix[index+iVar] = 0.0; |
662 | 667 |
|
|
0 commit comments