mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-06 02:18:05 +08:00
Cleaned up files: opencl/source/mem_obj/image.inl shared/offline_compiler/source/decoder/zebin_manipulator.h shared/source/aub_mem_dump/aub_alloc_dump.h shared/source/compiler_interface/intermediate_representations.h shared/source/helpers/blit_commands_helper_base.inl shared/source/utilities/debug_file_reader.h shared/source/utilities/software_tags.h shared/source/xe_hpc_core/hw_cmds_pvc.h Related-To: NEO-5548 Signed-off-by: Warchulski, Jaroslaw <jaroslaw.warchulski@intel.com>
60 lines
2.7 KiB
C++
60 lines
2.7 KiB
C++
/*
|
|
* Copyright (C) 2021-2023 Intel Corporation
|
|
*
|
|
* SPDX-License-Identifier: MIT
|
|
*
|
|
*/
|
|
|
|
#include "shared/source/execution_environment/root_device_environment.h"
|
|
#include "shared/source/helpers/gfx_core_helper.h"
|
|
#include "shared/source/helpers/hw_info.h"
|
|
#include "shared/source/helpers/local_memory_access_modes.h"
|
|
#include "shared/source/memory_manager/allocation_properties.h"
|
|
#include "shared/source/memory_manager/compression_selector.h"
|
|
#include "shared/source/os_interface/hw_info_config.h"
|
|
|
|
namespace NEO {
|
|
|
|
template <>
|
|
void GfxCoreHelperHw<Family>::setExtraAllocationData(AllocationData &allocationData, const AllocationProperties &properties, const RootDeviceEnvironment &rootDeviceEnvironment) const {
|
|
auto &hwInfo = *rootDeviceEnvironment.getHardwareInfo();
|
|
auto &productHelper = rootDeviceEnvironment.getHelper<ProductHelper>();
|
|
|
|
if (LocalMemoryAccessMode::CpuAccessDisallowed == productHelper.getLocalMemoryAccessMode(hwInfo)) {
|
|
if (properties.allocationType == AllocationType::LINEAR_STREAM ||
|
|
properties.allocationType == AllocationType::INTERNAL_HEAP ||
|
|
properties.allocationType == AllocationType::PRINTF_SURFACE ||
|
|
properties.allocationType == AllocationType::GPU_TIMESTAMP_DEVICE_BUFFER ||
|
|
properties.allocationType == AllocationType::RING_BUFFER ||
|
|
properties.allocationType == AllocationType::SEMAPHORE_BUFFER) {
|
|
allocationData.flags.useSystemMemory = true;
|
|
}
|
|
if (!allocationData.flags.useSystemMemory) {
|
|
allocationData.flags.requiresCpuAccess = false;
|
|
allocationData.storageInfo.isLockable = false;
|
|
}
|
|
} else if (hwInfo.featureTable.flags.ftrLocalMemory &&
|
|
(properties.allocationType == AllocationType::COMMAND_BUFFER ||
|
|
properties.allocationType == AllocationType::RING_BUFFER ||
|
|
properties.allocationType == AllocationType::SEMAPHORE_BUFFER)) {
|
|
allocationData.flags.useSystemMemory = false;
|
|
allocationData.flags.requiresCpuAccess = true;
|
|
}
|
|
|
|
if (CompressionSelector::allowStatelessCompression()) {
|
|
if (properties.allocationType == AllocationType::GLOBAL_SURFACE ||
|
|
properties.allocationType == AllocationType::CONSTANT_SURFACE ||
|
|
properties.allocationType == AllocationType::PRINTF_SURFACE) {
|
|
allocationData.flags.requiresCpuAccess = false;
|
|
allocationData.storageInfo.isLockable = false;
|
|
}
|
|
}
|
|
|
|
if (productHelper.isStorageInfoAdjustmentRequired()) {
|
|
if (properties.allocationType == AllocationType::BUFFER && !properties.flags.preferCompressed && !properties.flags.shareable) {
|
|
allocationData.storageInfo.isLockable = true;
|
|
}
|
|
}
|
|
}
|
|
} // namespace NEO
|