mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-10 01:25:21 +00:00
remove vectorization from binary arithmetic
This commit is contained in:
parent
71fabcedc4
commit
cdb353856d
@ -54,8 +54,11 @@ namespace ErrorCodes
|
||||
extern const int CANNOT_ADD_DIFFERENT_AGGREGATE_STATES;
|
||||
}
|
||||
|
||||
DECLARE_MULTITARGET_CODE(
|
||||
|
||||
/** Arithmetic operations: +, -, *, /, %,
|
||||
* intDiv (integer division)
|
||||
* Bitwise operations: |, &, ^, ~.
|
||||
* Etc.
|
||||
*/
|
||||
template <typename A, typename B, typename Op, typename ResultType_ = typename Op::ResultType>
|
||||
struct BinaryOperationImplBase
|
||||
{
|
||||
@ -86,79 +89,6 @@ struct BinaryOperationImplBase
|
||||
}
|
||||
};
|
||||
|
||||
) // DECLARE_MULTITARGET_CODE
|
||||
|
||||
|
||||
/** Arithmetic operations: +, -, *, /, %,
|
||||
* intDiv (integer division)
|
||||
* Bitwise operations: |, &, ^, ~.
|
||||
* Etc.
|
||||
*/
|
||||
template <typename A, typename B, typename Op, typename ResultType_ = typename Op::ResultType>
|
||||
struct BinaryOperationImplBase
|
||||
{
|
||||
using ResultType = ResultType_;
|
||||
static const constexpr bool allow_fixed_string = false;
|
||||
|
||||
static void vectorVector(const A * __restrict a, const B * __restrict b, ResultType * __restrict c, size_t size)
|
||||
{
|
||||
#if USE_MULTITARGET_CODE
|
||||
if (IsArchSupported(TargetArch::AVX512F))
|
||||
TargetSpecific::AVX512F::BinaryOperationImplBase<A, B, Op, ResultType>::vectorVector(a, b, c, size);
|
||||
else if (IsArchSupported(TargetArch::AVX2))
|
||||
TargetSpecific::AVX2::BinaryOperationImplBase<A, B, Op, ResultType>::vectorVector(a, b, c, size);
|
||||
else if (IsArchSupported(TargetArch::AVX))
|
||||
TargetSpecific::AVX::BinaryOperationImplBase<A, B, Op, ResultType>::vectorVector(a, b, c, size);
|
||||
else if (IsArchSupported(TargetArch::SSE42))
|
||||
TargetSpecific::SSE42::BinaryOperationImplBase<A, B, Op, ResultType>::vectorVector(a, b, c, size);
|
||||
else
|
||||
TargetSpecific::Default::BinaryOperationImplBase<A, B, Op, ResultType>::vectorVector(a, b, c, size);
|
||||
#else
|
||||
TargetSpecific::Default::BinaryOperationImplBase<A, B, Op, ResultType>::vectorVector(a, b, c, size);
|
||||
#endif
|
||||
}
|
||||
|
||||
static void vectorConstant(const A * __restrict a, B b, ResultType * __restrict c, size_t size)
|
||||
{
|
||||
#if USE_MULTITARGET_CODE
|
||||
if (IsArchSupported(TargetArch::AVX512F))
|
||||
TargetSpecific::AVX512F::BinaryOperationImplBase<A, B, Op, ResultType>::vectorConstant(a, b, c, size);
|
||||
else if (IsArchSupported(TargetArch::AVX2))
|
||||
TargetSpecific::AVX2::BinaryOperationImplBase<A, B, Op, ResultType>::vectorConstant(a, b, c, size);
|
||||
else if (IsArchSupported(TargetArch::AVX))
|
||||
TargetSpecific::AVX::BinaryOperationImplBase<A, B, Op, ResultType>::vectorConstant(a, b, c, size);
|
||||
else if (IsArchSupported(TargetArch::SSE42))
|
||||
TargetSpecific::SSE42::BinaryOperationImplBase<A, B, Op, ResultType>::vectorConstant(a, b, c, size);
|
||||
else
|
||||
TargetSpecific::Default::BinaryOperationImplBase<A, B, Op, ResultType>::vectorConstant(a, b, c, size);
|
||||
#else
|
||||
TargetSpecific::Default::BinaryOperationImplBase<A, B, Op, ResultType>::vectorConstant(a, b, c, size);
|
||||
#endif
|
||||
}
|
||||
|
||||
static void constantVector(A a, const B * __restrict b, ResultType * __restrict c, size_t size)
|
||||
{
|
||||
#if USE_MULTITARGET_CODE
|
||||
if (IsArchSupported(TargetArch::AVX512F))
|
||||
TargetSpecific::AVX512F::BinaryOperationImplBase<A, B, Op, ResultType>::constantVector(a, b, c, size);
|
||||
else if (IsArchSupported(TargetArch::AVX2))
|
||||
TargetSpecific::AVX2::BinaryOperationImplBase<A, B, Op, ResultType>::constantVector(a, b, c, size);
|
||||
else if (IsArchSupported(TargetArch::AVX))
|
||||
TargetSpecific::AVX::BinaryOperationImplBase<A, B, Op, ResultType>::constantVector(a, b, c, size);
|
||||
else if (IsArchSupported(TargetArch::SSE42))
|
||||
TargetSpecific::SSE42::BinaryOperationImplBase<A, B, Op, ResultType>::constantVector(a, b, c, size);
|
||||
else
|
||||
TargetSpecific::Default::BinaryOperationImplBase<A, B, Op, ResultType>::constantVector(a, b, c, size);
|
||||
#else
|
||||
TargetSpecific::Default::BinaryOperationImplBase<A, B, Op, ResultType>::constantVector(a, b, c, size);
|
||||
#endif
|
||||
}
|
||||
|
||||
static ResultType constantConstant(A a, B b)
|
||||
{
|
||||
return Op::template apply<ResultType>(a, b);
|
||||
}
|
||||
};
|
||||
|
||||
template <typename Op>
|
||||
struct FixedStringOperationImpl
|
||||
|
@ -1,6 +1,4 @@
|
||||
<!-- <test max_ignored_relative_change="0.4">
|
||||
TODO(dakovalkov): uncomment this -->
|
||||
<test>
|
||||
<test max_ignored_relative_change="0.4">
|
||||
<settings>
|
||||
<max_memory_usage>30000000000</max_memory_usage>
|
||||
</settings>
|
||||
|
Loading…
Reference in New Issue
Block a user