Move AllocationType enum out of GraphicsAllocation class

Signed-off-by: Bartosz Dunajski <bartosz.dunajski@intel.com>
This commit is contained in:
Bartosz Dunajski
2022-02-04 13:59:01 +00:00
committed by Compute-Runtime-Automation
parent fd27098194
commit 4b0d986876
262 changed files with 2075 additions and 2063 deletions

View File

@ -1,5 +1,5 @@
/*
* Copyright (C) 2020-2021 Intel Corporation
* Copyright (C) 2020-2022 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
@ -73,7 +73,7 @@ GEN12LPTEST_F(BufferTestsTgllp, givenConstantSurfaceWhenProgrammingSurfaceStateT
nullptr,
retVal));
ASSERT_EQ(CL_SUCCESS, retVal);
buffer->getGraphicsAllocation(0)->setAllocationType(GraphicsAllocation::AllocationType::CONSTANT_SURFACE);
buffer->getGraphicsAllocation(0)->setAllocationType(AllocationType::CONSTANT_SURFACE);
typename FamilyType::RENDER_SURFACE_STATE surfaceState = {};
buffer->setArgStateful(&surfaceState, false, false, false, false, context->getDevice(0)->getDevice(), false, false);

View File

@ -1,5 +1,5 @@
/*
* Copyright (C) 2019-2021 Intel Corporation
* Copyright (C) 2019-2022 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
@ -46,7 +46,7 @@ struct Gen12LpCoherencyRequirements : public ::testing::Test {
device.reset(MockDevice::createWithNewExecutionEnvironment<MockDevice>(defaultHwInfo.get()));
csr = new myCsr(*device->executionEnvironment);
device->resetCommandStreamReceiver(csr);
AllocationProperties properties(device->getRootDeviceIndex(), false, MemoryConstants::pageSize, GraphicsAllocation::AllocationType::SHARED_BUFFER, false, {});
AllocationProperties properties(device->getRootDeviceIndex(), false, MemoryConstants::pageSize, AllocationType::SHARED_BUFFER, false, {});
alloc = device->getMemoryManager()->createGraphicsAllocationFromSharedHandle(static_cast<osHandle>(123), properties, false, false);
}

View File

@ -59,7 +59,7 @@ DG1TEST_F(HwHelperTestDg1, givenBufferAllocationTypeWhenSetExtraAllocationDataIs
auto &hwHelper = HwHelper::get(renderCoreFamily);
AllocationData allocData{};
allocData.flags.useSystemMemory = true;
AllocationProperties allocProperties(0, 1, GraphicsAllocation::AllocationType::BUFFER, {});
AllocationProperties allocProperties(0, 1, AllocationType::BUFFER, {});
allocData.storageInfo.isLockable = false;
allocProperties.flags.shareable = false;
hwHelper.setExtraAllocationData(allocData, allocProperties, *defaultHwInfo);
@ -70,7 +70,7 @@ DG1TEST_F(HwHelperTestDg1, givenBufferAllocationTypeWhenSetExtraAllocationDataIs
auto &hwHelper = HwHelper::get(renderCoreFamily);
AllocationData allocData{};
allocData.flags.useSystemMemory = true;
AllocationProperties allocProperties(0, 1, GraphicsAllocation::AllocationType::BUFFER, {});
AllocationProperties allocProperties(0, 1, AllocationType::BUFFER, {});
allocData.storageInfo.isLockable = false;
allocProperties.flags.shareable = true;
hwHelper.setExtraAllocationData(allocData, allocProperties, *defaultHwInfo);

View File

@ -1,5 +1,5 @@
/*
* Copyright (C) 2019-2021 Intel Corporation
* Copyright (C) 2019-2022 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
@ -230,7 +230,7 @@ GEN12LPTEST_F(HwHelperTestsGen12LpBuffer, givenBufferThenCheckResourceCompatibil
buffer.reset(Buffer::create(context.get(), 0, MemoryConstants::cacheLineSize, nullptr, retVal));
buffer->getGraphicsAllocation(rootDeviceIndex)->setAllocationType(GraphicsAllocation::AllocationType::BUFFER);
buffer->getGraphicsAllocation(rootDeviceIndex)->setAllocationType(AllocationType::BUFFER);
EXPECT_TRUE(helper.checkResourceCompatibility(*buffer->getGraphicsAllocation(rootDeviceIndex)));
}
@ -326,17 +326,17 @@ GEN12LPTEST_F(HwHelperTestGen12Lp, givenAllocationTypeWithCpuAccessRequiredWhenC
DebugManagerStateRestore restore;
DebugManager.flags.ForceLocalMemoryAccessMode.set(static_cast<int32_t>(LocalMemoryAccessMode::CpuAccessDisallowed));
const GraphicsAllocation::AllocationType allocationTypesToUseSystemMemory[] = {
GraphicsAllocation::AllocationType::COMMAND_BUFFER,
GraphicsAllocation::AllocationType::CONSTANT_SURFACE,
GraphicsAllocation::AllocationType::GLOBAL_SURFACE,
GraphicsAllocation::AllocationType::INTERNAL_HEAP,
GraphicsAllocation::AllocationType::LINEAR_STREAM,
GraphicsAllocation::AllocationType::PIPE,
GraphicsAllocation::AllocationType::PRINTF_SURFACE,
GraphicsAllocation::AllocationType::TIMESTAMP_PACKET_TAG_BUFFER,
GraphicsAllocation::AllocationType::RING_BUFFER,
GraphicsAllocation::AllocationType::SEMAPHORE_BUFFER};
const AllocationType allocationTypesToUseSystemMemory[] = {
AllocationType::COMMAND_BUFFER,
AllocationType::CONSTANT_SURFACE,
AllocationType::GLOBAL_SURFACE,
AllocationType::INTERNAL_HEAP,
AllocationType::LINEAR_STREAM,
AllocationType::PIPE,
AllocationType::PRINTF_SURFACE,
AllocationType::TIMESTAMP_PACKET_TAG_BUFFER,
AllocationType::RING_BUFFER,
AllocationType::SEMAPHORE_BUFFER};
MockMemoryManager mockMemoryManager;
for (auto allocationType : allocationTypesToUseSystemMemory) {
@ -349,7 +349,7 @@ GEN12LPTEST_F(HwHelperTestGen12Lp, givenAllocationTypeWithCpuAccessRequiredWhenC
}
AllocationData allocData{};
AllocationProperties properties(mockRootDeviceIndex, true, 10, GraphicsAllocation::AllocationType::BUFFER, false, mockDeviceBitfield);
AllocationProperties properties(mockRootDeviceIndex, true, 10, AllocationType::BUFFER, false, mockDeviceBitfield);
mockMemoryManager.getAllocationData(allocData, properties, nullptr, mockMemoryManager.createStorageInfoFromProperties(properties));
EXPECT_FALSE(allocData.flags.requiresCpuAccess);
EXPECT_FALSE(allocData.flags.useSystemMemory);

View File

@ -1,5 +1,5 @@
/*
* Copyright (C) 2020-2021 Intel Corporation
* Copyright (C) 2020-2022 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
@ -70,7 +70,7 @@ GEN12LPTEST_F(BufferTestsTgllp, givenConstantSurfaceWhenProgrammingSurfaceStateT
nullptr,
retVal));
ASSERT_EQ(CL_SUCCESS, retVal);
buffer->getGraphicsAllocation(0)->setAllocationType(GraphicsAllocation::AllocationType::CONSTANT_SURFACE);
buffer->getGraphicsAllocation(0)->setAllocationType(AllocationType::CONSTANT_SURFACE);
typename FamilyType::RENDER_SURFACE_STATE surfaceState = {};
buffer->setArgStateful(&surfaceState, false, false, false, false, context->getDevice(0)->getDevice(), false, 1u);