2020-09-11 15:44:09 +02:00
|
|
|
/*
|
2023-01-04 09:45:07 +00:00
|
|
|
* Copyright (C) 2020-2023 Intel Corporation
|
2020-09-11 15:44:09 +02:00
|
|
|
*
|
|
|
|
|
* SPDX-License-Identifier: MIT
|
|
|
|
|
*
|
|
|
|
|
*/
|
|
|
|
|
|
2022-09-14 10:50:58 +00:00
|
|
|
#include "shared/source/memory_manager/allocation_properties.h"
|
2020-09-11 15:44:09 +02:00
|
|
|
#include "shared/source/memory_manager/compression_selector.h"
|
2022-09-14 10:50:58 +00:00
|
|
|
#include "shared/source/memory_manager/graphics_allocation.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 {
|
2023-01-04 09:45:07 +00:00
|
|
|
bool CompressionSelector::preferCompressedAllocation(const AllocationProperties &properties) {
|
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: {
|
2023-01-04 09:45:07 +00:00
|
|
|
return CompressionSelector::allowStatelessCompression();
|
2021-08-02 17:20:25 +00:00
|
|
|
}
|
|
|
|
|
default:
|
|
|
|
|
return false;
|
|
|
|
|
}
|
2020-09-11 15:44:09 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
} // namespace NEO
|