refactor: correct variable namings

Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
This commit is contained in:
Mateusz Jablonski
2023-11-23 17:09:04 +00:00
committed by Compute-Runtime-Automation
parent 9e3a8bdf1b
commit 36194c4e7d
126 changed files with 872 additions and 894 deletions

View File

@@ -42,9 +42,9 @@ class ArrayRef {
: begIt((ctr.size() > 0) ? &*ctr.begin() : nullptr), endIt((ctr.size() > 0) ? (&*(ctr.end() - 1) + 1) : nullptr) {
}
template <size_t Size>
ArrayRef(DataType (&array)[Size])
: begIt(&array[0]), endIt(&array[Size]) {
template <size_t size>
ArrayRef(DataType (&array)[size])
: begIt(&array[0]), endIt(&array[size]) {
}
ArrayRef() = default;

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2018-2022 Intel Corporation
* Copyright (C) 2018-2023 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
@@ -14,7 +14,7 @@
namespace NEO {
namespace Directory {
extern bool ReturnEmptyFilesVector;
extern bool returnEmptyFilesVector;
std::vector<std::string> getFiles(const std::string &path);
void createDirectory(const std::string &path);

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2018-2022 Intel Corporation
* Copyright (C) 2018-2023 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
@@ -167,10 +167,10 @@ struct IDNode {
NodeObjectType *next;
};
template <typename NodeObjectType, bool ThreadSafe = true, bool OwnsNodes = false, bool SupportRecursiveLock = true>
template <typename NodeObjectType, bool threadSafe = true, bool ownsNodes = false, bool supportRecursiveLock = true>
class IDList {
public:
using ThisType = IDList<NodeObjectType, ThreadSafe, OwnsNodes, SupportRecursiveLock>;
using ThisType = IDList<NodeObjectType, threadSafe, ownsNodes, supportRecursiveLock>;
IDList()
: head(nullptr), tail(nullptr), locked(), spinLockedListener(nullptr) {
@@ -251,8 +251,8 @@ class IDList {
NodeObjectType *peekTailImpl(NodeObjectType *, void *) {
return tail;
}
template <bool C = OwnsNodes>
typename std::enable_if<C, void>::type cleanup() {
template <bool c = ownsNodes>
typename std::enable_if<c, void>::type cleanup() {
if (head != nullptr) {
head->deleteThisAndAllNext();
}
@@ -260,8 +260,8 @@ class IDList {
tail = nullptr;
}
template <bool C = OwnsNodes>
typename std::enable_if<!C, void>::type cleanup() {
template <bool c = ownsNodes>
typename std::enable_if<!c, void>::type cleanup() {
;
}
@@ -271,8 +271,8 @@ class IDList {
}
}
template <typename T, NodeObjectType *(T::*Process)(NodeObjectType *node1, void *data), bool C1 = ThreadSafe, bool C2 = SupportRecursiveLock>
typename std::enable_if<C1 && !C2, NodeObjectType *>::type processLocked(NodeObjectType *node1 = nullptr, void *data = nullptr) {
template <typename T, NodeObjectType *(T::*Process)(NodeObjectType *node1, void *data), bool c1 = threadSafe, bool c2 = supportRecursiveLock>
typename std::enable_if<c1 && !c2, NodeObjectType *>::type processLocked(NodeObjectType *node1 = nullptr, void *data = nullptr) {
while (locked.test_and_set(std::memory_order_acquire)) {
notifySpinLocked();
}
@@ -290,8 +290,8 @@ class IDList {
return ret;
}
template <typename T, NodeObjectType *(T::*Process)(NodeObjectType *node1, void *data), bool C1 = ThreadSafe, bool C2 = SupportRecursiveLock>
typename std::enable_if<C1 && C2, NodeObjectType *>::type processLocked(NodeObjectType *node1 = nullptr, void *data = nullptr) {
template <typename T, NodeObjectType *(T::*Process)(NodeObjectType *node1, void *data), bool c1 = threadSafe, bool c2 = supportRecursiveLock>
typename std::enable_if<c1 && c2, NodeObjectType *>::type processLocked(NodeObjectType *node1 = nullptr, void *data = nullptr) {
std::thread::id currentThreadId = std::this_thread::get_id();
if (lockOwner == currentThreadId) {
return (static_cast<T *>(this)->*Process)(node1, data);
@@ -318,8 +318,8 @@ class IDList {
return ret;
}
template <typename T, NodeObjectType *(T::*Process)(NodeObjectType *node, void *data), bool C = ThreadSafe>
typename std::enable_if<!C, NodeObjectType *>::type processLocked(NodeObjectType *node = nullptr, void *data = nullptr) {
template <typename T, NodeObjectType *(T::*Process)(NodeObjectType *node, void *data), bool c = threadSafe>
typename std::enable_if<!c, NodeObjectType *>::type processLocked(NodeObjectType *node = nullptr, void *data = nullptr) {
return (this->*Process)(node, data);
}
@@ -459,8 +459,8 @@ struct IDNodeRef : IDNode<IDNodeRef<NodeObjectType>> {
NodeObjectType *ref;
};
template <typename NodeObjectType, bool ThreadSafe = true, bool OwnsNodes = true>
class IDRefList : public IDList<IDNodeRef<NodeObjectType>, ThreadSafe, OwnsNodes> {
template <typename NodeObjectType, bool threadSafe = true, bool ownsNodes = true>
class IDRefList : public IDList<IDNodeRef<NodeObjectType>, threadSafe, ownsNodes> {
public:
void pushRefFrontOne(NodeObjectType &node) {
auto refNode = std::unique_ptr<IDNodeRef<NodeObjectType>>(new IDNodeRef<NodeObjectType>(&node));

View File

@@ -88,7 +88,7 @@ struct IFNode {
NodeObjectType *next;
};
template <typename NodeObjectType, bool ThreadSafe = true, bool OwnsNodes = false>
template <typename NodeObjectType, bool threadSafe = true, bool ownsNodes = false>
class IFList {
public:
IFList()
@@ -106,34 +106,34 @@ class IFList {
IFList(const IFList &) = delete;
IFList &operator=(const IFList &) = delete;
template <bool C = ThreadSafe>
typename std::enable_if<C, void>::type pushFrontOne(NodeObjectType &node) {
template <bool c = threadSafe>
typename std::enable_if<c, void>::type pushFrontOne(NodeObjectType &node) {
node.next = head;
compareExchangeHead(node.next, &node);
}
template <bool C = ThreadSafe>
typename std::enable_if<C, NodeObjectType *>::type detachNodes() {
template <bool c = threadSafe>
typename std::enable_if<c, NodeObjectType *>::type detachNodes() {
NodeObjectType *rest = head;
compareExchangeHead(rest, nullptr);
return rest;
}
template <bool C = ThreadSafe>
typename std::enable_if<!C, void>::type pushFrontOne(NodeObjectType &node) {
template <bool c = threadSafe>
typename std::enable_if<!c, void>::type pushFrontOne(NodeObjectType &node) {
node.next = head;
head = &node;
}
template <bool C = ThreadSafe>
typename std::enable_if<!C, NodeObjectType *>::type detachNodes() {
template <bool c = threadSafe>
typename std::enable_if<!c, NodeObjectType *>::type detachNodes() {
NodeObjectType *rest = head;
head = nullptr;
return rest;
}
template <bool C = ThreadSafe>
typename std::enable_if<!C, void>::type splice(NodeObjectType &nodes) {
template <bool c = threadSafe>
typename std::enable_if<!c, void>::type splice(NodeObjectType &nodes) {
if (head == nullptr) {
head = &nodes;
} else {
@@ -157,24 +157,24 @@ class IFList {
}
protected:
template <bool C = OwnsNodes>
typename std::enable_if<C, void>::type cleanup() {
template <bool c = ownsNodes>
typename std::enable_if<c, void>::type cleanup() {
deleteAll();
}
template <bool C = OwnsNodes>
typename std::enable_if<!C, void>::type cleanup() {
template <bool c = ownsNodes>
typename std::enable_if<!c, void>::type cleanup() {
;
}
template <bool C = ThreadSafe>
typename std::enable_if<C, void>::type compareExchangeHead(NodeObjectType *&expected, NodeObjectType *desired) {
template <bool c = threadSafe>
typename std::enable_if<c, void>::type compareExchangeHead(NodeObjectType *&expected, NodeObjectType *desired) {
while (!NEO::MultiThreadHelpers::atomicCompareExchangeWeakSpin(head, expected, desired)) {
;
}
}
PtrType_t<NodeObjectType, ThreadSafe> head;
PtrType_t<NodeObjectType, threadSafe> head;
};
template <typename NodeObjectType>
@@ -185,8 +185,8 @@ struct IFNodeRef : IFNode<IFNodeRef<NodeObjectType>> {
NodeObjectType *ref;
};
template <typename NodeObjectType, bool ThreadSafe = true, bool OwnsNodes = true>
class IFRefList : public IFList<IFNodeRef<NodeObjectType>, ThreadSafe, OwnsNodes> {
template <typename NodeObjectType, bool threadSafe = true, bool ownsNodes = true>
class IFRefList : public IFList<IFNodeRef<NodeObjectType>, threadSafe, ownsNodes> {
public:
void pushRefFrontOne(NodeObjectType &node) {
auto up = std::unique_ptr<IFNodeRef<NodeObjectType>>(new IFNodeRef<NodeObjectType>(&node));

View File

@@ -22,8 +22,8 @@ FileLogger<globalDebugFunctionalityLevel> &fileLoggerInstance() {
return fileLoggerInstance;
}
template <DebugFunctionalityLevel DebugLevel>
FileLogger<DebugLevel>::FileLogger(std::string filename, const DebugVariables &flags) {
template <DebugFunctionalityLevel debugLevel>
FileLogger<debugLevel>::FileLogger(std::string filename, const DebugVariables &flags) {
logFileName = std::move(filename);
if (enabled()) {
std::remove(logFileName.c_str());
@@ -36,11 +36,11 @@ FileLogger<DebugLevel>::FileLogger(std::string filename, const DebugVariables &f
logAllocationStdout = flags.LogAllocationStdout.get();
}
template <DebugFunctionalityLevel DebugLevel>
FileLogger<DebugLevel>::~FileLogger() = default;
template <DebugFunctionalityLevel debugLevel>
FileLogger<debugLevel>::~FileLogger() = default;
template <DebugFunctionalityLevel DebugLevel>
void FileLogger<DebugLevel>::writeToFile(std::string filename, const char *str, size_t length, std::ios_base::openmode mode) {
template <DebugFunctionalityLevel debugLevel>
void FileLogger<debugLevel>::writeToFile(std::string filename, const char *str, size_t length, std::ios_base::openmode mode) {
std::lock_guard theLock(mutex);
std::ofstream outFile(filename, mode);
if (outFile.is_open()) {
@@ -49,8 +49,8 @@ void FileLogger<DebugLevel>::writeToFile(std::string filename, const char *str,
}
}
template <DebugFunctionalityLevel DebugLevel>
void FileLogger<DebugLevel>::logDebugString(bool enableLog, std::string_view debugString) {
template <DebugFunctionalityLevel debugLevel>
void FileLogger<debugLevel>::logDebugString(bool enableLog, std::string_view debugString) {
if (enabled()) {
if (enableLog) {
writeToFile(logFileName, debugString.data(), debugString.size(), std::ios::app);
@@ -58,8 +58,8 @@ void FileLogger<DebugLevel>::logDebugString(bool enableLog, std::string_view deb
}
}
template <DebugFunctionalityLevel DebugLevel>
void FileLogger<DebugLevel>::dumpKernel(const std::string &name, const std::string &src) {
template <DebugFunctionalityLevel debugLevel>
void FileLogger<debugLevel>::dumpKernel(const std::string &name, const std::string &src) {
if (false == enabled()) {
return;
}
@@ -70,8 +70,8 @@ void FileLogger<DebugLevel>::dumpKernel(const std::string &name, const std::stri
}
}
template <DebugFunctionalityLevel DebugLevel>
void FileLogger<DebugLevel>::logApiCall(const char *function, bool enter, int32_t errorCode) {
template <DebugFunctionalityLevel debugLevel>
void FileLogger<debugLevel>::logApiCall(const char *function, bool enter, int32_t errorCode) {
if (false == enabled()) {
return;
}
@@ -92,8 +92,8 @@ void FileLogger<DebugLevel>::logApiCall(const char *function, bool enter, int32_
}
}
template <DebugFunctionalityLevel DebugLevel>
void FileLogger<DebugLevel>::logAllocation(GraphicsAllocation const *graphicsAllocation) {
template <DebugFunctionalityLevel debugLevel>
void FileLogger<debugLevel>::logAllocation(GraphicsAllocation const *graphicsAllocation) {
if (logAllocationType) {
printDebugString(true, stdout, "Created Graphics Allocation of type %s\n", getAllocationTypeString(graphicsAllocation));
}
@@ -126,15 +126,15 @@ void FileLogger<DebugLevel>::logAllocation(GraphicsAllocation const *graphicsAll
}
}
template <DebugFunctionalityLevel DebugLevel>
size_t FileLogger<DebugLevel>::getInput(const size_t *input, int32_t index) {
template <DebugFunctionalityLevel debugLevel>
size_t FileLogger<debugLevel>::getInput(const size_t *input, int32_t index) {
if (enabled() == false)
return 0;
return input != nullptr ? input[index] : 0;
}
template <DebugFunctionalityLevel DebugLevel>
void FileLogger<DebugLevel>::dumpBinaryProgram(int32_t numDevices, const size_t *lengths, const unsigned char **binaries) {
template <DebugFunctionalityLevel debugLevel>
void FileLogger<debugLevel>::dumpBinaryProgram(int32_t numDevices, const size_t *lengths, const unsigned char **binaries) {
if (false == enabled()) {
return;
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2019-2022 Intel Corporation
* Copyright (C) 2019-2023 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
@@ -20,7 +20,7 @@ class GraphicsAllocation;
const char *getAllocationTypeString(GraphicsAllocation const *graphicsAllocation);
const char *getMemoryPoolString(GraphicsAllocation const *graphicsAllocation);
template <DebugFunctionalityLevel DebugLevel>
template <DebugFunctionalityLevel debugLevel>
class FileLogger {
public:
FileLogger(std::string filename, const DebugVariables &flags);
@@ -30,7 +30,7 @@ class FileLogger {
FileLogger &operator=(const FileLogger &) = delete;
static constexpr bool enabled() {
return DebugLevel == DebugFunctionalityLevel::Full;
return debugLevel == DebugFunctionalityLevel::Full;
}
void dumpKernel(const std::string &name, const std::string &src);

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2018-2020 Intel Corporation
* Copyright (C) 2018-2023 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
@@ -13,7 +13,7 @@
namespace NEO {
template <uint8_t NumBits>
template <uint8_t numBits>
struct StorageType;
template <>
@@ -36,13 +36,13 @@ struct StorageType<64> {
using Type = uint64_t;
};
template <uint8_t NumBits>
template <uint8_t numBits>
struct StorageType {
using Type = typename StorageType<NumBits + 1>::Type;
using Type = typename StorageType<numBits + 1>::Type;
};
template <uint8_t NumBits>
using StorageTypeT = typename StorageType<NumBits>::Type;
template <uint8_t numBits>
using StorageTypeT = typename StorageType<numBits>::Type;
template <uint8_t IntegerBits, uint8_t FractionalBits, uint8_t TotalBits = IntegerBits + FractionalBits>
struct UnsignedFixedPointValue {