Improve files of SipKernel class

This change:
- removes redundant copying of std::vector
- removes unneeded includes from the header file
and introduces usage of forward declaration

Signed-off-by: Patryk Wrobel <patryk.wrobel@intel.com>
This commit is contained in:
Patryk Wrobel
2022-08-28 23:20:29 +00:00
committed by Compute-Runtime-Automation
parent 4809a2a9b3
commit de3e5d4d69
4 changed files with 15 additions and 6 deletions

View File

@ -14,6 +14,7 @@
#include "shared/source/helpers/aligned_memory.h"
#include "shared/source/helpers/debug_helpers.h"
#include "shared/source/helpers/hw_helper.h"
#include "shared/source/helpers/hw_info.h"
#include "shared/source/helpers/ptr_math.h"
#include "shared/source/helpers/string.h"
#include "shared/source/memory_manager/allocation_properties.h"
@ -59,7 +60,7 @@ std::vector<char> readFile(const std::string &fileName, size_t &retSize) {
SipKernel::~SipKernel() = default;
SipKernel::SipKernel(SipKernelType type, GraphicsAllocation *sipAlloc, std::vector<char> ssah) : stateSaveAreaHeader(ssah), sipAllocation(sipAlloc), type(type) {
SipKernel::SipKernel(SipKernelType type, GraphicsAllocation *sipAlloc, std::vector<char> ssah) : stateSaveAreaHeader(std::move(ssah)), sipAllocation(sipAlloc), type(type) {
}
GraphicsAllocation *SipKernel::getSipAllocation() const {
@ -74,7 +75,7 @@ size_t SipKernel::getStateSaveAreaSize(Device *device) const {
auto &hwInfo = device->getHardwareInfo();
auto &hwHelper = HwHelper::get(hwInfo.platform.eRenderCoreFamily);
auto maxDbgSurfaceSize = hwHelper.getSipKernelMaxDbgSurfaceSize(hwInfo);
auto stateSaveAreaHeader = getStateSaveAreaHeader();
const auto &stateSaveAreaHeader = getStateSaveAreaHeader();
if (stateSaveAreaHeader.empty()) {
return maxDbgSurfaceSize;
}

View File

@ -6,17 +6,21 @@
*/
#pragma once
#include "shared/source/built_ins/sip_kernel_type.h"
#include "shared/source/helpers/hw_info.h"
#include "shared/source/program/program_info.h"
#include "shared/source/built_ins/sip_kernel_type.h"
#include <cstddef>
#include <memory>
#include <string>
#include <vector>
namespace NEO {
class Device;
class GraphicsAllocation;
class MemoryManager;
struct HardwareInfo;
struct RootDeviceEnvironment;
class SipKernel {
@ -68,4 +72,5 @@ class SipKernel {
GraphicsAllocation *sipAllocation = nullptr;
SipKernelType type = SipKernelType::COUNT;
};
} // namespace NEO

View File

@ -1,5 +1,5 @@
/*
* Copyright (C) 2018-2021 Intel Corporation
* Copyright (C) 2018-2022 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
@ -7,6 +7,7 @@
#pragma once
#include "shared/source/debug_settings/debug_settings_manager.h"
#include "shared/source/helpers/debug_helpers.h"
#include "shared/source/helpers/validators.h"
#include "shared/source/os_interface/os_library.h"