Files
compute-runtime/shared/source/helpers/cache_policy.cpp
Zbigniew Zdanowicz 34064811d2 Refactor state base address programing 4/n
- This change gets level one cache policy from cached values instead
of calling virtual methods

Related-To: NEO-5055

Signed-off-by: Zbigniew Zdanowicz <zbigniew.zdanowicz@intel.com>
2023-02-27 17:30:36 +01:00

31 lines
876 B
C++

/*
* Copyright (C) 2018-2023 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
*/
#include "shared/source/helpers/cache_policy.h"
#include "shared/source/helpers/aligned_memory.h"
#include "shared/source/memory_manager/graphics_allocation.h"
#include "shared/source/os_interface/hw_info_config.h"
namespace NEO {
bool isL3Capable(void *ptr, size_t size) {
return isAligned<MemoryConstants::cacheLineSize>(ptr) &&
isAligned<MemoryConstants::cacheLineSize>(size);
}
bool isL3Capable(const NEO::GraphicsAllocation &graphicsAllocation) {
return isL3Capable(graphicsAllocation.getUnderlyingBuffer(), graphicsAllocation.getUnderlyingBufferSize());
}
void L1CachePolicy::init(const ProductHelper &helper) {
defaultDebuggerActive = helper.getL1CachePolicy(true);
defaultDebuggerInactive = helper.getL1CachePolicy(false);
}
} // namespace NEO