@@ -53,16 +53,17 @@ HWTEST_F(AppendFillTest, givenCallToAppendMemoryFillWithPatternSizeLessOrEqualTh
5353 commandList->initialize (device, NEO::EngineGroupType::renderCompute, 0u );
5454
5555 for (const auto patternSize : {1 , 2 , 4 }) {
56- size_t patternAllocationsVectorSizeBefore = commandList->patternAllocations .size ();
56+ size_t patternTagsVectorSizeBefore = commandList->patternTags .size ();
5757 CmdListMemoryCopyParams copyParams = {};
5858 ze_result_t result = commandList->appendMemoryFill (dstPtr, pattern, patternSize, allocSize, nullptr , 0 , nullptr , copyParams);
5959 EXPECT_EQ (ZE_RESULT_SUCCESS, result);
60- size_t patternAllocationsVectorSize = commandList->patternAllocations .size ();
60+ size_t patternTagsVectorSize = commandList->patternTags .size ();
6161 if (patternSize == 1 ) {
62- EXPECT_EQ (patternAllocationsVectorSize, patternAllocationsVectorSizeBefore );
62+ EXPECT_EQ (patternTagsVectorSize, patternTagsVectorSizeBefore );
6363 } else {
64- EXPECT_NE (patternAllocationsVectorSize, patternAllocationsVectorSizeBefore );
64+ EXPECT_NE (patternTagsVectorSize, patternTagsVectorSizeBefore );
6565 }
66+ EXPECT_EQ (0u , commandList->patternAllocations .size ());
6667 }
6768}
6869
@@ -76,6 +77,7 @@ HWTEST_F(AppendFillTest, givenCallToAppendMemoryFillWithPatternSizeLessOrEqualTh
7677 EXPECT_EQ (ZE_RESULT_SUCCESS, result);
7778 size_t patternAllocationsVectorSize = commandList->patternAllocations .size ();
7879 EXPECT_EQ (patternAllocationsVectorSize, 0u );
80+ EXPECT_EQ (0u , commandList->patternTags .size ());
7981 }
8082}
8183
@@ -84,13 +86,14 @@ HWTEST_F(AppendFillTest, givenTwoCallsToAppendMemoryFillWithSamePatternThenAlloc
8486 commandList->initialize (device, NEO::EngineGroupType::renderCompute, 0u );
8587
8688 CmdListMemoryCopyParams copyParams = {};
87- ze_result_t result = commandList->appendMemoryFill (dstPtr, pattern, 8 , allocSize, nullptr , 0 , nullptr , copyParams);
89+ char pattern[65 ] = {};
90+ ze_result_t result = commandList->appendMemoryFill (dstPtr, pattern, sizeof (pattern), allocSize, nullptr , 0 , nullptr , copyParams);
8891 EXPECT_EQ (ZE_RESULT_SUCCESS, result);
8992 size_t patternAllocationsVectorSize = commandList->patternAllocations .size ();
9093 EXPECT_EQ (patternAllocationsVectorSize, 1u );
9194
9295 uint8_t *newDstPtr = new uint8_t [allocSize];
93- result = commandList->appendMemoryFill (newDstPtr, pattern, patternSize , allocSize, nullptr , 0 , nullptr , copyParams);
96+ result = commandList->appendMemoryFill (newDstPtr, pattern, sizeof (pattern) , allocSize, nullptr , 0 , nullptr , copyParams);
9497 EXPECT_EQ (ZE_RESULT_SUCCESS, result);
9598 size_t newPatternAllocationsVectorSize = commandList->patternAllocations .size ();
9699
@@ -104,19 +107,58 @@ HWTEST_F(AppendFillTest, givenTwoCallsToAppendMemoryFillWithDifferentPatternsThe
104107 commandList->initialize (device, NEO::EngineGroupType::renderCompute, 0u );
105108
106109 CmdListMemoryCopyParams copyParams = {};
107- ze_result_t result = commandList->appendMemoryFill (dstPtr, pattern, 8 , allocSize, nullptr , 0 , nullptr , copyParams);
110+ char pattern[65 ] = {};
111+ ze_result_t result = commandList->appendMemoryFill (dstPtr, pattern, sizeof (pattern), allocSize, nullptr , 0 , nullptr , copyParams);
108112 EXPECT_EQ (ZE_RESULT_SUCCESS, result);
109113 size_t patternAllocationsVectorSize = commandList->patternAllocations .size ();
110114 EXPECT_EQ (patternAllocationsVectorSize, 1u );
111115
112- uint8_t newPattern[patternSize ] = {1 , 2 , 3 , 4 };
113- result = commandList->appendMemoryFill (dstPtr, newPattern, patternSize , allocSize, nullptr , 0 , nullptr , copyParams);
116+ char newPattern[66 ] = {};
117+ result = commandList->appendMemoryFill (dstPtr, newPattern, sizeof (newPattern) , allocSize, nullptr , 0 , nullptr , copyParams);
114118 EXPECT_EQ (ZE_RESULT_SUCCESS, result);
115119 size_t newPatternAllocationsVectorSize = commandList->patternAllocations .size ();
116120
117121 EXPECT_EQ (patternAllocationsVectorSize + 1u , newPatternAllocationsVectorSize);
118122}
119123
124+ HWTEST_F (AppendFillTest, givenTwoCallsToAppendMemoryFillWithSamePatternThenTagIsCreatedForEachCall) {
125+ auto commandList = std::make_unique<WhiteBox<MockCommandList<FamilyType::gfxCoreFamily>>>();
126+ commandList->initialize (device, NEO::EngineGroupType::renderCompute, 0u );
127+
128+ CmdListMemoryCopyParams copyParams = {};
129+ ze_result_t result = commandList->appendMemoryFill (dstPtr, pattern, 8 , allocSize, nullptr , 0 , nullptr , copyParams);
130+ EXPECT_EQ (ZE_RESULT_SUCCESS, result);
131+ size_t patternTagsVectorSize = commandList->patternTags .size ();
132+ EXPECT_EQ (patternTagsVectorSize, 1u );
133+
134+ uint8_t *newDstPtr = new uint8_t [allocSize];
135+ result = commandList->appendMemoryFill (newDstPtr, pattern, patternSize, allocSize, nullptr , 0 , nullptr , copyParams);
136+ EXPECT_EQ (ZE_RESULT_SUCCESS, result);
137+ size_t newPatternTagsVectorSize = commandList->patternTags .size ();
138+
139+ EXPECT_GT (newPatternTagsVectorSize, patternTagsVectorSize);
140+
141+ delete[] newDstPtr;
142+ }
143+
144+ HWTEST_F (AppendFillTest, givenTwoCallsToAppendMemoryFillWithDifferentPatternsThenTagIsCreatedForEachPattern) {
145+ auto commandList = std::make_unique<WhiteBox<MockCommandList<FamilyType::gfxCoreFamily>>>();
146+ commandList->initialize (device, NEO::EngineGroupType::renderCompute, 0u );
147+
148+ CmdListMemoryCopyParams copyParams = {};
149+ ze_result_t result = commandList->appendMemoryFill (dstPtr, pattern, 8 , allocSize, nullptr , 0 , nullptr , copyParams);
150+ EXPECT_EQ (ZE_RESULT_SUCCESS, result);
151+ size_t patternTagsVectorSize = commandList->patternTags .size ();
152+ EXPECT_EQ (patternTagsVectorSize, 1u );
153+
154+ uint8_t newPattern[patternSize] = {1 , 2 , 3 , 4 };
155+ result = commandList->appendMemoryFill (dstPtr, newPattern, patternSize, allocSize, nullptr , 0 , nullptr , copyParams);
156+ EXPECT_EQ (ZE_RESULT_SUCCESS, result);
157+ size_t newPatternTagsVectorSize = commandList->patternTags .size ();
158+
159+ EXPECT_EQ (patternTagsVectorSize + 1u , newPatternTagsVectorSize);
160+ }
161+
120162HWTEST_F (AppendFillTest, givenAppendMemoryFillWhenPatternSizeIsOneThenDispatchOneKernel) {
121163 auto commandList = std::make_unique<WhiteBox<MockCommandList<FamilyType::gfxCoreFamily>>>();
122164 commandList->initialize (device, NEO::EngineGroupType::compute, 0u );
0 commit comments