mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-07 04:48:08 +08:00
refactor: use level-specific name for CacheInfo instances
Related-To: NEO-12837 Signed-off-by: Maciej Bielski <maciej.bielski@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
5f8e761541
commit
1fafd44af5
@@ -26,7 +26,6 @@ class DrmMock : public Drm {
|
||||
public:
|
||||
using Drm::adapterBDF;
|
||||
using Drm::bindAvailable;
|
||||
using Drm::cacheInfo;
|
||||
using Drm::checkQueueSliceSupport;
|
||||
using Drm::chunkingAvailable;
|
||||
using Drm::chunkingMode;
|
||||
@@ -39,6 +38,7 @@ class DrmMock : public Drm {
|
||||
using Drm::generateUUID;
|
||||
using Drm::getQueueSliceCount;
|
||||
using Drm::ioctlHelper;
|
||||
using Drm::l3CacheInfo;
|
||||
using Drm::memoryInfo;
|
||||
using Drm::memoryInfoQueried;
|
||||
using Drm::minimalChunkingSize;
|
||||
|
||||
@@ -27,7 +27,7 @@ class DrmQueryMock : public DrmMock {
|
||||
DrmMockPrelimContext context{
|
||||
nullptr,
|
||||
rootDeviceEnvironment,
|
||||
getCacheInfo(),
|
||||
getL3CacheInfo(),
|
||||
failRetTopology,
|
||||
supportedCopyEnginesMask,
|
||||
contextDebugSupported,
|
||||
|
||||
@@ -104,11 +104,11 @@ struct DrmMockCustom : public Drm {
|
||||
static std::unique_ptr<DrmMockCustom> create(std::unique_ptr<HwDeviceIdDrm> &&hwDeviceId, RootDeviceEnvironment &rootDeviceEnvironment);
|
||||
|
||||
using Drm::bindAvailable;
|
||||
using Drm::cacheInfo;
|
||||
using Drm::checkToDisableScratchPage;
|
||||
using Drm::completionFenceSupported;
|
||||
using Drm::disableScratch;
|
||||
using Drm::ioctlHelper;
|
||||
using Drm::l3CacheInfo;
|
||||
using Drm::memoryInfo;
|
||||
using Drm::pageFaultSupported;
|
||||
using Drm::queryTopology;
|
||||
|
||||
@@ -12,8 +12,8 @@
|
||||
#include "shared/test/common/os_interface/linux/device_command_stream_fixture_context.h"
|
||||
|
||||
struct DrmMockCustomPrelim : public DrmMockCustom {
|
||||
using Drm::cacheInfo;
|
||||
using Drm::ioctlHelper;
|
||||
using Drm::l3CacheInfo;
|
||||
using Drm::memoryInfo;
|
||||
|
||||
static auto create(RootDeviceEnvironment &rootDeviceEnvironment) {
|
||||
|
||||
@@ -124,7 +124,7 @@ int DrmMockExtended::handleRemainingRequests(DrmIoctl request, void *arg) {
|
||||
if (cacheReserveArg->clos_index > closIndex) {
|
||||
return EINVAL;
|
||||
}
|
||||
auto cacheInfo = this->getCacheInfo();
|
||||
auto cacheInfo = this->getL3CacheInfo();
|
||||
auto maxReservationNumWays = cacheInfo ? cacheInfo->getMaxReservationNumWays() : maxNumWays;
|
||||
if (cacheReserveArg->num_ways > maxReservationNumWays) {
|
||||
return EINVAL;
|
||||
|
||||
@@ -25,9 +25,9 @@ using namespace NEO;
|
||||
|
||||
class DrmMockExtended : public DrmMock {
|
||||
public:
|
||||
using Drm::cacheInfo;
|
||||
using Drm::engineInfo;
|
||||
using Drm::ioctlHelper;
|
||||
using Drm::l3CacheInfo;
|
||||
using Drm::memoryInfo;
|
||||
using Drm::pageFaultSupported;
|
||||
using Drm::rootDeviceEnvironment;
|
||||
|
||||
@@ -26,7 +26,7 @@ TEST(DrmCacheInfoTest, givenCacheRegionsExistsWhenCallingSetUpCacheInfoThenCache
|
||||
|
||||
drm.setupCacheInfo(*defaultHwInfo.get());
|
||||
|
||||
auto cacheInfo = drm.getCacheInfo();
|
||||
auto cacheInfo = drm.getL3CacheInfo();
|
||||
EXPECT_NE(nullptr, cacheInfo);
|
||||
|
||||
if (productHelper.getNumCacheRegions() == 0) {
|
||||
@@ -56,8 +56,8 @@ TEST(DrmCacheInfoTest, givenDebugFlagSetWhenCallingSetUpCacheInfoThenCacheInfoIs
|
||||
DrmQueryMock drm(*executionEnvironment->rootDeviceEnvironments[0]);
|
||||
|
||||
drm.setupCacheInfo(*defaultHwInfo.get());
|
||||
EXPECT_NE(nullptr, drm.getCacheInfo());
|
||||
auto cacheInfo = drm.getCacheInfo();
|
||||
EXPECT_NE(nullptr, drm.getL3CacheInfo());
|
||||
auto cacheInfo = drm.getL3CacheInfo();
|
||||
|
||||
EXPECT_EQ(0u, cacheInfo->getMaxReservationCacheSize());
|
||||
EXPECT_EQ(0u, cacheInfo->getMaxReservationNumCacheRegions());
|
||||
|
||||
@@ -4916,7 +4916,7 @@ TEST_F(DrmAllocationTests, givenDrmAllocationWhenDefaultCacheInfoIsAvailableThen
|
||||
TEST_F(DrmAllocationTests, givenDrmAllocationWhenCacheRegionIsNotSetThenReturnFalse) {
|
||||
const uint32_t rootDeviceIndex = 0u;
|
||||
DrmMock drm(*executionEnvironment->rootDeviceEnvironments[rootDeviceIndex]);
|
||||
drm.cacheInfo.reset(new MockCacheInfo(*drm.getIoctlHelper(), 32 * MemoryConstants::kiloByte, 2, 32));
|
||||
drm.l3CacheInfo.reset(new MockCacheInfo(*drm.getIoctlHelper(), 32 * MemoryConstants::kiloByte, 2, 32));
|
||||
|
||||
MockDrmAllocation allocation(rootDeviceIndex, AllocationType::buffer, MemoryPool::localMemory);
|
||||
|
||||
@@ -4927,7 +4927,7 @@ TEST_F(DrmAllocationTests, givenDrmAllocationWhenCacheRegionIsSetSuccessfullyThe
|
||||
const uint32_t rootDeviceIndex = 0u;
|
||||
DrmMock drm(*executionEnvironment->rootDeviceEnvironments[rootDeviceIndex]);
|
||||
drm.queryAndSetVmBindPatIndexProgrammingSupport();
|
||||
drm.cacheInfo.reset(new MockCacheInfo(*drm.getIoctlHelper(), 32 * MemoryConstants::kiloByte, 2, 32));
|
||||
drm.l3CacheInfo.reset(new MockCacheInfo(*drm.getIoctlHelper(), 32 * MemoryConstants::kiloByte, 2, 32));
|
||||
|
||||
MockDrmAllocation allocation(rootDeviceIndex, AllocationType::buffer, MemoryPool::localMemory);
|
||||
auto &productHelper = executionEnvironment->rootDeviceEnvironments[0]->getHelper<ProductHelper>();
|
||||
@@ -4944,7 +4944,7 @@ TEST_F(DrmAllocationTests, givenDrmAllocationWhenCacheRegionIsSetSuccessfullyThe
|
||||
const uint32_t rootDeviceIndex = 0u;
|
||||
DrmMock drm(*executionEnvironment->rootDeviceEnvironments[rootDeviceIndex]);
|
||||
drm.queryAndSetVmBindPatIndexProgrammingSupport();
|
||||
drm.cacheInfo.reset(new MockCacheInfo(*drm.getIoctlHelper(), 32 * MemoryConstants::kiloByte, 2, 32));
|
||||
drm.l3CacheInfo.reset(new MockCacheInfo(*drm.getIoctlHelper(), 32 * MemoryConstants::kiloByte, 2, 32));
|
||||
|
||||
MockBufferObject bo(rootDeviceIndex, &drm, 3, 0, 0, 1);
|
||||
MockDrmAllocation allocation(rootDeviceIndex, AllocationType::buffer, MemoryPool::localMemory);
|
||||
@@ -5100,7 +5100,7 @@ TEST_F(DrmMemoryManagerTest, givenDrmAllocationWithHostPtrWhenItIsCreatedWithCac
|
||||
}
|
||||
mock->ioctlExpected.total = -1;
|
||||
auto drm = static_cast<DrmMockCustom *>(executionEnvironment->rootDeviceEnvironments[rootDeviceIndex]->osInterface->getDriverModel()->as<Drm>());
|
||||
drm->cacheInfo.reset(new MockCacheInfo(*drm->getIoctlHelper(), 32 * MemoryConstants::kiloByte, 2, 32));
|
||||
drm->l3CacheInfo.reset(new MockCacheInfo(*drm->getIoctlHelper(), 32 * MemoryConstants::kiloByte, 2, 32));
|
||||
|
||||
auto ptr = reinterpret_cast<void *>(0x1000);
|
||||
auto size = MemoryConstants::pageSize;
|
||||
@@ -6161,7 +6161,7 @@ TEST_F(DrmMemoryManagerWithLocalMemoryAndExplicitExpectationsTest, givenUAllocat
|
||||
allocData.cacheRegion = 0xFFFF;
|
||||
|
||||
auto &drm = static_cast<DrmMockCustom &>(memoryManager->getDrm(0));
|
||||
drm.cacheInfo.reset(nullptr);
|
||||
drm.l3CacheInfo.reset(nullptr);
|
||||
|
||||
auto allocation = memoryManager->allocatePhysicalLocalDeviceMemory(allocData, status);
|
||||
EXPECT_EQ(nullptr, allocation);
|
||||
|
||||
@@ -1294,7 +1294,7 @@ TEST_F(DrmMemoryOperationsHandlerBindTest, givenClosEnabledAndAllocationToBeCach
|
||||
auto osContext = memoryManager->createAndRegisterOsContext(csr.get(), EngineDescriptorHelper::getDefaultDescriptor());
|
||||
csr->setupContext(*osContext);
|
||||
|
||||
mock->cacheInfo.reset(new CacheInfo(*mock->getIoctlHelper(), 64 * MemoryConstants::kiloByte, 2, 32));
|
||||
mock->l3CacheInfo.reset(new CacheInfo(*mock->getIoctlHelper(), 64 * MemoryConstants::kiloByte, 2, 32));
|
||||
|
||||
auto &productHelper = executionEnvironment->rootDeviceEnvironments[0]->getHelper<ProductHelper>();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user