272 {
273
274
275 const char *dotproduct_method = "generic";
276 if (dotproduct == "auto") {
277
278 } else if (dotproduct == "generic") {
279
280 SetDotProduct(DotProductGeneric);
281 dotproduct_method = "generic";
282 } else if (dotproduct == "native") {
283
285 dotproduct_method = "native";
286#if defined(HAVE_AVX2)
287 } else if (dotproduct == "avx2") {
288
290 dotproduct_method = "avx2";
291#endif
292#if defined(HAVE_AVX)
293 } else if (dotproduct == "avx") {
294
296 dotproduct_method = "avx";
297#endif
298#if defined(HAVE_FMA)
299 } else if (dotproduct == "fma") {
300
302 dotproduct_method = "fma";
303#endif
304#if defined(HAVE_SSE4_1)
305 } else if (dotproduct == "sse") {
306
308 dotproduct_method = "sse";
309#endif
310#if defined(HAVE_FRAMEWORK_ACCELERATE)
311 } else if (dotproduct == "accelerate") {
313#endif
314#if defined(HAVE_NEON) || defined(__aarch64__)
315 } else if (dotproduct == "neon" && neon_available_) {
316
318 dotproduct_method = "neon";
319#endif
320 } else if (dotproduct == "std::inner_product") {
321
323 dotproduct_method = "std::inner_product";
324 } else {
325
326 tprintf(
"Warning, ignoring unsupported config variable value: dotproduct=%s\n",
327 dotproduct.c_str());
329 "Supported values for dotproduct: auto generic native"
330#if defined(HAVE_AVX2)
331 " avx2"
332#endif
333#if defined(HAVE_AVX)
334 " avx"
335#endif
336#if defined(HAVE_FMA)
337 " fma"
338#endif
339#if defined(HAVE_SSE4_1)
340 " sse"
341#endif
342#if defined(HAVE_FRAMEWORK_ACCELERATE)
343 " accelerate"
344#endif
345 " std::inner_product.\n");
346 }
347
348 dotproduct.set_value(dotproduct_method);
349}
void tprintf(const char *format,...)
TFloat DotProductNEON(const TFloat *u, const TFloat *v, int n)
TFloat DotProductFMA(const TFloat *u, const TFloat *v, int n)
TFloat DotProductNative(const TFloat *u, const TFloat *v, int n)
TFloat DotProductAVX(const TFloat *u, const TFloat *v, int n)
TFloat DotProductSSE(const TFloat *u, const TFloat *v, int n)
static const IntSimdMatrix intSimdMatrixAVX2
static const IntSimdMatrix * intSimdMatrix
static const IntSimdMatrix intSimdMatrixSSE
static const IntSimdMatrix intSimdMatrixNEON