mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-05 18:06:32 +08:00
Revert "feature: bind resources as read only"
This reverts commit f3d36d3350.
Signed-off-by: Compute-Runtime-Validation <compute-runtime-validation@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
295b58a11f
commit
8e44a46983
@@ -560,34 +560,3 @@ TEST(GraphicsAllocationTest, givenGraphicsAllocationsWithFragmentsWhenCallingFor
|
||||
EXPECT_EQ(residencyData->getFenceValueForContextId(contextId), newFenceValue);
|
||||
}
|
||||
}
|
||||
TEST(GraphicsAllocationTest, givenGraphicsAllocationsWhenAllocationTypeIsKernelIsaThenAllocationHasReadonlyType) {
|
||||
MockGraphicsAllocation graphicsAllocation;
|
||||
graphicsAllocation.hasAllocationReadOnlyTypeCallBase = true;
|
||||
graphicsAllocation.allocationType = AllocationType::kernelIsa;
|
||||
EXPECT_TRUE(graphicsAllocation.hasAllocationReadOnlyType());
|
||||
}
|
||||
|
||||
TEST(GraphicsAllocationTest, givenGraphicsAllocationsWhenAllocationTypeIsInternalIsaThenAllocationHasReadonlyType) {
|
||||
MockGraphicsAllocation graphicsAllocation;
|
||||
graphicsAllocation.hasAllocationReadOnlyTypeCallBase = true;
|
||||
graphicsAllocation.allocationType = AllocationType::kernelIsaInternal;
|
||||
EXPECT_TRUE(graphicsAllocation.hasAllocationReadOnlyType());
|
||||
}
|
||||
TEST(GraphicsAllocationTest, givenGraphicsAllocationsWhenAllocationTypeIsCommandBufferThenAllocationHasReadonlyType) {
|
||||
MockGraphicsAllocation graphicsAllocation;
|
||||
graphicsAllocation.hasAllocationReadOnlyTypeCallBase = true;
|
||||
graphicsAllocation.allocationType = AllocationType::commandBuffer;
|
||||
EXPECT_TRUE(graphicsAllocation.hasAllocationReadOnlyType());
|
||||
}
|
||||
TEST(GraphicsAllocationTest, givenGraphicsAllocationsWhenAllocationTypeIsLinearStreamThenAllocationHasReadonlyType) {
|
||||
MockGraphicsAllocation graphicsAllocation;
|
||||
graphicsAllocation.hasAllocationReadOnlyTypeCallBase = true;
|
||||
graphicsAllocation.allocationType = AllocationType::linearStream;
|
||||
EXPECT_TRUE(graphicsAllocation.hasAllocationReadOnlyType());
|
||||
}
|
||||
TEST(GraphicsAllocationTest, givenGraphicsAllocationsWhenAllocationTypeIsBufferThenAllocationHasNotReadonlyType) {
|
||||
MockGraphicsAllocation graphicsAllocation;
|
||||
graphicsAllocation.hasAllocationReadOnlyTypeCallBase = true;
|
||||
graphicsAllocation.allocationType = AllocationType::buffer;
|
||||
EXPECT_FALSE(graphicsAllocation.hasAllocationReadOnlyType());
|
||||
}
|
||||
@@ -18,7 +18,6 @@
|
||||
#include "shared/test/common/mocks/mock_graphics_allocation.h"
|
||||
#include "shared/test/common/mocks/mock_memory_manager.h"
|
||||
#include "shared/test/common/mocks/mock_os_context.h"
|
||||
#include "shared/test/common/mocks/mock_product_helper.h"
|
||||
#include "shared/test/common/mocks/ult_device_factory.h"
|
||||
#include "shared/test/common/test_macros/hw_test.h"
|
||||
|
||||
@@ -1014,90 +1013,6 @@ TEST(MemoryManagerTest, givenPropertiesWithGpuAddressWhenGetAllocationDataIsCall
|
||||
EXPECT_EQ(properties.gpuAddress, allocData.gpuAddress);
|
||||
}
|
||||
|
||||
TEST(MemoryManagerTest, givenMemoryManagerWhenAllocationTypeAndPlatrormSupportReadOnlyAllocationAndBliterTransferNotRequiredThenAllocationIsSetAsReadOnly) {
|
||||
MockExecutionEnvironment executionEnvironment(defaultHwInfo.get());
|
||||
auto mockProductHelper = std::make_unique<MockProductHelper>();
|
||||
mockProductHelper->isBlitCopyRequiredForLocalMemoryResult = false;
|
||||
mockProductHelper->supportReadOnlyAllocationsResult = true;
|
||||
std::unique_ptr<ProductHelper> productHelper = std::move(mockProductHelper);
|
||||
std::swap(executionEnvironment.rootDeviceEnvironments[0]->productHelper, productHelper);
|
||||
MockMemoryManager memoryManager(false, true, executionEnvironment);
|
||||
MockGraphicsAllocation mockGa;
|
||||
|
||||
mockGa.hasAllocationReadOnlyTypeResult = true;
|
||||
|
||||
memoryManager.mockGa = &mockGa;
|
||||
memoryManager.returnMockGAFromDevicePool = true;
|
||||
|
||||
auto allocation = memoryManager.allocateGraphicsMemoryInPreferredPool({mockRootDeviceIndex, MemoryConstants::pageSize, AllocationType::buffer, mockDeviceBitfield},
|
||||
nullptr);
|
||||
EXPECT_EQ(allocation, &mockGa);
|
||||
EXPECT_EQ(mockGa.setAsReadOnlyCalled, 1u);
|
||||
}
|
||||
|
||||
TEST(MemoryManagerTest, givenMemoryManagerWhenAllocationTypeAndSupportReadOnlyButPtlatformDoesNotAndBliterTransferNotRequiredThenAllocationIsNotSetAsReadOnly) {
|
||||
MockExecutionEnvironment executionEnvironment(defaultHwInfo.get());
|
||||
auto mockProductHelper = std::make_unique<MockProductHelper>();
|
||||
mockProductHelper->isBlitCopyRequiredForLocalMemoryResult = false;
|
||||
mockProductHelper->supportReadOnlyAllocationsResult = false;
|
||||
std::unique_ptr<ProductHelper> productHelper = std::move(mockProductHelper);
|
||||
std::swap(executionEnvironment.rootDeviceEnvironments[0]->productHelper, productHelper);
|
||||
MockMemoryManager memoryManager(false, true, executionEnvironment);
|
||||
MockGraphicsAllocation mockGa;
|
||||
|
||||
mockGa.hasAllocationReadOnlyTypeResult = true;
|
||||
|
||||
memoryManager.mockGa = &mockGa;
|
||||
memoryManager.returnMockGAFromDevicePool = true;
|
||||
|
||||
auto allocation = memoryManager.allocateGraphicsMemoryInPreferredPool({mockRootDeviceIndex, MemoryConstants::pageSize, AllocationType::buffer, mockDeviceBitfield},
|
||||
nullptr);
|
||||
EXPECT_EQ(allocation, &mockGa);
|
||||
EXPECT_EQ(mockGa.setAsReadOnlyCalled, 0u);
|
||||
}
|
||||
|
||||
TEST(MemoryManagerTest, givenMemoryManagerWhenAllocationTypeAndPlatrormSupportReadOnlyAllocationAndBliterTransferRequiredThenAllocationIsNotSetAsReadOnly) {
|
||||
MockExecutionEnvironment executionEnvironment(defaultHwInfo.get());
|
||||
auto mockProductHelper = std::make_unique<MockProductHelper>();
|
||||
mockProductHelper->isBlitCopyRequiredForLocalMemoryResult = true;
|
||||
mockProductHelper->supportReadOnlyAllocationsResult = true;
|
||||
std::unique_ptr<ProductHelper> productHelper = std::move(mockProductHelper);
|
||||
std::swap(executionEnvironment.rootDeviceEnvironments[0]->productHelper, productHelper);
|
||||
MockMemoryManager memoryManager(false, true, executionEnvironment);
|
||||
MockGraphicsAllocation mockGa;
|
||||
|
||||
mockGa.hasAllocationReadOnlyTypeResult = true;
|
||||
|
||||
memoryManager.mockGa = &mockGa;
|
||||
memoryManager.returnMockGAFromDevicePool = true;
|
||||
|
||||
auto allocation = memoryManager.allocateGraphicsMemoryInPreferredPool({mockRootDeviceIndex, MemoryConstants::pageSize, AllocationType::buffer, mockDeviceBitfield},
|
||||
nullptr);
|
||||
EXPECT_EQ(allocation, &mockGa);
|
||||
EXPECT_EQ(mockGa.setAsReadOnlyCalled, 0u);
|
||||
}
|
||||
|
||||
TEST(MemoryManagerTest, givenMemoryManagerWhenAllocationTypeAndDoesNotSupportReadOnlyButPtlatformDoesAndBliterTransferNotRequiredThenAllocationIsNotSetAsReadOnly) {
|
||||
MockExecutionEnvironment executionEnvironment(defaultHwInfo.get());
|
||||
auto mockProductHelper = std::make_unique<MockProductHelper>();
|
||||
mockProductHelper->isBlitCopyRequiredForLocalMemoryResult = false;
|
||||
mockProductHelper->supportReadOnlyAllocationsResult = true;
|
||||
std::unique_ptr<ProductHelper> productHelper = std::move(mockProductHelper);
|
||||
std::swap(executionEnvironment.rootDeviceEnvironments[0]->productHelper, productHelper);
|
||||
MockMemoryManager memoryManager(false, true, executionEnvironment);
|
||||
MockGraphicsAllocation mockGa;
|
||||
|
||||
mockGa.hasAllocationReadOnlyTypeResult = false;
|
||||
|
||||
memoryManager.mockGa = &mockGa;
|
||||
memoryManager.returnMockGAFromDevicePool = true;
|
||||
|
||||
auto allocation = memoryManager.allocateGraphicsMemoryInPreferredPool({mockRootDeviceIndex, MemoryConstants::pageSize, AllocationType::buffer, mockDeviceBitfield},
|
||||
nullptr);
|
||||
EXPECT_EQ(allocation, &mockGa);
|
||||
EXPECT_EQ(mockGa.setAsReadOnlyCalled, 0u);
|
||||
}
|
||||
|
||||
TEST(MemoryManagerTest, givenEnableLocalMemoryAndMemoryManagerWhenBufferTypeIsPassedThenAllocateGraphicsMemoryInPreferredPool) {
|
||||
MockExecutionEnvironment executionEnvironment(defaultHwInfo.get());
|
||||
MockMemoryManager memoryManager(false, true, executionEnvironment);
|
||||
|
||||
Reference in New Issue
Block a user