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