@@ -124,5 +124,72 @@ struct ImmediateCmdListSharedHeapsFixture : public ModuleMutableCommandListFixtu
124
124
DebugManagerStateRestore restorer;
125
125
};
126
126
127
+ class AppendFillFixture : public DeviceFixture {
128
+ public:
129
+ class MockDriverFillHandle : public L0 ::DriverHandleImp {
130
+ public:
131
+ bool findAllocationDataForRange (const void *buffer,
132
+ size_t size,
133
+ NEO::SvmAllocationData **allocData) override ;
134
+
135
+ const uint32_t rootDeviceIndex = 0u ;
136
+ std::unique_ptr<NEO::GraphicsAllocation> mockAllocation;
137
+ NEO::SvmAllocationData data{rootDeviceIndex};
138
+ };
139
+
140
+ template <GFXCORE_FAMILY gfxCoreFamily>
141
+ class MockCommandList : public WhiteBox <::L0::CommandListCoreFamily<gfxCoreFamily>> {
142
+ public:
143
+ MockCommandList () : WhiteBox<::L0::CommandListCoreFamily<gfxCoreFamily>>() {}
144
+
145
+ ze_result_t appendLaunchKernelWithParams (Kernel *kernel,
146
+ const ze_group_count_t *pThreadGroupDimensions,
147
+ Event *event,
148
+ const CmdListKernelLaunchParams &launchParams) override {
149
+ if (numberOfCallsToAppendLaunchKernelWithParams == thresholdOfCallsToAppendLaunchKernelWithParamsToFail) {
150
+ return ZE_RESULT_ERROR_UNKNOWN;
151
+ }
152
+ if (numberOfCallsToAppendLaunchKernelWithParams < 3 ) {
153
+ threadGroupDimensions[numberOfCallsToAppendLaunchKernelWithParams] = *pThreadGroupDimensions;
154
+ xGroupSizes[numberOfCallsToAppendLaunchKernelWithParams] = kernel->getGroupSize ()[0 ];
155
+ }
156
+ numberOfCallsToAppendLaunchKernelWithParams++;
157
+ return CommandListCoreFamily<gfxCoreFamily>::appendLaunchKernelWithParams (kernel,
158
+ pThreadGroupDimensions,
159
+ event,
160
+ launchParams);
161
+ }
162
+ ze_group_count_t threadGroupDimensions[3 ];
163
+ uint32_t xGroupSizes[3 ];
164
+ uint32_t thresholdOfCallsToAppendLaunchKernelWithParamsToFail = std::numeric_limits<uint32_t >::max();
165
+ uint32_t numberOfCallsToAppendLaunchKernelWithParams = 0 ;
166
+ };
167
+
168
+ void setUp ();
169
+ void tearDown ();
170
+
171
+ DebugManagerStateRestore restorer;
172
+
173
+ std::unique_ptr<Mock<MockDriverFillHandle>> driverHandle;
174
+ NEO::MockDevice *neoDevice = nullptr ;
175
+ L0::Device *device = nullptr ;
176
+ static constexpr size_t allocSize = 70 ;
177
+ static constexpr size_t patternSize = 8 ;
178
+ uint8_t *dstPtr = nullptr ;
179
+ uint8_t pattern[patternSize] = {1 , 2 , 3 , 4 };
180
+
181
+ static constexpr size_t immediateAllocSize = 106 ;
182
+ uint8_t immediatePattern = 4 ;
183
+ uint8_t *immediateDstPtr = nullptr ;
184
+ };
185
+
186
+ struct TestExpectedValues {
187
+ uint32_t expectedPacketsInUse = 0 ;
188
+ uint32_t expectedKernelCount = 0 ;
189
+ uint32_t expectedWalkerPostSyncOp = 0 ;
190
+ uint32_t expectedPostSyncPipeControls = 0 ;
191
+ bool postSyncAddressZero = false ;
192
+ };
193
+
127
194
} // namespace ult
128
195
} // namespace L0
0 commit comments