@@ -38,6 +38,22 @@ TEST(clUnifiedSharedMemoryTests, whenClHostMemAllocIntelIsCalledThenItAllocatesH
38
38
EXPECT_EQ (CL_SUCCESS, retVal);
39
39
}
40
40
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
+
41
57
TEST (clUnifiedSharedMemoryTests, whenClDeviceMemAllocINTELisCalledWithWrongContextThenInvalidContextErrorIsReturned) {
42
58
cl_int retVal = CL_SUCCESS;
43
59
auto ptr = clDeviceMemAllocINTEL (0 , 0 , nullptr , 0 , 0 , &retVal);
0 commit comments