2020-09-11 15:44:09 +02:00
|
|
|
/*
|
2025-07-22 16:36:22 +00:00
|
|
|
* Copyright (C) 2020-2025 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"
|
|
|
|
|
|
|
|
|
|
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) {
|
2023-12-11 14:24:36 +00:00
|
|
|
case AllocationType::globalSurface:
|
|
|
|
|
case AllocationType::constantSurface:
|
|
|
|
|
case AllocationType::svmGpu:
|
|
|
|
|
case AllocationType::printfSurface: {
|
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
|