Skip to content

Commit 464e4fd

Browse files
Fix GMM usage in 1D image allocation on windows
Properly use the gmm resource created for the Image allocation instead of the gmm resource created in allocateGraphicsMemoryWithAlignment in the windows wddm memory manager by removing the call to allocateGraphicsMemoryWithAlignment for 1D images. Invalid ULT testing this functionality has been removed. Related-To: LOCI-1845 Signed-off-by: Spruit, Neil R <[email protected]>
1 parent 184ec7d commit 464e4fd

File tree

2 files changed

+0
-35
lines changed

2 files changed

+0
-35
lines changed

opencl/test/unit_test/os_interface/windows/wddm_memory_manager_tests.cpp

Lines changed: 0 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -852,37 +852,6 @@ HWTEST_F(WddmMemoryManagerTest, givenWddmMemoryManagerWhenTiledImageIsBeingCreat
852852
EXPECT_EQ(GMM_RESOURCE_USAGE_TYPE::GMM_RESOURCE_USAGE_OCL_IMAGE, imageGraphicsAllocation->getDefaultGmm()->resourceParams.Usage);
853853
}
854854

855-
TEST_F(WddmMemoryManagerTest, givenWddmMemoryManagerWhenNonTiledImgWithMipCountZeroisBeingCreatedThenAllocateGraphicsMemoryIsUsed) {
856-
MockContext context;
857-
context.memoryManager = memoryManager.get();
858-
859-
cl_image_format imageFormat;
860-
imageFormat.image_channel_data_type = CL_UNORM_INT8;
861-
imageFormat.image_channel_order = CL_R;
862-
863-
cl_image_desc imageDesc = {};
864-
865-
imageDesc.image_type = CL_MEM_OBJECT_IMAGE1D;
866-
imageDesc.image_width = 64u;
867-
868-
char data[64u * 4 * 8];
869-
870-
auto retVal = CL_SUCCESS;
871-
872-
cl_mem_flags flags = CL_MEM_WRITE_ONLY | CL_MEM_USE_HOST_PTR;
873-
auto surfaceFormat = Image::getSurfaceFormatFromTable(
874-
flags, &imageFormat, context.getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features);
875-
std::unique_ptr<Image> dstImage(
876-
Image::create(&context, MemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice()),
877-
flags, 0, surfaceFormat, &imageDesc, data, retVal));
878-
EXPECT_EQ(CL_SUCCESS, retVal);
879-
ASSERT_NE(nullptr, dstImage);
880-
881-
auto imageGraphicsAllocation = dstImage->getGraphicsAllocation(context.getDevice(0)->getRootDeviceIndex());
882-
ASSERT_NE(nullptr, imageGraphicsAllocation);
883-
EXPECT_EQ(GMM_RESOURCE_USAGE_TYPE::GMM_RESOURCE_USAGE_OCL_BUFFER, imageGraphicsAllocation->getDefaultGmm()->resourceParams.Usage);
884-
}
885-
886855
TEST_F(WddmMemoryManagerTest, givenWddmMemoryManagerWhenNonTiledImgWithMipCountNonZeroisBeingCreatedThenAllocateGraphicsMemoryForImageIsUsed) {
887856
MockContext context;
888857
context.memoryManager = memoryManager.get();

shared/source/os_interface/windows/wddm_memory_manager.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,10 +69,6 @@ GraphicsAllocation *WddmMemoryManager::allocateShareableMemory(const AllocationD
6969
}
7070

7171
GraphicsAllocation *WddmMemoryManager::allocateGraphicsMemoryForImageImpl(const AllocationData &allocationData, std::unique_ptr<Gmm> gmm) {
72-
if (allocationData.imgInfo->linearStorage && allocationData.imgInfo->mipCount == 0) {
73-
return allocateGraphicsMemoryWithAlignment(allocationData);
74-
}
75-
7672
auto allocation = std::make_unique<WddmAllocation>(allocationData.rootDeviceIndex,
7773
1u, // numGmms
7874
allocationData.type, nullptr, allocationData.imgInfo->size,

0 commit comments

Comments
 (0)