diff --git a/src/OpenFOAM/primitives/Tensor/TensorI.H b/src/OpenFOAM/primitives/Tensor/TensorI.H index a2b47628e6c879e829a7aaa13834db12e17e66d2..89352d73b25a938f0f0bd58ecd328dc1a313e94e 100644 --- a/src/OpenFOAM/primitives/Tensor/TensorI.H +++ b/src/OpenFOAM/primitives/Tensor/TensorI.H @@ -538,6 +538,10 @@ inline Foam::Tensor<Cmpt> Foam::Tensor<Cmpt>::inv2D template<class Cmpt> +#if defined(__GNUC__) && !defined(__clang__) +// Workaround for gcc (11+) that fails to handle tensor dot vector +__attribute__((optimize("no-tree-vectorize"))) +#endif inline Foam::Tensor<Cmpt> Foam::Tensor<Cmpt>::inner(const Tensor<Cmpt>& t2) const { @@ -561,6 +565,10 @@ Foam::Tensor<Cmpt>::inner(const Tensor<Cmpt>& t2) const template<class Cmpt> +#if defined(__GNUC__) && !defined(__clang__) +// Workaround for gcc (11+) that fails to handle tensor dot vector +__attribute__((optimize("no-tree-vectorize"))) +#endif inline Foam::Tensor<Cmpt> Foam::Tensor<Cmpt>::schur(const Tensor<Cmpt>& t2) const { @@ -1103,6 +1111,10 @@ operator&(const Tensor<Cmpt>& t1, const Tensor<Cmpt>& t2) //- Inner-product of a SphericalTensor and a Tensor template<class Cmpt> +#if defined(__GNUC__) && !defined(__clang__) +// Workaround for gcc (11+) that fails to handle tensor dot vector +__attribute__((optimize("no-tree-vectorize"))) +#endif inline Tensor<Cmpt> operator&(const SphericalTensor<Cmpt>& st1, const Tensor<Cmpt>& t2) { @@ -1117,6 +1129,10 @@ operator&(const SphericalTensor<Cmpt>& st1, const Tensor<Cmpt>& t2) //- Inner-product of a Tensor and a SphericalTensor template<class Cmpt> +#if defined(__GNUC__) && !defined(__clang__) +// Workaround for gcc (11+) that fails to handle tensor dot vector +__attribute__((optimize("no-tree-vectorize"))) +#endif inline Tensor<Cmpt> operator&(const Tensor<Cmpt>& t1, const SphericalTensor<Cmpt>& st2) { @@ -1131,6 +1147,10 @@ operator&(const Tensor<Cmpt>& t1, const SphericalTensor<Cmpt>& st2) //- Inner-product of a SymmTensor and a Tensor template<class Cmpt> +#if defined(__GNUC__) && !defined(__clang__) +// Workaround for gcc (11+) that fails to handle tensor dot vector +__attribute__((optimize("no-tree-vectorize"))) +#endif inline Tensor<Cmpt> operator&(const SymmTensor<Cmpt>& st1, const Tensor<Cmpt>& t2) { @@ -1153,6 +1173,10 @@ operator&(const SymmTensor<Cmpt>& st1, const Tensor<Cmpt>& t2) //- Inner-product of a Tensor and a SymmTensor template<class Cmpt> +#if defined(__GNUC__) && !defined(__clang__) +// Workaround for gcc (11+) that fails to handle tensor dot vector +__attribute__((optimize("no-tree-vectorize"))) +#endif inline Tensor<Cmpt> operator&(const Tensor<Cmpt>& t1, const SymmTensor<Cmpt>& st2) { @@ -1193,6 +1217,10 @@ operator&(const Tensor<Cmpt>& t, const Vector<Cmpt>& v) //- Inner-product of a Vector and a Tensor template<class Cmpt> +#if defined(__GNUC__) && !defined(__clang__) +// Workaround for gcc (11+) that fails to handle tensor dot vector +__attribute__((optimize("no-tree-vectorize"))) +#endif inline Vector<Cmpt> operator&(const Vector<Cmpt>& v, const Tensor<Cmpt>& t) {