Skip to content

Commit

Permalink
Add compile guards in EigenDecomposition for non-SIMD architectures
Browse files Browse the repository at this point in the history
On non-SIMD architectures, stk::simd::DoubleType is the same as double.
This causes compilation errors because of redefinition of functions.
  • Loading branch information
sayerhs committed Jul 3, 2018
1 parent ed488b8 commit 258a1ef
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 2 additions & 0 deletions include/EigenDecomposition.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,15 @@ namespace EigenDecomposition
void matrix_matrix_multiply(const double (&D)[2][2], const double (&Q)[2][2], double (&A)[2][2]);
void matrix_matrix_multiply(const double (&D)[3][3], const double (&Q)[3][3], double (&A)[3][3]);

#ifndef STK_HAVE_NO_SIMD
// Simd solvers
void sym_diagonalize(const DoubleType (&A)[2][2], DoubleType (&Q)[2][2], DoubleType (&D)[2][2]);
void sym_diagonalize(const DoubleType (&A)[3][3], DoubleType (&Q)[3][3], DoubleType (&D)[3][3]);
void reconstruct_matrix_from_decomposition(const DoubleType (&D)[2][2], const DoubleType (&Q)[2][2], DoubleType (&A)[2][2]);
void reconstruct_matrix_from_decomposition(const DoubleType (&D)[3][3], const DoubleType (&Q)[3][3], DoubleType (&A)[3][3]);
void matrix_matrix_multiply(const DoubleType (&D)[2][2], const DoubleType (&Q)[2][2], DoubleType (&A)[2][2]);
void matrix_matrix_multiply(const DoubleType (&D)[3][3], const DoubleType (&Q)[3][3], DoubleType (&A)[3][3]);
#endif

}

Expand Down
3 changes: 2 additions & 1 deletion src/EigenDecomposition.C
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,7 @@ EigenDecomposition::matrix_matrix_multiply(
}
}

#ifndef STK_HAVE_NO_SIMD
//--------------------------------------------------------------------------
//------------- SIMD solvers -----------------------------------------------
//--------------------------------------------------------------------------
Expand Down Expand Up @@ -510,7 +511,7 @@ EigenDecomposition::matrix_matrix_multiply(
}
}
}

#endif // STK_HAVE_NO_SIMD

} // namespace nalu
} // namespace Sierra

0 comments on commit 258a1ef

Please sign in to comment.