Support for dsh and ssh on external heap in L0

Related-To: NEO-4724

Change-Id: I85c2effea8a99bebaf9e3db33129641f37dcabe5
Signed-off-by: Maciej Plewka <maciej.plewka@intel.com>
This commit is contained in:
Maciej Plewka
2020-08-27 08:55:09 +02:00
committed by sys_ocldev
parent f891708e3f
commit a779e44b52
29 changed files with 356 additions and 46 deletions

View File

@@ -0,0 +1,47 @@
/*
* Copyright (C) 2020 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
*/
#include "shared/source/helpers/heap_assigner.h"
#include "shared/test/unit_test/fixtures/device_fixture.h"
#include "test.h"
namespace NEO {
class AlocationHelperTests : public Test<DeviceFixture> {
public:
HeapAssigner heapAssigner = {};
};
HWTEST_F(AlocationHelperTests, givenKernelIsaTypeWhenUse32BitHeapCalledThenTrueReturned) {
EXPECT_TRUE(heapAssigner.use32BitHeap(GraphicsAllocation::AllocationType::KERNEL_ISA));
}
HWTEST_F(AlocationHelperTests, givenKernelIsaTypeWhenUseIternalAllocatorThenUseHeapInternal) {
auto heapIndex = heapAssigner.get32BitHeapIndex(GraphicsAllocation::AllocationType::KERNEL_ISA, true, *defaultHwInfo);
EXPECT_EQ(heapIndex, NEO::HeapIndex::HEAP_INTERNAL_DEVICE_MEMORY);
}
HWTEST_F(AlocationHelperTests, givenNotInternalTypeWhenUseIternalAllocatorThenUseHeapExternal) {
auto heapIndex = heapAssigner.get32BitHeapIndex(GraphicsAllocation::AllocationType::LINEAR_STREAM, true, *defaultHwInfo);
EXPECT_EQ(heapIndex, NEO::HeapIndex::HEAP_EXTERNAL_DEVICE_MEMORY);
}
HWTEST_F(AlocationHelperTests, givenKernelIsaTypeWhenUseInternalAllocatorCalledThenTrueReturned) {
EXPECT_TRUE(heapAssigner.useInternal32BitHeap(GraphicsAllocation::AllocationType::KERNEL_ISA));
}
HWTEST_F(AlocationHelperTests, givenInternalHeapTypeWhenUseInternalAllocatorCalledThenTrueReturned) {
EXPECT_TRUE(heapAssigner.useInternal32BitHeap(GraphicsAllocation::AllocationType::INTERNAL_HEAP));
}
HWTEST_F(AlocationHelperTests, givenNotInternalHeapTypeWhenUseInternalAllocatorCalledThenFalseReturned) {
EXPECT_FALSE(heapAssigner.useInternal32BitHeap(GraphicsAllocation::AllocationType::BUFFER));
}
} // namespace NEO