mirror of
https://gitlab.com/libeigen/eigen.git
synced 2026-04-10 11:34:33 +08:00
Add workaround for using std::fma for scalar multiply-add.
This commit is contained in:
committed by
Rasmus Munk Larsen
parent
5996176b88
commit
ef3c5c1d1d
@@ -52,6 +52,26 @@
|
||||
#define EIGEN_STACK_ALLOCATION_LIMIT 131072
|
||||
#endif
|
||||
|
||||
/* Specify whether to use std::fma for scalar multiply-add instructions.
|
||||
*
|
||||
* On machines that have FMA as a single instruction, this will generally
|
||||
* improve precision without significant performance implications.
|
||||
*
|
||||
* Without a single instruction, performance has been found to be reduced 2-3x
|
||||
* on Intel CPUs, and up to 30x for WASM.
|
||||
*
|
||||
* If unspecified, defaults to using FMA if hardware support is available.
|
||||
* The default should be used in most cases to ensure consistency between
|
||||
* vectorized and non-vectorized paths.
|
||||
*/
|
||||
#ifndef EIGEN_SCALAR_MADD_USE_FMA
|
||||
#ifdef EIGEN_VECTORIZE_FMA
|
||||
#define EIGEN_SCALAR_MADD_USE_FMA 1
|
||||
#else
|
||||
#define EIGEN_SCALAR_MADD_USE_FMA 0
|
||||
#endif
|
||||
#endif
|
||||
|
||||
//------------------------------------------------------------------------------------------
|
||||
// Compiler identification, EIGEN_COMP_*
|
||||
//------------------------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user