mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-05 09:09:04 +08:00
Add allocation types for MCS, preemption and shared context image
Related-To: NEO-2733 Change-Id: I3e3e4ea6d4fe084c8c32c0e24c537c9131ce1e60 Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
This commit is contained in:
committed by
sys_ocldev
parent
c5274c5087
commit
1d42fe169a
@@ -368,6 +368,24 @@ TEST(MemoryManagerTest, givenTagBufferTypeWhenGetAllocationDataIsCalledThenSyste
|
||||
EXPECT_TRUE(allocData.flags.useSystemMemory);
|
||||
}
|
||||
|
||||
TEST(MemoryManagerTest, givenPreemptionTypeWhenGetAllocationDataIsCalledThenSystemMemoryIsRequested) {
|
||||
AllocationData allocData;
|
||||
MockMemoryManager::getAllocationData(allocData, {1, GraphicsAllocation::AllocationType::PREEMPTION}, {}, nullptr);
|
||||
EXPECT_TRUE(allocData.flags.useSystemMemory);
|
||||
}
|
||||
|
||||
TEST(MemoryManagerTest, givenSharedContextImageTypeWhenGetAllocationDataIsCalledThenSystemMemoryIsRequested) {
|
||||
AllocationData allocData;
|
||||
MockMemoryManager::getAllocationData(allocData, {1, GraphicsAllocation::AllocationType::SHARED_CONTEXT_IMAGE}, {}, nullptr);
|
||||
EXPECT_TRUE(allocData.flags.useSystemMemory);
|
||||
}
|
||||
|
||||
TEST(MemoryManagerTest, givenMCSTypeWhenGetAllocationDataIsCalledThenSystemMemoryIsRequested) {
|
||||
AllocationData allocData;
|
||||
MockMemoryManager::getAllocationData(allocData, {1, GraphicsAllocation::AllocationType::MCS}, {}, nullptr);
|
||||
EXPECT_TRUE(allocData.flags.useSystemMemory);
|
||||
}
|
||||
|
||||
TEST(MemoryManagerTest, givenDeviceQueueBufferTypeWhenGetAllocationDataIsCalledThenSystemMemoryIsRequested) {
|
||||
AllocationData allocData;
|
||||
MockMemoryManager::getAllocationData(allocData, {1, GraphicsAllocation::AllocationType::DEVICE_QUEUE_BUFFER}, {}, nullptr);
|
||||
|
||||
@@ -102,10 +102,7 @@ class MockDevice : public Device {
|
||||
void allocatePreemptionAllocationIfNotPresent() {
|
||||
if (this->preemptionAllocation == nullptr) {
|
||||
if (preemptionMode == PreemptionMode::MidThread || isSourceLevelDebuggerActive()) {
|
||||
MockAllocationProperties allocationProperties(hwInfo.capabilityTable.requiredPreemptionSurfaceSize);
|
||||
allocationProperties.flags.uncacheable = getWaTable()->waCSRUncachable;
|
||||
allocationProperties.alignment = 256 * MemoryConstants::kiloByte;
|
||||
this->preemptionAllocation = executionEnvironment->memoryManager->allocateGraphicsMemoryWithProperties(allocationProperties);
|
||||
this->preemptionAllocation = executionEnvironment->memoryManager->allocateGraphicsMemoryWithProperties(getAllocationPropertiesForPreemption());
|
||||
this->engines[defaultEngineIndex].commandStreamReceiver->setPreemptionCsrAllocation(preemptionAllocation);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -908,12 +908,15 @@ AllocationTypeTestCase allocationTypeValues[] = {
|
||||
{GraphicsAllocation::AllocationType::INTERNAL_HOST_MEMORY, "INTERNAL_HOST_MEMORY"},
|
||||
{GraphicsAllocation::AllocationType::KERNEL_ISA, "KERNEL_ISA"},
|
||||
{GraphicsAllocation::AllocationType::LINEAR_STREAM, "LINEAR_STREAM"},
|
||||
{GraphicsAllocation::AllocationType::MCS, "MCS"},
|
||||
{GraphicsAllocation::AllocationType::PIPE, "PIPE"},
|
||||
{GraphicsAllocation::AllocationType::PREEMPTION, "PREEMPTION"},
|
||||
{GraphicsAllocation::AllocationType::PRINTF_SURFACE, "PRINTF_SURFACE"},
|
||||
{GraphicsAllocation::AllocationType::PRIVATE_SURFACE, "PRIVATE_SURFACE"},
|
||||
{GraphicsAllocation::AllocationType::PROFILING_TAG_BUFFER, "PROFILING_TAG_BUFFER"},
|
||||
{GraphicsAllocation::AllocationType::SCRATCH_SURFACE, "SCRATCH_SURFACE"},
|
||||
{GraphicsAllocation::AllocationType::SHARED_BUFFER, "SHARED_BUFFER"},
|
||||
{GraphicsAllocation::AllocationType::SHARED_CONTEXT_IMAGE, "SHARED_CONTEXT_IMAGE"},
|
||||
{GraphicsAllocation::AllocationType::SHARED_IMAGE, "SHARED_IMAGE"},
|
||||
{GraphicsAllocation::AllocationType::SHARED_RESOURCE_COPY, "SHARED_RESOURCE_COPY"},
|
||||
{GraphicsAllocation::AllocationType::SURFACE_STATE_HEAP, "SURFACE_STATE_HEAP"},
|
||||
|
||||
Reference in New Issue
Block a user