2020-09-11 21:44:09 +08:00
|
|
|
/*
|
2022-02-04 21:59:01 +08:00
|
|
|
* Copyright (C) 2020-2022 Intel Corporation
|
2020-09-11 21:44:09 +08:00
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: MIT
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "shared/source/memory_manager/compression_selector.h"
|
2021-09-08 23:07:46 +08:00
|
|
|
#include "shared/source/os_interface/hw_info_config.h"
|
2020-09-11 21:44:09 +08:00
|
|
|
|
|
|
|
namespace NEO {
|
2021-12-03 21:52:16 +08:00
|
|
|
bool CompressionSelector::preferCompressedAllocation(const AllocationProperties &properties, const HardwareInfo &hwInfo) {
|
2021-08-03 01:20:25 +08:00
|
|
|
switch (properties.allocationType) {
|
2022-02-04 21:59:01 +08:00
|
|
|
case AllocationType::GLOBAL_SURFACE:
|
|
|
|
case AllocationType::CONSTANT_SURFACE:
|
|
|
|
case AllocationType::SVM_GPU:
|
|
|
|
case AllocationType::PRINTF_SURFACE: {
|
2021-09-08 23:07:46 +08:00
|
|
|
const auto &hwInfoConfig = *HwInfoConfig::get(hwInfo.platform.eProductFamily);
|
|
|
|
return hwInfoConfig.allowStatelessCompression(hwInfo);
|
2021-08-03 01:20:25 +08:00
|
|
|
}
|
|
|
|
default:
|
|
|
|
return false;
|
|
|
|
}
|
2020-09-11 21:44:09 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
} // namespace NEO
|