mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-03 14:55:24 +08:00
Correct formatting
Signed-off-by: Filip Hazubski <filip.hazubski@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
264f20ea00
commit
9a8125cdb0
@@ -71,7 +71,7 @@ constexpr size_t concatenationLength(const T &t) {
|
||||
}
|
||||
|
||||
template <typename T, typename... RestT>
|
||||
constexpr size_t concatenationLength(const T &arg, const RestT &... rest) {
|
||||
constexpr size_t concatenationLength(const T &arg, const RestT &...rest) {
|
||||
return length(arg) + spaceSeparatorSize + concatenationLength(rest...);
|
||||
}
|
||||
|
||||
@@ -84,13 +84,13 @@ inline void concatenateAppend(ContainerT &out, T &&arg) {
|
||||
}
|
||||
|
||||
template <typename ContainerT, typename T, typename... RestT>
|
||||
inline void concatenateAppend(ContainerT &out, T &&arg, RestT &&... rest) {
|
||||
inline void concatenateAppend(ContainerT &out, T &&arg, RestT &&...rest) {
|
||||
concatenateAppend(out, std::forward<T>(arg));
|
||||
concatenateAppend(out, std::forward<RestT>(rest)...);
|
||||
}
|
||||
|
||||
template <typename T, typename... RestT>
|
||||
inline std::string concatenate(T &&arg, RestT &&... rest) {
|
||||
inline std::string concatenate(T &&arg, RestT &&...rest) {
|
||||
std::string ret;
|
||||
ret.reserve(nullterminateSize + concatenationLength(arg, rest...));
|
||||
concatenateAppend(ret, std::forward<T>(arg), std::forward<RestT>(rest)...);
|
||||
|
||||
@@ -34,7 +34,7 @@ constexpr DebugFunctionalityLevel globalDebugFunctionalityLevel = DebugFunctiona
|
||||
|
||||
namespace NEO {
|
||||
template <typename... Args>
|
||||
void printDebugString(bool showDebugLogs, Args &&... args) {
|
||||
void printDebugString(bool showDebugLogs, Args &&...args) {
|
||||
if (showDebugLogs) {
|
||||
fprintf(std::forward<Args>(args)...);
|
||||
}
|
||||
|
||||
@@ -31,7 +31,7 @@ class Device : public ReferenceTrackedObject<Device> {
|
||||
~Device() override;
|
||||
|
||||
template <typename DeviceT, typename... ArgsT>
|
||||
static DeviceT *create(ArgsT &&... args) {
|
||||
static DeviceT *create(ArgsT &&...args) {
|
||||
DeviceT *device = new DeviceT(std::forward<ArgsT>(args)...);
|
||||
return createDeviceInternals(device);
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2019-2020 Intel Corporation
|
||||
* Copyright (C) 2019-2021 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
@@ -33,12 +33,12 @@ struct PatchTokensStreamReader {
|
||||
}
|
||||
|
||||
template <typename... ArgsT>
|
||||
bool enoughDataLeft(ArgsT &&... args) {
|
||||
bool enoughDataLeft(ArgsT &&...args) {
|
||||
return false == notEnoughDataLeft(std::forward<ArgsT>(args)...);
|
||||
}
|
||||
|
||||
template <typename T, typename... ArgsT>
|
||||
bool enoughDataLeft(ArgsT &&... args) {
|
||||
bool enoughDataLeft(ArgsT &&...args) {
|
||||
return false == notEnoughDataLeft<T>(std::forward<ArgsT>(args)...);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2017-2020 Intel Corporation
|
||||
* Copyright (C) 2017-2021 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
@@ -26,11 +26,11 @@ inline size_t getThreadsPerWG(uint32_t simd, size_t lws) {
|
||||
// This sequence is meant to avoid an CPU DIV instruction.
|
||||
result >>= simd == 32
|
||||
? 5
|
||||
: simd == 16
|
||||
? 4
|
||||
: simd == 8
|
||||
? 3
|
||||
: 0;
|
||||
: simd == 16
|
||||
? 4
|
||||
: simd == 8
|
||||
? 3
|
||||
: 0;
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2017-2020 Intel Corporation
|
||||
* Copyright (C) 2017-2021 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
@@ -27,14 +27,14 @@ class RegisteredMethodDispatcher {
|
||||
}
|
||||
|
||||
template <typename... Args>
|
||||
void operator()(Args &&... args) const {
|
||||
void operator()(Args &&...args) const {
|
||||
if (method) {
|
||||
method(std::forward<Args>(args)...);
|
||||
}
|
||||
}
|
||||
|
||||
template <typename... Args>
|
||||
size_t estimateCommandsSize(Args &&... args) const {
|
||||
size_t estimateCommandsSize(Args &&...args) const {
|
||||
if (commandsEstimationMethod) {
|
||||
return commandsEstimationMethod(std::forward<Args>(args)...);
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2019-2020 Intel Corporation
|
||||
* Copyright (C) 2019-2021 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
@@ -15,7 +15,7 @@ namespace NEO {
|
||||
class TimeMeasureWrapper {
|
||||
public:
|
||||
template <class O, class F, class... Args>
|
||||
static decltype(auto) functionExecution(O &&obj, F &&func, Args &&... args) {
|
||||
static decltype(auto) functionExecution(O &&obj, F &&func, Args &&...args) {
|
||||
auto start = std::chrono::system_clock::now();
|
||||
auto retVal = (obj.*func)(std::forward<Args>(args)...);
|
||||
auto end = std::chrono::system_clock::now();
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2019-2020 Intel Corporation
|
||||
* Copyright (C) 2019-2021 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
@@ -40,7 +40,7 @@ struct LightMockConfig {
|
||||
};
|
||||
|
||||
template <typename ConfigT, typename ObjT, typename... ArgsT>
|
||||
typename ConfigT::MockReturnT invokeMocked(ConfigT &config, ObjT obj, ArgsT &&... args) {
|
||||
typename ConfigT::MockReturnT invokeMocked(ConfigT &config, ObjT obj, ArgsT &&...args) {
|
||||
config.timesCalled += 1;
|
||||
if (config.overrideFunc) {
|
||||
return config.overrideFunc(obj, std::forward<ArgsT>(args)...);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2018-2020 Intel Corporation
|
||||
* Copyright (C) 2018-2021 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
@@ -28,7 +28,7 @@ static ReleaseableObjectPtr<T> clUniquePtr(T *object) {
|
||||
}
|
||||
|
||||
template <class _Ty, class... _Types>
|
||||
inline ReleaseableObjectPtr<_Ty> make_releaseable(_Types &&... args) {
|
||||
inline ReleaseableObjectPtr<_Ty> make_releaseable(_Types &&...args) {
|
||||
return (ReleaseableObjectPtr<_Ty>(new _Ty(std::forward<_Types>(args)...)));
|
||||
}
|
||||
} // namespace NEO
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2017-2020 Intel Corporation
|
||||
* Copyright (C) 2017-2021 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
@@ -15,7 +15,7 @@ size_t countArgs(const Arg1 &arg1) {
|
||||
}
|
||||
|
||||
template <typename Arg1, typename... Rest>
|
||||
size_t countArgs(const Arg1 &arg1, const Rest &... rest) {
|
||||
size_t countArgs(const Arg1 &arg1, const Rest &...rest) {
|
||||
return 1 + countArgs(rest...);
|
||||
}
|
||||
|
||||
@@ -29,7 +29,7 @@ int verifySequence(const NodeObjectType *base, int nodeNum, const NodeObjectType
|
||||
}
|
||||
|
||||
template <typename NodeObjectType, typename... Rest>
|
||||
int verifySequence(const NodeObjectType *base, int nodeNum, const NodeObjectType *current, const Rest *... rest) {
|
||||
int verifySequence(const NodeObjectType *base, int nodeNum, const NodeObjectType *current, const Rest *...rest) {
|
||||
if (base == nullptr) {
|
||||
return nodeNum - 1;
|
||||
} else if (base == current) {
|
||||
@@ -43,7 +43,7 @@ int verifySequence(const NodeObjectType *base, int nodeNum, const NodeObjectType
|
||||
// Negative return values indicates that the sequence is ordered as requested.
|
||||
// Non-negative value indicates first node that breaks the order.
|
||||
template <typename NodeObjectType, typename... Rest>
|
||||
int verifySequence(const NodeObjectType *base, const NodeObjectType *first, const Rest *... rest) {
|
||||
int verifySequence(const NodeObjectType *base, const NodeObjectType *first, const Rest *...rest) {
|
||||
return verifySequence(base, 0, first, rest...);
|
||||
}
|
||||
|
||||
@@ -52,7 +52,7 @@ int verifySequence(const NodeObjectType *base, const NodeObjectType *first, cons
|
||||
// Non-negative value indicates first node that breaks the order.
|
||||
// Note : verifies also "last->tail == nulptr"
|
||||
template <typename NodeObjectType, typename... Rest>
|
||||
int verifyFListOrder(const NodeObjectType *base, const NodeObjectType *first, const Rest *... rest) {
|
||||
int verifyFListOrder(const NodeObjectType *base, const NodeObjectType *first, const Rest *...rest) {
|
||||
NodeObjectType *sentinel = nullptr;
|
||||
int sequenceRet = verifySequence(base, first, rest..., sentinel);
|
||||
if (sequenceRet < 0) {
|
||||
@@ -72,7 +72,7 @@ int verifyFListOrder(const NodeObjectType *base, const NodeObjectType *first, co
|
||||
// Non-negative value indicates first node that breaks the order.
|
||||
// Note : verifies also "first->prev == nullptr" and "last->tail == nulptr"
|
||||
template <typename NodeObjectType, typename... Rest>
|
||||
int verifyDListOrder(const NodeObjectType *base, const NodeObjectType *first, const Rest *... rest) {
|
||||
int verifyDListOrder(const NodeObjectType *base, const NodeObjectType *first, const Rest *...rest) {
|
||||
if (base->prev != nullptr) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2018-2020 Intel Corporation
|
||||
* Copyright (C) 2018-2021 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
@@ -13,8 +13,8 @@ namespace NEO {
|
||||
template <typename BaseType, uint32_t ordinal>
|
||||
struct DestructorCounted : public BaseType {
|
||||
template <typename... Args>
|
||||
DestructorCounted(uint32_t &destructorId, Args &&... args) : BaseType(std::forward<Args>(args)...),
|
||||
destructorId(destructorId) {}
|
||||
DestructorCounted(uint32_t &destructorId, Args &&...args) : BaseType(std::forward<Args>(args)...),
|
||||
destructorId(destructorId) {}
|
||||
|
||||
~DestructorCounted() override {
|
||||
EXPECT_EQ(ordinal, destructorId);
|
||||
|
||||
Reference in New Issue
Block a user