@@ -38,6 +38,22 @@ TEST(clUnifiedSharedMemoryTests, whenClHostMemAllocIntelIsCalledThenItAllocatesH
3838 EXPECT_EQ (CL_SUCCESS, retVal);
3939}
4040
41+ TEST (clUnifiedSharedMemoryTests, givenMappedAllocationWhenClMemFreeIntelIscalledThenMappingIsRemoved) {
42+
43+ MockContext mockContext;
44+ cl_int retVal = CL_SUCCESS;
45+ auto unifiedMemorySharedAllocation = clSharedMemAllocINTEL (&mockContext, mockContext.getDevice (0u ), nullptr , 4 , 0 , &retVal);
46+ EXPECT_EQ (CL_SUCCESS, retVal);
47+ ASSERT_NE (nullptr , unifiedMemorySharedAllocation);
48+
49+ auto allocationsManager = mockContext.getSVMAllocsManager ();
50+ allocationsManager->insertSvmMapOperation (unifiedMemorySharedAllocation, 4u , unifiedMemorySharedAllocation, 0u , false );
51+
52+ retVal = clMemFreeINTEL (&mockContext, unifiedMemorySharedAllocation);
53+ EXPECT_EQ (CL_SUCCESS, retVal);
54+ EXPECT_EQ (nullptr , allocationsManager->getSvmMapOperation (unifiedMemorySharedAllocation));
55+ }
56+
4157TEST (clUnifiedSharedMemoryTests, whenClDeviceMemAllocINTELisCalledWithWrongContextThenInvalidContextErrorIsReturned) {
4258 cl_int retVal = CL_SUCCESS;
4359 auto ptr = clDeviceMemAllocINTEL (0 , 0 , nullptr , 0 , 0 , &retVal);
0 commit comments