mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-21 23:21:59 +00:00
Simpler vercorclass
This commit is contained in:
parent
930ac5b2ce
commit
a08714105b
@ -1,4 +1,4 @@
|
||||
option (USE_VECTORIZED_MATH_FUNCTIONS "Faster math functions" OFF)
|
||||
include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/find_vectorclass.cmake)
|
||||
|
||||
set (CONFIG_VERSION ${CMAKE_CURRENT_BINARY_DIR}/include/DB/Common/config_version.h)
|
||||
set (CONFIG_COMMON ${CMAKE_CURRENT_BINARY_DIR}/include/DB/Common/config.h)
|
||||
|
@ -3,4 +3,4 @@
|
||||
// .h autogenerated by cmake !
|
||||
|
||||
#cmakedefine01 USE_RE2_ST
|
||||
#cmakedefine01 USE_VECTORIZED_MATH_FUNCTIONS
|
||||
#cmakedefine01 USE_VECTORCLASS
|
||||
|
@ -9,9 +9,25 @@
|
||||
|
||||
/** More effective implementations of mathematical functions are possible when connecting a separate library
|
||||
* Disabled due licence compatibility limitations
|
||||
* To enable: rebuild with -DUSE_VECTORIZED_MATH_FUNCTIONS=1
|
||||
* To enable: download http://www.agner.org/optimize/vectorclass.zip and unpack to contrib/vectorclass
|
||||
* Then rebuild with -DENABLE_VECTORCLASS=1
|
||||
*/
|
||||
|
||||
#if USE_VECTORCLASS
|
||||
#if __clang__
|
||||
#pragma clang diagnostic push
|
||||
#pragma clang diagnostic ignored "-Wshift-negative-value"
|
||||
#endif
|
||||
|
||||
#include <vectorf128.h>
|
||||
#include <vectormath_exp.h>
|
||||
#include <vectormath_trig.h>
|
||||
|
||||
#if __clang__
|
||||
#pragma clang diagnostic pop
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
namespace DB
|
||||
{
|
||||
@ -166,7 +182,7 @@ struct UnaryFunctionPlain
|
||||
}
|
||||
};
|
||||
|
||||
#if USE_VECTORIZED_MATH_FUNCTIONS
|
||||
#if USE_VECTORCLASS
|
||||
|
||||
template <typename Name, Vec2d(&Function)(const Vec2d &)>
|
||||
struct UnaryFunctionVectorized
|
||||
@ -436,7 +452,7 @@ struct BinaryFunctionPlain
|
||||
}
|
||||
};
|
||||
|
||||
#if USE_VECTORIZED_MATH_FUNCTIONS
|
||||
#if USE_VECTORCLASS
|
||||
|
||||
template <typename Name, Vec2d(&Function)(const Vec2d &, const Vec2d &)>
|
||||
struct BinaryFunctionVectorized
|
||||
@ -502,7 +518,7 @@ using FunctionLog10 = FunctionMathUnaryFloat64<UnaryFunctionVectorized<Log10Name
|
||||
using FunctionSqrt = FunctionMathUnaryFloat64<UnaryFunctionVectorized<SqrtName, sqrt>>;
|
||||
|
||||
using FunctionCbrt = FunctionMathUnaryFloat64<UnaryFunctionVectorized<CbrtName,
|
||||
#if USE_VECTORIZED_MATH_FUNCTIONS
|
||||
#if USE_VECTORCLASS
|
||||
Power_rational<1, 3>::pow
|
||||
#else
|
||||
cbrt
|
||||
|
Loading…
Reference in New Issue
Block a user