268 {
269
270
271 const char *dotproduct_method = "generic";
272 if (dotproduct == "auto") {
273
274 } else if (dotproduct == "generic") {
275
276 SetDotProduct(DotProductGeneric);
277 dotproduct_method = "generic";
278 } else if (dotproduct == "native") {
279
281 dotproduct_method = "native";
282#if defined(HAVE_AVX2)
283 } else if (dotproduct == "avx2") {
284
286 dotproduct_method = "avx2";
287#endif
288#if defined(HAVE_AVX)
289 } else if (dotproduct == "avx") {
290
292 dotproduct_method = "avx";
293#endif
294#if defined(HAVE_FMA)
295 } else if (dotproduct == "fma") {
296
298 dotproduct_method = "fma";
299#endif
300#if defined(HAVE_SSE4_1)
301 } else if (dotproduct == "sse") {
302
304 dotproduct_method = "sse";
305#endif
306#if defined(HAVE_FRAMEWORK_ACCELERATE)
307 } else if (dotproduct == "accelerate") {
309#endif
310#if defined(HAVE_NEON) || defined(__aarch64__)
311 } else if (dotproduct == "neon" && neon_available_) {
312
314 dotproduct_method = "neon";
315#endif
316 } else if (dotproduct == "std::inner_product") {
317
319 dotproduct_method = "std::inner_product";
320 } else {
321
322 tprintf(
"Warning, ignoring unsupported config variable value: dotproduct=%s\n",
323 dotproduct.c_str());
325 "Supported values for dotproduct: auto generic native"
327 " avx2"
328#endif
330 " avx"
331#endif
333 " fma"
334#endif
336 " sse"
337#endif
338#if defined(HAVE_FRAMEWORK_ACCELERATE)
339 " accelerate"
340#endif
341 " std::inner_product.\n");
342 }
343
344 dotproduct.set_value(dotproduct_method);
345}
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