mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-19 16:24:18 +08:00
fix: fix issues with clang-tidy on Windows
Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
801d5fc48e
commit
140532f8b6
@@ -212,7 +212,7 @@ size_t APITracerContextImp::updateTracerArrays() {
|
||||
// from this thread to the tracing threads.
|
||||
//
|
||||
activeTracerArray.store(newTracerArray, std::memory_order_release);
|
||||
return testAndFreeRetiredTracers();
|
||||
return testAndFreeRetiredTracers(); // NOLINT(clang-analyzer-cplusplus.NewDeleteLeaks)
|
||||
}
|
||||
|
||||
ze_result_t APITracerContextImp::enableTracingImp(struct APITracerImp *tracerImp, ze_bool_t enable) {
|
||||
|
||||
@@ -89,7 +89,7 @@ class Command : public IFNode<Command> {
|
||||
Command(CommandQueue &commandQueue);
|
||||
Command(CommandQueue &commandQueue, std::unique_ptr<KernelOperation> &kernelOperation);
|
||||
|
||||
virtual ~Command();
|
||||
~Command() override;
|
||||
virtual LinearStream *getCommandStream() {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
@@ -268,7 +268,7 @@ std::vector<DeviceVector> Platform::groupDevices(DeviceVector devices) {
|
||||
outDevices[platformId].push_back(std::move(device));
|
||||
}
|
||||
std::sort(outDevices.begin(), outDevices.end(), [](DeviceVector &lhs, DeviceVector &rhs) -> bool {
|
||||
return lhs[0]->getHardwareInfo().platform.eProductFamily > rhs[0]->getHardwareInfo().platform.eProductFamily;
|
||||
return lhs[0]->getHardwareInfo().platform.eProductFamily > rhs[0]->getHardwareInfo().platform.eProductFamily; // NOLINT(clang-analyzer-cplusplus.Move)
|
||||
});
|
||||
return outDevices;
|
||||
}
|
||||
|
||||
@@ -93,7 +93,7 @@ void PrintFormatter::printString(const char *formatString, const std::function<v
|
||||
}
|
||||
|
||||
void PrintFormatter::stripVectorFormat(const char *format, char *stripped) {
|
||||
while (*format != '\0') {
|
||||
while (*format != '\0') { // //NOLINT(clang-analyzer-core.UndefinedBinaryOperatorResult)
|
||||
if (*format != 'v') {
|
||||
*stripped = *format;
|
||||
} else if (*(format + 1) != '1') {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2018-2022 Intel Corporation
|
||||
* Copyright (C) 2018-2023 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
@@ -38,6 +38,7 @@ struct IFNode {
|
||||
: next(nullptr) {
|
||||
}
|
||||
|
||||
virtual ~IFNode() = default;
|
||||
void insertOneNext(NodeObjectType &nd) {
|
||||
nd.next = next;
|
||||
next = &nd;
|
||||
@@ -191,6 +192,6 @@ class IFRefList : public IFList<IFNodeRef<NodeObjectType>, ThreadSafe, OwnsNodes
|
||||
auto up = std::unique_ptr<IFNodeRef<NodeObjectType>>(new IFNodeRef<NodeObjectType>(&node));
|
||||
this->pushFrontOne(*up);
|
||||
up.release();
|
||||
}
|
||||
} // NOLINT(clang-analyzer-cplusplus.NewDeleteLeaks)
|
||||
};
|
||||
} // namespace NEO
|
||||
|
||||
@@ -26,7 +26,7 @@ struct DummyFNode : IFNode<DummyFNode> {
|
||||
DummyFNode(uint32_t *destructorsCounter = nullptr)
|
||||
: destructorsCounter(destructorsCounter) {
|
||||
}
|
||||
~DummyFNode() {
|
||||
~DummyFNode() override {
|
||||
if (destructorsCounter != nullptr) {
|
||||
++(*destructorsCounter);
|
||||
}
|
||||
@@ -35,7 +35,7 @@ struct DummyFNode : IFNode<DummyFNode> {
|
||||
void setPrev(DummyFNode *) {
|
||||
}
|
||||
|
||||
uint32_t *destructorsCounter;
|
||||
uint32_t *destructorsCounter = nullptr;
|
||||
};
|
||||
|
||||
struct DummyDNode : IDNode<DummyDNode> {
|
||||
@@ -284,27 +284,33 @@ TEST(IFList, WhenExchangingHeadThenResultIsCorrect) {
|
||||
|
||||
template <bool ThreadSafe>
|
||||
void iFRefListTestPushFrontOne() {
|
||||
auto list = std::unique_ptr<IFRefList<DummyFNode, ThreadSafe, true>>(new IFRefList<DummyFNode, ThreadSafe, true>());
|
||||
ASSERT_TRUE(list->peekIsEmpty());
|
||||
uint32_t destructorCounter = 0;
|
||||
{
|
||||
auto list = std::unique_ptr<IFRefList<DummyFNode, ThreadSafe, true>>(new IFRefList<DummyFNode, ThreadSafe, true>());
|
||||
ASSERT_TRUE(list->peekIsEmpty());
|
||||
|
||||
DummyFNode node1;
|
||||
node1.next = nullptr; // garbage
|
||||
list->pushRefFrontOne(node1);
|
||||
ASSERT_FALSE(list->peekIsEmpty());
|
||||
ASSERT_EQ(&node1, list->peekHead()->ref);
|
||||
ASSERT_EQ(nullptr, node1.next);
|
||||
DummyFNode node1(&destructorCounter);
|
||||
node1.next = nullptr; // garbage
|
||||
list->pushRefFrontOne(node1);
|
||||
ASSERT_FALSE(list->peekIsEmpty());
|
||||
ASSERT_EQ(&node1, list->peekHead()->ref);
|
||||
ASSERT_EQ(nullptr, node1.next);
|
||||
|
||||
DummyFNode node2;
|
||||
node2.next = nullptr; // garbage
|
||||
list->pushRefFrontOne(node2);
|
||||
ASSERT_FALSE(list->peekIsEmpty());
|
||||
ASSERT_EQ(&node2, list->peekHead()->ref);
|
||||
ASSERT_EQ(nullptr, node2.next);
|
||||
DummyFNode node2(&destructorCounter);
|
||||
node2.next = nullptr; // garbage
|
||||
list->pushRefFrontOne(node2);
|
||||
ASSERT_FALSE(list->peekIsEmpty());
|
||||
ASSERT_EQ(&node2, list->peekHead()->ref);
|
||||
ASSERT_EQ(nullptr, node2.next);
|
||||
|
||||
ASSERT_EQ(&node2, list->peekHead()->ref);
|
||||
ASSERT_EQ(&node1, list->peekHead()->next->ref);
|
||||
ASSERT_EQ(&node2, list->peekHead()->ref);
|
||||
ASSERT_EQ(&node1, list->peekHead()->next->ref);
|
||||
|
||||
list.reset();
|
||||
EXPECT_EQ(0u, destructorCounter);
|
||||
list.reset();
|
||||
EXPECT_EQ(0u, destructorCounter);
|
||||
}
|
||||
EXPECT_EQ(2u, destructorCounter);
|
||||
}
|
||||
|
||||
TEST(IFRefList, GivenThreadSafeWhenPushingFrontOneThenResultIsCorrect) {
|
||||
|
||||
Reference in New Issue
Block a user