1 | #include <Functions/FunctionMathUnary.h> |
---|---|
2 | #include <Functions/FunctionFactory.h> |
3 | |
4 | namespace DB |
5 | { |
6 | |
7 | struct ExpName { static constexpr auto name = "exp"; }; |
8 | |
9 | #if USE_FASTOPS |
10 | |
11 | namespace |
12 | { |
13 | struct Impl |
14 | { |
15 | static constexpr auto name = ExpName::name; |
16 | static constexpr auto rows_per_iteration = 0; |
17 | static constexpr bool always_returns_float64 = false; |
18 | |
19 | template <typename T> |
20 | static void execute(const T * src, size_t size, T * dst) |
21 | { |
22 | NFastOps::Exp<true>(src, size, dst); |
23 | } |
24 | }; |
25 | } |
26 | |
27 | using FunctionExp = FunctionMathUnary<Impl>; |
28 | |
29 | #else |
30 | using FunctionExp = FunctionMathUnary<UnaryFunctionVectorized<ExpName, exp>>; |
31 | #endif |
32 | |
33 | void registerFunctionExp(FunctionFactory & factory) |
34 | { |
35 | factory.registerFunction<FunctionExp>(FunctionFactory::CaseInsensitive); |
36 | } |
37 | |
38 | } |
39 |