Revert "Fail when handle cannot be obtain for an allocation"

This reverts commit 4391ad21bb.

Signed-off-by: Compute-Runtime-Validation <compute-runtime-validation@intel.com>
This commit is contained in:
Compute-Runtime-Validation
2022-11-23 04:53:51 +01:00
committed by Compute-Runtime-Automation
parent 4391ad21bb
commit 565d44e59c
23 changed files with 115 additions and 1007 deletions

View File

@ -193,7 +193,7 @@ cl_int MemObj::getMemObjectInfo(cl_mem_info paramName,
break;
case CL_MEM_ALLOCATION_HANDLE_INTEL:
multiGraphicsAllocation.getDefaultGraphicsAllocation()->peekInternalHandle(this->memoryManager, internalHandle);
internalHandle = multiGraphicsAllocation.getDefaultGraphicsAllocation()->peekInternalHandle(this->memoryManager);
srcParamSize = sizeof(internalHandle);
srcParam = &internalHandle;
break;

View File

@ -481,9 +481,7 @@ TEST_F(WddmTestWithMockGdiDll, givenShareableAllocationWhenCreateThenSharedHandl
allocation.setDefaultGmm(gmm.get());
auto status = memoryManager.createGpuAllocationsWithRetry(&allocation);
EXPECT_TRUE(status);
uint64_t handle = 0;
allocation.peekInternalHandle(&memoryManager, handle);
EXPECT_NE(0u, handle);
EXPECT_NE(0u, allocation.peekInternalHandle(&memoryManager));
}
TEST(WddmAllocationTest, whenAllocationIsShareableThenSharedHandleToModifyIsSharedHandleOfAllocation) {
@ -491,10 +489,7 @@ TEST(WddmAllocationTest, whenAllocationIsShareableThenSharedHandleToModifyIsShar
auto sharedHandleToModify = allocation.getSharedHandleToModify();
EXPECT_NE(nullptr, sharedHandleToModify);
*sharedHandleToModify = 1234u;
uint64_t handle = 0;
int ret = allocation.peekInternalHandle(nullptr, handle);
EXPECT_EQ(ret, 0);
EXPECT_EQ(*sharedHandleToModify, handle);
EXPECT_EQ(*sharedHandleToModify, allocation.peekInternalHandle(nullptr));
}
TEST(WddmAllocationTest, whenAllocationIsNotShareableThenItDoesntReturnSharedHandleToModify) {

View File

@ -75,9 +75,7 @@ TEST_F(WddmMemoryManagerSimpleTest, givenShareableAllocationWhenAllocateInDevice
EXPECT_EQ(MemoryManager::AllocationStatus::Success, status);
EXPECT_EQ(MemoryPool::LocalMemory, allocation->getMemoryPool());
EXPECT_EQ(0u, allocation->getDefaultGmm()->resourceParams.Flags.Info.NonLocalOnly);
uint64_t handle = 0;
allocation->peekInternalHandle(memoryManager.get(), handle);
EXPECT_NE(handle, 0u);
EXPECT_NE(allocation->peekInternalHandle(memoryManager.get()), 0u);
EXPECT_EQ(1u, allocation->getDefaultGmm()->resourceParams.Flags.Info.LocalOnly);
EXPECT_EQ(1u, allocation->getDefaultGmm()->resourceParams.Flags.Info.NotLockable);
@ -104,9 +102,7 @@ TEST_F(WddmMemoryManagerSimpleTest, givenShareableAllocationWhenAllocateGraphics
EXPECT_NE(nullptr, allocation);
EXPECT_EQ(MemoryPool::LocalMemory, allocation->getMemoryPool());
EXPECT_EQ(0u, allocation->getDefaultGmm()->resourceParams.Flags.Info.NonLocalOnly);
uint64_t handle = 0;
allocation->peekInternalHandle(memoryManager.get(), handle);
EXPECT_NE(handle, 0u);
EXPECT_NE(allocation->peekInternalHandle(memoryManager.get()), 0u);
EXPECT_EQ(1u, allocation->getDefaultGmm()->resourceParams.Flags.Info.LocalOnly);
EXPECT_EQ(1u, allocation->getDefaultGmm()->resourceParams.Flags.Info.NotLockable);