2017-12-21 07:45:38 +08:00
|
|
|
/*
|
2022-06-27 22:58:29 +08:00
|
|
|
* Copyright (C) 2018-2022 Intel Corporation
|
2017-12-21 07:45:38 +08:00
|
|
|
*
|
2018-09-18 15:11:08 +08:00
|
|
|
* SPDX-License-Identifier: MIT
|
2017-12-21 07:45:38 +08:00
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#pragma once
|
2022-06-27 22:58:29 +08:00
|
|
|
#include "shared/source/debug_settings/debug_settings_manager.h"
|
2017-12-21 07:45:38 +08:00
|
|
|
|
2022-06-27 22:58:29 +08:00
|
|
|
#include "igfxfmid.h"
|
|
|
|
|
|
|
|
#include <cstdint>
|
|
|
|
#include <stddef.h>
|
2017-12-21 07:45:38 +08:00
|
|
|
|
2019-03-26 18:59:46 +08:00
|
|
|
namespace NEO {
|
2019-02-27 21:52:10 +08:00
|
|
|
class GraphicsAllocation;
|
|
|
|
bool isL3Capable(void *ptr, size_t size);
|
|
|
|
bool isL3Capable(const GraphicsAllocation &graphicsAllocation);
|
2022-06-27 22:58:29 +08:00
|
|
|
|
|
|
|
template <PRODUCT_FAMILY gfxProduct>
|
|
|
|
struct L1CachePolicyHelper {
|
2022-07-28 12:53:44 +08:00
|
|
|
|
2022-06-27 22:58:29 +08:00
|
|
|
static const char *getCachingPolicyOptions();
|
|
|
|
|
2022-07-28 12:53:44 +08:00
|
|
|
static uint32_t getDefaultL1CachePolicy() {
|
|
|
|
return 0u;
|
|
|
|
}
|
2022-06-27 22:58:29 +08:00
|
|
|
|
2022-07-28 12:53:44 +08:00
|
|
|
static uint32_t getL1CachePolicy() {
|
|
|
|
if (DebugManager.flags.OverrideL1CachePolicyInSurfaceStateAndStateless.get() != -1) {
|
|
|
|
return DebugManager.flags.OverrideL1CachePolicyInSurfaceStateAndStateless.get();
|
|
|
|
}
|
|
|
|
return L1CachePolicyHelper<gfxProduct>::getDefaultL1CachePolicy();
|
|
|
|
}
|
2022-06-27 22:58:29 +08:00
|
|
|
};
|
|
|
|
|
2019-03-26 18:59:46 +08:00
|
|
|
} // namespace NEO
|