summaryrefslogtreecommitdiffstats
path: root/staging_vespalib
diff options
context:
space:
mode:
authorHenning Baldersheim <balder@yahoo-inc.com>2016-10-12 21:27:54 +0000
committerHenning Baldersheim <balder@yahoo-inc.com>2016-10-12 21:27:54 +0000
commitc2a2c5c703ad1fb5a853bc9483ce111d36eea964 (patch)
treea9054c55e96aee22a4f3ba6224db5f72b83f3af0 /staging_vespalib
parent304520ae21fbc0aee67bc1297233b473a3db59ec (diff)
Move the VectorsPerChunk to outer template.
Diffstat (limited to 'staging_vespalib')
-rw-r--r--staging_vespalib/src/vespa/vespalib/hwaccelrated/avxprivate.hpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/staging_vespalib/src/vespa/vespalib/hwaccelrated/avxprivate.hpp b/staging_vespalib/src/vespa/vespalib/hwaccelrated/avxprivate.hpp
index 3bf3083f009..5863f77b1f6 100644
--- a/staging_vespalib/src/vespa/vespalib/hwaccelrated/avxprivate.hpp
+++ b/staging_vespalib/src/vespa/vespalib/hwaccelrated/avxprivate.hpp
@@ -56,7 +56,7 @@ struct TypeSpecifics<double, 64u> {
static double sum(const V & v) { return sumT<double, V>(v); }
};
-template <typename T, size_t VLEN, unsigned AlignA, unsigned AlignB, size_t VectorsPerChunk=4>
+template <typename T, size_t VLEN, unsigned AlignA, unsigned AlignB, size_t VectorsPerChunk>
static T computeDotProduct(const T * af, const T * bf, size_t sz) __attribute__((noinline));
template <typename T, size_t VLEN, unsigned AlignA, unsigned AlignB, size_t VectorsPerChunk>
@@ -89,23 +89,23 @@ T computeDotProduct(const T * af, const T * bf, size_t sz)
}
-template <typename T, size_t VLEN>
+template <typename T, size_t VLEN, size_t VectorsPerChunk=4>
VESPA_DLL_LOCAL static T dotProductSelectAlignment(const T * af, const T * bf, size_t sz);
-template <typename T, size_t VLEN>
+template <typename T, size_t VLEN, size_t VectorsPerChunk>
T dotProductSelectAlignment(const T * af, const T * bf, size_t sz)
{
if (validAlignment(af, VLEN)) {
if (validAlignment(bf, VLEN)) {
- return computeDotProduct<T, VLEN, VLEN, VLEN>(af, bf, sz);
+ return computeDotProduct<T, VLEN, VLEN, VLEN, VectorsPerChunk>(af, bf, sz);
} else {
- return computeDotProduct<T, VLEN, VLEN, 1>(af, bf, sz);
+ return computeDotProduct<T, VLEN, VLEN, 1, VectorsPerChunk>(af, bf, sz);
}
} else {
if (validAlignment(bf, VLEN)) {
- return computeDotProduct<T, VLEN, 1, VLEN>(af, bf, sz);
+ return computeDotProduct<T, VLEN, 1, VLEN, VectorsPerChunk>(af, bf, sz);
} else {
- return computeDotProduct<T, VLEN, 1, 1>(af, bf, sz);
+ return computeDotProduct<T, VLEN, 1, 1, VectorsPerChunk>(af, bf, sz);
}
}
}