We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent f89bcfd commit db77809Copy full SHA for db77809
1 file changed
Common/include/parallelization/vectorization.hpp
@@ -56,8 +56,18 @@ constexpr size_t PREFERRED_SIZE = 8;
56
*/
57
template<class T>
58
constexpr size_t preferredLen() { return PREFERRED_SIZE / sizeof(T); }
59
+
60
+#if !defined(CODI_REVERSE_TYPE) && !defined(CODI_FORWARD_TYPE)
61
template<>
62
constexpr size_t preferredLen<su2double>() { return PREFERRED_SIZE / sizeof(passivedouble); }
63
+#else
64
+/* enforce one element per SIMD array since (1) arrays of AD types cannot be auto vectorized and (2) they might violate
65
+ * exclusive read declarations if masking is not applied throughout */
66
+template<>
67
+constexpr size_t preferredLen<su2double>() { return 1; }
68
+#endif
69
70
71
72
/*!
73
* \class Array
0 commit comments