mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-07 12:42:54 +08:00
refactor: move CLOS-related steps from core- to product-helper
Future HW will not support cache reservation uniquely for the whole platform. Implementation of some functions may vary between products. Related-To: NEO-10158 Signed-off-by: Maciej Bielski <maciej.bielski@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
d483ee6396
commit
a4060013de
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2022-2023 Intel Corporation
|
||||
* Copyright (C) 2022-2024 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
@@ -32,4 +32,38 @@ bool ProductHelperHw<gfxProduct>::isNonBlockingGpuSubmissionSupported() const {
|
||||
return false;
|
||||
}
|
||||
|
||||
template <>
|
||||
uint32_t ProductHelperHw<gfxProduct>::getNumCacheRegions() const {
|
||||
constexpr uint32_t numSharedCacheRegions = 1;
|
||||
constexpr uint32_t numReservedCacheRegions = 2;
|
||||
constexpr uint32_t numTotalCacheRegions = numSharedCacheRegions + numReservedCacheRegions;
|
||||
return numTotalCacheRegions;
|
||||
}
|
||||
|
||||
template <>
|
||||
uint64_t ProductHelperHw<gfxProduct>::getPatIndex(CacheRegion cacheRegion, CachePolicy cachePolicy) const {
|
||||
/*
|
||||
PAT Index CLOS MemType
|
||||
SHARED
|
||||
0 0 UC (00)
|
||||
1 0 WC (01)
|
||||
2 0 WT (10)
|
||||
3 0 WB (11)
|
||||
RESERVED 1
|
||||
4 1 WT (10)
|
||||
5 1 WB (11)
|
||||
RESERVED 2
|
||||
6 2 WT (10)
|
||||
7 2 WB (11)
|
||||
*/
|
||||
|
||||
if ((debugManager.flags.ForceAllResourcesUncached.get() == true)) {
|
||||
cacheRegion = CacheRegion::defaultRegion;
|
||||
cachePolicy = CachePolicy::uncached;
|
||||
}
|
||||
|
||||
UNRECOVERABLE_IF((cacheRegion > CacheRegion::defaultRegion) && (cachePolicy < CachePolicy::writeThrough));
|
||||
return (static_cast<uint32_t>(cachePolicy) + (static_cast<uint16_t>(cacheRegion) * 2));
|
||||
}
|
||||
|
||||
} // namespace NEO
|
||||
|
||||
Reference in New Issue
Block a user