Revert "Add support for USM shared in WSL for dGPU"

This reverts commit 68d0523ccf.

Signed-off-by: Compute-Runtime-Validation <compute-runtime-validation@intel.com>
This commit is contained in:
Compute-Runtime-Validation
2022-10-19 04:32:57 +02:00
committed by Compute-Runtime-Automation
parent fb453f5190
commit e744116bbb
5 changed files with 4 additions and 135 deletions

View File

@@ -24,7 +24,6 @@ if(WIN32)
${CMAKE_CURRENT_SOURCE_DIR}/wddm_address_space_tests.cpp
${CMAKE_CURRENT_SOURCE_DIR}/wddm_command_stream_l0_tests.cpp
${CMAKE_CURRENT_SOURCE_DIR}/wddm_mapper_tests.cpp
${CMAKE_CURRENT_SOURCE_DIR}/wddm_memory_manager_test.cpp
${CMAKE_CURRENT_SOURCE_DIR}/wddm_preemption_tests.cpp
${CMAKE_CURRENT_SOURCE_DIR}/wddm_shared_allocations_test.cpp
${CMAKE_CURRENT_SOURCE_DIR}/wddm_special_heap_test.cpp

View File

@@ -874,7 +874,7 @@ HWTEST_TEMPLATED_F(WddmCommandStreamMockGdiTest, WhenMakingResidentThenResidency
HWTEST_TEMPLATED_F(WddmCommandStreamMockGdiTest, givenRecordedCommandBufferWhenItIsSubmittedThenFlushTaskIsProperlyCalled) {
auto mockCsr = static_cast<MockWddmCsr<FamilyType> *>(csr);
// preemption allocation + sip allocation
//preemption allocation + sip allocation
size_t csrSurfaceCount = 0;
if (device->getPreemptionMode() == PreemptionMode::MidThread) {
csrSurfaceCount = 2;
@@ -961,7 +961,6 @@ HWTEST_TEMPLATED_F(WddmCommandStreamMockGdiTest, givenRecordedCommandBufferWhenI
using WddmSimpleTest = ::testing::Test;
HWTEST_F(WddmSimpleTest, givenDefaultWddmCsrWhenItIsCreatedThenBatchingIsTurnedOn) {
DebugManagerStateRestore stateRestore;
DebugManager.flags.CsrDispatchMode.set(0);
HardwareInfo *hwInfo = nullptr;
ExecutionEnvironment *executionEnvironment = getExecutionEnvironmentImpl(hwInfo, 1);

View File

@@ -1,129 +0,0 @@
/*
* Copyright (C) 2022 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
*/
#include "shared/test/common/helpers/execution_environment_helper.h"
#include "shared/test/common/mocks/mock_device.h"
#include "shared/test/common/mocks/mock_memory_manager.h"
#include "shared/test/common/os_interface/windows/mock_wddm_memory_manager.h"
#include "shared/test/common/os_interface/windows/wddm_fixture.h"
using namespace NEO;
using namespace ::testing;
class MockAllocateGraphicsMemoryWithAlignmentWddm : public MemoryManagerCreate<WddmMemoryManager> {
public:
using WddmMemoryManager::allocateGraphicsMemoryWithAlignment;
MockAllocateGraphicsMemoryWithAlignmentWddm(ExecutionEnvironment &executionEnvironment) : MemoryManagerCreate(false, false, executionEnvironment) {}
bool allocateSystemMemoryAndCreateGraphicsAllocationFromItCalled = false;
bool allocateGraphicsMemoryUsingKmdAndMapItToCpuVACalled = false;
bool mapGpuVirtualAddressWithCpuPtr = false;
GraphicsAllocation *allocateSystemMemoryAndCreateGraphicsAllocationFromIt(const AllocationData &allocationData) override {
allocateSystemMemoryAndCreateGraphicsAllocationFromItCalled = true;
return nullptr;
}
GraphicsAllocation *allocateGraphicsMemoryUsingKmdAndMapItToCpuVA(const AllocationData &allocationData, bool allowLargePages) override {
allocateGraphicsMemoryUsingKmdAndMapItToCpuVACalled = true;
return nullptr;
}
bool mapGpuVirtualAddress(WddmAllocation *graphicsAllocation, const void *requiredGpuPtr) override {
if (requiredGpuPtr != nullptr) {
mapGpuVirtualAddressWithCpuPtr = true;
} else {
mapGpuVirtualAddressWithCpuPtr = false;
}
return true;
}
};
class WddmMemoryManagerTests : public ::testing::Test {
public:
MockAllocateGraphicsMemoryWithAlignmentWddm *memoryManager = nullptr;
WddmMock *wddm = nullptr;
ExecutionEnvironment *executionEnvironment = nullptr;
void SetUp() override {
HardwareInfo *hwInfo = nullptr;
executionEnvironment = getExecutionEnvironmentImpl(hwInfo, 1);
memoryManager = new MockAllocateGraphicsMemoryWithAlignmentWddm(*executionEnvironment);
executionEnvironment->memoryManager.reset(memoryManager);
wddm = static_cast<WddmMock *>(executionEnvironment->rootDeviceEnvironments[0]->osInterface->getDriverModel()->as<Wddm>());
}
void TearDown() override {
delete executionEnvironment;
}
};
TEST_F(WddmMemoryManagerTests, GivenAllocDataWithSVMCPUSetWhenAllocateGraphicsMemoryWithAlignmentThenProperFunctionIsUsed) {
NEO::AllocationData allocData = {};
allocData.type = NEO::AllocationType::SVM_CPU;
memoryManager->allocateGraphicsMemoryWithAlignment(allocData);
if (preferredAllocationMethod == GfxMemoryAllocationMethod::AllocateByKmd) {
EXPECT_TRUE(memoryManager->allocateGraphicsMemoryUsingKmdAndMapItToCpuVACalled);
} else {
EXPECT_TRUE(memoryManager->allocateSystemMemoryAndCreateGraphicsAllocationFromItCalled);
}
}
class MockAllocateGraphicsMemoryUsingKmdAndMapItToCpuVAWddm : public MemoryManagerCreate<WddmMemoryManager> {
public:
using WddmMemoryManager::allocateGraphicsMemoryUsingKmdAndMapItToCpuVA;
using WddmMemoryManager::mapGpuVirtualAddress;
MockAllocateGraphicsMemoryUsingKmdAndMapItToCpuVAWddm(ExecutionEnvironment &executionEnvironment) : MemoryManagerCreate(false, false, executionEnvironment) {}
bool mapGpuVirtualAddressWithCpuPtr = false;
bool mapGpuVirtualAddress(WddmAllocation *graphicsAllocation, const void *requiredGpuPtr) override {
if (requiredGpuPtr != nullptr) {
mapGpuVirtualAddressWithCpuPtr = true;
} else {
mapGpuVirtualAddressWithCpuPtr = false;
}
return true;
}
};
class WddmMemoryManagerAllocPathTests : public ::testing::Test {
public:
MockAllocateGraphicsMemoryUsingKmdAndMapItToCpuVAWddm *memoryManager = nullptr;
WddmMock *wddm = nullptr;
ExecutionEnvironment *executionEnvironment = nullptr;
void SetUp() override {
HardwareInfo *hwInfo = nullptr;
executionEnvironment = getExecutionEnvironmentImpl(hwInfo, 1);
memoryManager = new MockAllocateGraphicsMemoryUsingKmdAndMapItToCpuVAWddm(*executionEnvironment);
executionEnvironment->memoryManager.reset(memoryManager);
wddm = static_cast<WddmMock *>(executionEnvironment->rootDeviceEnvironments[0]->osInterface->getDriverModel()->as<Wddm>());
}
void TearDown() override {
delete executionEnvironment;
}
};
TEST_F(WddmMemoryManagerAllocPathTests, givenAllocateGraphicsMemoryUsingKmdAndMapItToCpuVAWhenPreferedAllocationMethodThenProperArgumentsAreSet) {
NEO::AllocationData allocData = {};
allocData.type = NEO::AllocationType::SVM_CPU;
auto graphicsAllocation = memoryManager->allocateGraphicsMemoryUsingKmdAndMapItToCpuVA(allocData, false);
if (preferredAllocationMethod == GfxMemoryAllocationMethod::AllocateByKmd) {
EXPECT_FALSE(memoryManager->mapGpuVirtualAddressWithCpuPtr);
} else {
EXPECT_TRUE(memoryManager->mapGpuVirtualAddressWithCpuPtr);
}
memoryManager->freeGraphicsMemory(graphicsAllocation);
}