Cosmetics, fix style issues

This commit is contained in:
Dmitrii Kovalkov 2020-05-16 19:21:23 +02:00
parent a4ff8bb933
commit ad0ddc936a
4 changed files with 11 additions and 9 deletions

View File

@ -133,7 +133,7 @@ public:
using BaseFunctionPtr = ExecutableFunctionImplPtr;
template <typename ...Args>
FunctionExecutor(Args ...args) : DefaultFunction(args...) {}
FunctionExecutor(Args&&... args) : DefaultFunction(std::forward<Args>(args)...) {}
virtual void executeFunctionImpl(Block & block, const ColumnNumbers & arguments, size_t result, size_t input_rows_count) = 0;
@ -151,7 +151,7 @@ public:
using BaseFunctionPtr = FunctionPtr;
template <typename ...Args>
FunctionExecutor(Args ...args) : DefaultFunction(args...) {}
FunctionExecutor(Args&&... args) : DefaultFunction(std::forward<Args>(args)...) {}
virtual void executeFunctionImpl(Block & block, const ColumnNumbers & arguments, size_t result, size_t input_rows_count) = 0;
@ -174,8 +174,8 @@ public:
using BaseFunctionPtr = FunctionExecutor<DefaultFunction>::BaseFunctionPtr;
template <typename ...Params>
FunctionPerformanceAdaptor(PerformanceAdaptorOptions options_, Params ...params)
: FunctionExecutor<DefaultFunction>(params...)
FunctionPerformanceAdaptor(PerformanceAdaptorOptions options_, Params&&... params)
: FunctionExecutor<DefaultFunction>(std::forward<Params>(params)...)
, options(std::move(options_))
{
if (isImplementationEnabled(DefaultFunction::getImplementationTag()))
@ -184,15 +184,17 @@ public:
/// Register alternative implementation.
template<typename Function, typename ...Params>
void registerImplementation(TargetArch arch, Params... params) {
void registerImplementation(TargetArch arch, Params&&... params)
{
if (IsArchSupported(arch) && isImplementationEnabled(Function::getImplementationTag()))
{
impls.emplace_back(std::make_shared<Function>(params...));
impls.emplace_back(std::make_shared<Function>(std::forward<Params>(params)...));
statistics.emplace_back();
}
}
bool isImplementationEnabled(const String & impl_tag) {
bool isImplementationEnabled(const String & impl_tag)
{
if (!options.implementations)
return true;

View File

@ -4,7 +4,7 @@
#include <Common/randomSeed.h>
#include <common/unaligned.h>
#include <Functions/SIMDxorshift.h>
#include <Functions/RandXorshift.h>
extern "C"
{

View File

@ -4,7 +4,7 @@
/// This file contains macros and helpers for writing platform-dependent code.
///
/// Macroses DECLARE_<Arch>_SPECIFIC_CODE will wrap code inside them into the
/// Macros DECLARE_<Arch>_SPECIFIC_CODE will wrap code inside them into the
/// namespace TargetSpecific::<Arch> and enable Arch-specific compile options.
/// Thus, it's allowed to call functions inside these namespaces only after
/// checking platform in runtime (see IsArchSupported() below).