Skip to content

Commit e146a8e

Browse files
kgibalaCompute-Runtime-Automation
authored andcommitted
Correct wrong constructor pattern in GraphicsAllocation
Related-To: NEO-6523 Signed-off-by: Krzysztof Gibala <[email protected]>
1 parent e6c9738 commit e146a8e

23 files changed

+280
-148
lines changed

level_zero/core/test/unit_tests/gen9/test_cmdlist_create_gen9.cpp

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,14 @@ class CommandListCreateGen9 : public DeviceFixture, public testing::Test {
5757
if (!buffer) {
5858
buffer = alignedMalloc(isaSize, 64);
5959
}
60-
auto allocation = new NEO::GraphicsAllocation(0, NEO::AllocationType::INTERNAL_HOST_MEMORY,
61-
buffer, reinterpret_cast<uint64_t>(buffer), 0, isaSize,
62-
MemoryPool::System4KBPages);
60+
auto allocation = new NEO::GraphicsAllocation(0,
61+
NEO::AllocationType::INTERNAL_HOST_MEMORY,
62+
buffer,
63+
reinterpret_cast<uint64_t>(buffer),
64+
0,
65+
isaSize,
66+
MemoryPool::System4KBPages,
67+
MemoryManager::maxOsContextCount);
6368
if (isaBuffer != nullptr) {
6469
memcpy_s(allocation->getUnderlyingBuffer(), allocation->getUnderlyingBufferSize(), isaBuffer, isaSize);
6570
}

level_zero/core/test/unit_tests/mocks/mock_cmdlist.cpp

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,14 @@ MockCommandList::MockCommandList(Device *device) : WhiteBox<::L0::CommandList>(d
1818
this->device = device;
1919
size_t batchBufferSize = 65536u;
2020
batchBuffer = new uint8_t[batchBufferSize];
21-
mockAllocation = new NEO::GraphicsAllocation(0, NEO::AllocationType::INTERNAL_HOST_MEMORY,
22-
&batchBuffer, reinterpret_cast<uint64_t>(&batchBuffer), 0, sizeof(batchBufferSize),
23-
MemoryPool::System4KBPages);
21+
mockAllocation = new NEO::GraphicsAllocation(0,
22+
NEO::AllocationType::INTERNAL_HOST_MEMORY,
23+
&batchBuffer,
24+
reinterpret_cast<uint64_t>(&batchBuffer),
25+
0,
26+
sizeof(batchBufferSize),
27+
MemoryPool::System4KBPages,
28+
NEO::MemoryManager::maxOsContextCount);
2429
}
2530

2631
MockCommandList::~MockCommandList() {

level_zero/core/test/unit_tests/mocks/mock_event.cpp

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,14 @@
1010
namespace L0 {
1111
namespace ult {
1212

13-
Mock<Event>::Mock() : mockAllocation(0, NEO::AllocationType::INTERNAL_HOST_MEMORY,
14-
&memory, reinterpret_cast<uint64_t>(&memory), 0, sizeof(memory),
15-
MemoryPool::System4KBPages) {}
13+
Mock<Event>::Mock() : mockAllocation(0,
14+
NEO::AllocationType::INTERNAL_HOST_MEMORY,
15+
&memory,
16+
reinterpret_cast<uint64_t>(&memory),
17+
0,
18+
sizeof(memory),
19+
MemoryPool::System4KBPages,
20+
NEO::MemoryManager::maxOsContextCount) {}
1621

1722
Mock<Event>::~Mock() {}
1823

level_zero/core/test/unit_tests/mocks/mock_event.h

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,14 @@ class MockEvent : public ::L0::Event {
6868
public:
6969
using ::L0::Event::l3FlushAppliedOnKernel;
7070
MockEvent() {
71-
mockAllocation.reset(new NEO::MockGraphicsAllocation(0, NEO::AllocationType::INTERNAL_HOST_MEMORY,
72-
reinterpret_cast<void *>(0x1234), 0x1000, 0, sizeof(uint32_t),
73-
MemoryPool::System4KBPages));
71+
mockAllocation.reset(new NEO::MockGraphicsAllocation(0,
72+
NEO::AllocationType::INTERNAL_HOST_MEMORY,
73+
reinterpret_cast<void *>(0x1234),
74+
0x1000,
75+
0,
76+
sizeof(uint32_t),
77+
MemoryPool::System4KBPages,
78+
NEO::MemoryManager::maxOsContextCount));
7479
this->timestampSizeInDw = 1;
7580
this->contextStartOffset = 0;
7681
this->contextEndOffset = 4;

level_zero/core/test/unit_tests/mocks/mock_kernel.h

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -115,9 +115,14 @@ struct Mock<::L0::Kernel> : public WhiteBox<::L0::Kernel> {
115115

116116
this->kernelImmData = &immutableData;
117117

118-
auto allocation = new NEO::GraphicsAllocation(0, NEO::AllocationType::KERNEL_ISA,
119-
nullptr, 0, 0, 4096,
120-
MemoryPool::System4KBPages);
118+
auto allocation = new NEO::GraphicsAllocation(0,
119+
NEO::AllocationType::KERNEL_ISA,
120+
nullptr,
121+
0,
122+
0,
123+
4096,
124+
MemoryPool::System4KBPages,
125+
NEO::MemoryManager::maxOsContextCount);
121126

122127
immutableData.isaGraphicsAllocation.reset(allocation);
123128

0 commit comments

Comments
 (0)