Skip to content

Commit c88fce0

Browse files
Gmm construction cleanup
Signed-off-by: Bartosz Dunajski <[email protected]>
1 parent 82ad3d6 commit c88fce0

File tree

43 files changed

+285
-284
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+285
-284
lines changed

level_zero/core/test/unit_tests/sources/driver/test_driver.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ class MemoryManagerNTHandleMock : public NEO::OsAgnosticMemoryManager {
160160
rootDeviceIndex, false, false, false);
161161
graphicsAllocation->setSharedHandle(static_cast<osHandle>(reinterpret_cast<uint64_t>(handle)));
162162
graphicsAllocation->set32BitAllocation(false);
163-
graphicsAllocation->setDefaultGmm(new Gmm(executionEnvironment.rootDeviceEnvironments[0]->getGmmClientContext(), nullptr, 1, 0, false));
163+
graphicsAllocation->setDefaultGmm(new Gmm(executionEnvironment.rootDeviceEnvironments[0]->getGmmClientContext(), nullptr, 1, 0, false, false, {}, true));
164164
return graphicsAllocation;
165165
}
166166
};

level_zero/core/test/unit_tests/sources/image/test_image.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -363,7 +363,7 @@ class MemoryManagerNTHandleMock : public NEO::OsAgnosticMemoryManager {
363363
rootDeviceIndex, false, false, false);
364364
graphicsAllocation->setSharedHandle(static_cast<osHandle>(reinterpret_cast<uint64_t>(handle)));
365365
graphicsAllocation->set32BitAllocation(false);
366-
graphicsAllocation->setDefaultGmm(new Gmm(executionEnvironment.rootDeviceEnvironments[0]->getGmmClientContext(), nullptr, 1, 0, false));
366+
graphicsAllocation->setDefaultGmm(new Gmm(executionEnvironment.rootDeviceEnvironments[0]->getGmmClientContext(), nullptr, 1, 0, false, false, {}, true));
367367
return graphicsAllocation;
368368
}
369369
};

opencl/test/unit_test/built_ins/built_in_tests.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -633,7 +633,7 @@ HWTEST2_P(AuxBuiltInTests, givenAuxToNonAuxTranslationWhenSettingSurfaceStateThe
633633
std::unique_ptr<Buffer> buffer = nullptr;
634634
std::unique_ptr<GraphicsAllocation> gfxAllocation = nullptr;
635635

636-
auto gmm = std::unique_ptr<Gmm>(new Gmm(pDevice->getGmmClientContext(), nullptr, 1, 0, false));
636+
auto gmm = std::unique_ptr<Gmm>(new Gmm(pDevice->getGmmClientContext(), nullptr, 1, 0, false, false, {}, true));
637637
gmm->isCompressionEnabled = true;
638638

639639
if (kernelObjType == MockKernelObjForAuxTranslation::Type::MEM_OBJ) {
@@ -688,7 +688,7 @@ HWTEST2_P(AuxBuiltInTests, givenNonAuxToAuxTranslationWhenSettingSurfaceStateThe
688688
builtinOpParams.auxTranslationDirection = AuxTranslationDirection::NonAuxToAux;
689689

690690
MockKernelObjForAuxTranslation mockKernelObjForAuxTranslation(kernelObjType);
691-
auto gmm = std::make_unique<Gmm>(pDevice->getGmmClientContext(), nullptr, 1, 0, false);
691+
auto gmm = std::make_unique<Gmm>(pDevice->getGmmClientContext(), nullptr, 1, 0, false, false, StorageInfo{}, true);
692692
gmm->isCompressionEnabled = true;
693693
if (kernelObjType == MockKernelObjForAuxTranslation::Type::MEM_OBJ) {
694694
mockKernelObjForAuxTranslation.mockBuffer->getGraphicsAllocation(pClDevice->getRootDeviceIndex())->setDefaultGmm(gmm.release());

opencl/test/unit_test/command_queue/blit_enqueue_tests.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ struct BlitEnqueueTests : public ::testing::Test {
165165
if (compressed && !graphicsAllocation->getDefaultGmm()) {
166166
auto clientContext = device->getRootDeviceEnvironment().getGmmClientContext();
167167

168-
graphicsAllocation->setDefaultGmm(new Gmm(clientContext, nullptr, 0, 0, false));
168+
graphicsAllocation->setDefaultGmm(new Gmm(clientContext, nullptr, 0, 0, false, false, {}, true));
169169
}
170170

171171
if (graphicsAllocation->getDefaultGmm()) {

opencl/test/unit_test/command_queue/read_write_buffer_cpu_copy.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (C) 2018-2021 Intel Corporation
2+
* Copyright (C) 2018-2022 Intel Corporation
33
*
44
* SPDX-License-Identifier: MIT
55
*
@@ -24,7 +24,7 @@ HWTEST_F(ReadWriteBufferCpuCopyTest, givenCompressedGmmWhenAskingForCpuOperation
2424
cl_int retVal;
2525
auto rootDeviceIndex = context->getDevice(0)->getRootDeviceIndex();
2626
std::unique_ptr<Buffer> buffer(Buffer::create(context, CL_MEM_READ_WRITE, 1, nullptr, retVal));
27-
auto gmm = new Gmm(pDevice->getGmmClientContext(), nullptr, 1, 0, false);
27+
auto gmm = new Gmm(pDevice->getGmmClientContext(), nullptr, 1, 0, false, false, {}, true);
2828
gmm->isCompressionEnabled = false;
2929
auto allocation = buffer->getGraphicsAllocation(rootDeviceIndex);
3030
allocation->setDefaultGmm(gmm);

opencl/test/unit_test/context/driver_diagnostics_tests.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (C) 2018-2021 Intel Corporation
2+
* Copyright (C) 2018-2022 Intel Corporation
33
*
44
* SPDX-License-Identifier: MIT
55
*
@@ -745,7 +745,7 @@ HWTEST_F(PerformanceHintTest, givenCompressedImageWhenItsCreatedThenProperPerfor
745745
auto mockBuffer = std::unique_ptr<MockBuffer>(new MockBuffer());
746746
StorageInfo info;
747747
size_t t = 4;
748-
auto gmm = new Gmm(device->getGmmClientContext(), static_cast<const void *>(nullptr), t, 0, false, true, true, info);
748+
auto gmm = new Gmm(device->getGmmClientContext(), static_cast<const void *>(nullptr), t, 0, false, true, info, true);
749749
gmm->isCompressionEnabled = true;
750750

751751
auto graphicsAllocation = mockBuffer->getGraphicsAllocation(device->getRootDeviceIndex());
@@ -815,7 +815,7 @@ TEST_F(PerformanceHintTest, givenUncompressedImageWhenItsCreatedThenProperPerfor
815815
auto mockBuffer = std::unique_ptr<MockBuffer>(new MockBuffer());
816816
StorageInfo info;
817817
size_t t = 4;
818-
auto gmm = new Gmm(device->getGmmClientContext(), (const void *)nullptr, t, 0, false, true, true, info);
818+
auto gmm = new Gmm(device->getGmmClientContext(), (const void *)nullptr, t, 0, false, true, info, true);
819819
gmm->isCompressionEnabled = false;
820820

821821
mockBuffer->getGraphicsAllocation(device->getRootDeviceIndex())->setDefaultGmm(gmm);

opencl/test/unit_test/gen12lp/image_tests_gen12lp.inl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (C) 2019-2021 Intel Corporation
2+
* Copyright (C) 2019-2022 Intel Corporation
33
*
44
* SPDX-License-Identifier: MIT
55
*
@@ -94,7 +94,7 @@ GEN12LPTEST_F(ImageClearColorFixture, givenMcsAllocationWhenSetArgIsCalledWithUn
9494

9595
auto surfaceState = FamilyType::cmdInitRenderSurfaceState;
9696
auto imageHw = static_cast<ImageHw<FamilyType> *>(image.get());
97-
mcsAlloc->setDefaultGmm(new Gmm(context->getDevice(0)->getGmmClientContext(), nullptr, 1, 0, false));
97+
mcsAlloc->setDefaultGmm(new Gmm(context->getDevice(0)->getGmmClientContext(), nullptr, 1, 0, false, false, {}, true));
9898
surfaceState.setSurfaceBaseAddress(0xABCDEF1000);
9999
imageHw->setMcsSurfaceInfo(msi);
100100
imageHw->setMcsAllocation(mcsAlloc);

0 commit comments

Comments
 (0)