mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-24 12:23:05 +08:00
Related-To: NEO-7003 Add L1CachePolicyHelper struct. This struct is resposible for L1 cache policy in build option, Surface State and stateless caching. Currently default option for all platforms is WBP (write by-pass) Signed-off-by: Szymon Morek <szymon.morek@intel.com>
39 lines
915 B
C++
39 lines
915 B
C++
/*
|
|
* Copyright (C) 2018-2022 Intel Corporation
|
|
*
|
|
* SPDX-License-Identifier: MIT
|
|
*
|
|
*/
|
|
|
|
#pragma once
|
|
#include "shared/source/debug_settings/debug_settings_manager.h"
|
|
|
|
#include "igfxfmid.h"
|
|
|
|
#include <cstdint>
|
|
#include <stddef.h>
|
|
|
|
namespace NEO {
|
|
class GraphicsAllocation;
|
|
bool isL3Capable(void *ptr, size_t size);
|
|
bool isL3Capable(const GraphicsAllocation &graphicsAllocation);
|
|
|
|
template <PRODUCT_FAMILY gfxProduct>
|
|
struct L1CachePolicyHelper {
|
|
|
|
static const char *getCachingPolicyOptions();
|
|
|
|
static uint32_t getDefaultL1CachePolicy() {
|
|
return 0;
|
|
}
|
|
|
|
static uint32_t getL1CachePolicy() {
|
|
if (DebugManager.flags.OverrideL1CachePolicyInSurfaceStateAndStateless.get() != -1) {
|
|
return DebugManager.flags.OverrideL1CachePolicyInSurfaceStateAndStateless.get();
|
|
}
|
|
return L1CachePolicyHelper<gfxProduct>::getDefaultL1CachePolicy();
|
|
}
|
|
};
|
|
|
|
} // namespace NEO
|