From 0603819b68cc48a48e32b727a868929e6470774e Mon Sep 17 00:00:00 2001 From: Kamil Kopryk Date: Wed, 27 Jul 2022 04:10:35 +0000 Subject: [PATCH] Cleanup includes 3/n Signed-off-by: Kamil Kopryk --- shared/source/helpers/debug_helpers.cpp | 5 +++-- shared/source/helpers/debug_helpers.h | 3 +-- shared/source/memory_manager/host_ptr_manager.cpp | 11 ++++++----- 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/shared/source/helpers/debug_helpers.cpp b/shared/source/helpers/debug_helpers.cpp index 69fa2f35b5..938193ba15 100644 --- a/shared/source/helpers/debug_helpers.cpp +++ b/shared/source/helpers/debug_helpers.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2018-2021 Intel Corporation + * Copyright (C) 2018-2022 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -8,8 +8,9 @@ #include "shared/source/helpers/debug_helpers.h" #include "shared/source/debug_settings/debug_settings_manager.h" +#include "shared/source/helpers/abort.h" -#include +#include #include namespace NEO { diff --git a/shared/source/helpers/debug_helpers.h b/shared/source/helpers/debug_helpers.h index 037deaf7c4..ccc65fa709 100644 --- a/shared/source/helpers/debug_helpers.h +++ b/shared/source/helpers/debug_helpers.h @@ -1,12 +1,11 @@ /* - * Copyright (C) 2018-2021 Intel Corporation + * Copyright (C) 2018-2022 Intel Corporation * * SPDX-License-Identifier: MIT * */ #pragma once -#include "shared/source/helpers/abort.h" #include "shared/source/helpers/preprocessor.h" #define UNRECOVERABLE_IF(expression) \ diff --git a/shared/source/memory_manager/host_ptr_manager.cpp b/shared/source/memory_manager/host_ptr_manager.cpp index 8815f401a0..659d707617 100644 --- a/shared/source/memory_manager/host_ptr_manager.cpp +++ b/shared/source/memory_manager/host_ptr_manager.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2018-2021 Intel Corporation + * Copyright (C) 2018-2022 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -7,6 +7,7 @@ #include "shared/source/memory_manager/host_ptr_manager.h" +#include "shared/source/helpers/abort.h" #include "shared/source/memory_manager/memory_manager.h" using namespace NEO; @@ -110,7 +111,7 @@ OsHandleStorage HostPtrManager::populateAlreadyAllocatedFragments(AllocationRequ handleStorage.fragmentStorageData[i].cpuPtr = requirements.allocationFragments[i].allocationPtr; handleStorage.fragmentStorageData[i].fragmentSize = requirements.allocationFragments[i].allocationSize; } else { - //abort whole application instead of silently passing. + // abort whole application instead of silently passing. abortExecution(); return handleStorage; } @@ -178,7 +179,7 @@ FragmentStorage *HostPtrManager::getFragment(HostPtrEntryKey key) { return nullptr; } -//for given inputs see if any allocation overlaps +// for given inputs see if any allocation overlaps FragmentStorage *HostPtrManager::getFragmentAndCheckForOverlaps(uint32_t rootDeviceIndex, const void *inPtr, size_t size, OverlapStatus &overlappingStatus) { std::lock_guard lock(allocationsMutex); void *inputPtr = const_cast(inPtr); @@ -212,7 +213,7 @@ FragmentStorage *HostPtrManager::getFragmentAndCheckForOverlaps(uint32_t rootDev return nullptr; } } - //next fragment doesn't have to be after the inputPtr + // next fragment doesn't have to be after the inputPtr if (nextElement != partialAllocations.end()) { if (nextElement->first.rootDeviceIndex != rootDeviceIndex) { return nullptr; @@ -220,7 +221,7 @@ FragmentStorage *HostPtrManager::getFragmentAndCheckForOverlaps(uint32_t rootDev auto &storedNextElement = nextElement->second; auto storedNextEndAddress = (uintptr_t)storedNextElement.fragmentCpuPointer + storedNextElement.fragmentSize; auto storedNextStartAddress = (uintptr_t)storedNextElement.fragmentCpuPointer; - //check if this allocation is after the inputPtr + // check if this allocation is after the inputPtr if ((uintptr_t)inputPtr < storedNextStartAddress) { if (inputEndAddress > storedNextStartAddress) { overlappingStatus = OverlapStatus::FRAGMENT_OVERLAPING_AND_BIGGER_THEN_STORED_FRAGMENT;