Skip to content

Commit 77103bf

Browse files
Add improvements to level zero black box tests
destroy event and event pool resources destroy kernel and module resources pass context handle as reference change function variable's name and comments to kernel change variable names to more appropriate drop driver from function argument in image test Signed-off-by: Zbigniew Zdanowicz <[email protected]>
1 parent 601ace6 commit 77103bf

14 files changed

+94
-69
lines changed

level_zero/core/test/black_box_tests/zello_commandlist_immediate.cpp

Lines changed: 24 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,10 @@ void testAppendMemoryCopy(ze_context_handle_t &context, ze_device_handle_t &devi
7474
if (sharedCmdList == nullptr) {
7575
SUCCESS_OR_TERMINATE(zeCommandListDestroy(cmdList));
7676
}
77+
SUCCESS_OR_TERMINATE(zeEventDestroy(event));
78+
SUCCESS_OR_TERMINATE(zeEventDestroy(event2));
79+
SUCCESS_OR_TERMINATE(zeEventPoolDestroy(eventPool));
80+
SUCCESS_OR_TERMINATE(zeEventPoolDestroy(eventPool2));
7781
}
7882

7983
void testAppendMemoryCopyRegion(ze_context_handle_t &context, ze_device_handle_t &device, bool useSyncCmdQ, bool &validRet, ze_command_list_handle_t &sharedCmdList) {
@@ -216,14 +220,18 @@ void testAppendMemoryCopyRegion(ze_context_handle_t &context, ze_device_handle_t
216220
if (sharedCmdList == nullptr) {
217221
SUCCESS_OR_TERMINATE(zeCommandListDestroy(cmdList));
218222
}
223+
SUCCESS_OR_TERMINATE(zeEventDestroy(event));
224+
SUCCESS_OR_TERMINATE(zeEventDestroy(event2));
225+
SUCCESS_OR_TERMINATE(zeEventPoolDestroy(eventPool));
226+
SUCCESS_OR_TERMINATE(zeEventPoolDestroy(eventPool2));
219227
}
220228

221-
void testAppendGpuFunction(ze_context_handle_t &context, ze_device_handle_t &device, bool useSyncCmdQ, bool &validRet, ze_command_list_handle_t &sharedCmdList) {
229+
void testAppendGpuKernel(ze_context_handle_t &context, ze_device_handle_t &device, bool useSyncCmdQ, bool &validRet, ze_command_list_handle_t &sharedCmdList) {
222230
constexpr size_t allocSize = 4096;
223231
constexpr size_t bytesPerThread = sizeof(char);
224232
constexpr size_t numThreads = allocSize / bytesPerThread;
225233
ze_module_handle_t module;
226-
ze_kernel_handle_t function;
234+
ze_kernel_handle_t kernel;
227235
ze_command_list_handle_t cmdList;
228236
ze_event_pool_handle_t eventPool, eventPool2;
229237
ze_event_handle_t event, event2;
@@ -245,21 +253,21 @@ void testAppendGpuFunction(ze_context_handle_t &context, ze_device_handle_t &dev
245253
moduleDesc.inputSize = moduleBinary.size();
246254
SUCCESS_OR_TERMINATE(zeModuleCreate(context, device, &moduleDesc, &module, nullptr));
247255

248-
ze_kernel_desc_t functionDesc = {ZE_STRUCTURE_TYPE_KERNEL_DESC};
249-
functionDesc.pKernelName = "memcpy_bytes";
250-
SUCCESS_OR_TERMINATE(zeKernelCreate(module, &functionDesc, &function));
256+
ze_kernel_desc_t kernelDesc = {ZE_STRUCTURE_TYPE_KERNEL_DESC};
257+
kernelDesc.pKernelName = "memcpy_bytes";
258+
SUCCESS_OR_TERMINATE(zeKernelCreate(module, &kernelDesc, &kernel));
251259

252260
uint32_t groupSizeX = 32u;
253261
uint32_t groupSizeY = 1u;
254262
uint32_t groupSizeZ = 1u;
255-
SUCCESS_OR_TERMINATE(zeKernelSuggestGroupSize(function, numThreads, 1U, 1U, &groupSizeX,
263+
SUCCESS_OR_TERMINATE(zeKernelSuggestGroupSize(kernel, numThreads, 1U, 1U, &groupSizeX,
256264
&groupSizeY, &groupSizeZ));
257265
SUCCESS_OR_TERMINATE_BOOL(numThreads % groupSizeX == 0);
258266
if (verbose) {
259267
std::cout << "Group size : (" << groupSizeX << ", " << groupSizeY << ", " << groupSizeZ
260268
<< ")" << std::endl;
261269
}
262-
SUCCESS_OR_TERMINATE(zeKernelSetGroupSize(function, groupSizeX, groupSizeY, groupSizeZ));
270+
SUCCESS_OR_TERMINATE(zeKernelSetGroupSize(kernel, groupSizeX, groupSizeY, groupSizeZ));
263271

264272
if (sharedCmdList == nullptr) {
265273
ze_command_queue_desc_t cmdQueueDesc = {ZE_STRUCTURE_TYPE_COMMAND_QUEUE_DESC};
@@ -320,8 +328,8 @@ void testAppendGpuFunction(ze_context_handle_t &context, ze_device_handle_t &dev
320328
SUCCESS_OR_TERMINATE(zeEventHostReset(event2));
321329
}
322330

323-
SUCCESS_OR_TERMINATE(zeKernelSetArgumentValue(function, 0, sizeof(dstBuffer), &dstBuffer));
324-
SUCCESS_OR_TERMINATE(zeKernelSetArgumentValue(function, 1, sizeof(srcBuffer), &srcBuffer));
331+
SUCCESS_OR_TERMINATE(zeKernelSetArgumentValue(kernel, 0, sizeof(dstBuffer), &dstBuffer));
332+
SUCCESS_OR_TERMINATE(zeKernelSetArgumentValue(kernel, 1, sizeof(srcBuffer), &srcBuffer));
325333

326334
ze_group_count_t dispatchTraits;
327335
dispatchTraits.groupCountX = numThreads / groupSizeX;
@@ -333,7 +341,7 @@ void testAppendGpuFunction(ze_context_handle_t &context, ze_device_handle_t &dev
333341
<< std::endl;
334342
}
335343
SUCCESS_OR_TERMINATE_BOOL(dispatchTraits.groupCountX * groupSizeX == allocSize);
336-
SUCCESS_OR_TERMINATE(zeCommandListAppendLaunchKernel(cmdList, function, &dispatchTraits,
344+
SUCCESS_OR_TERMINATE(zeCommandListAppendLaunchKernel(cmdList, kernel, &dispatchTraits,
337345
useSyncCmdQ ? nullptr : event, 0, nullptr));
338346
if (!useSyncCmdQ) {
339347
// If Async mode, use event for syncing copies
@@ -364,7 +372,11 @@ void testAppendGpuFunction(ze_context_handle_t &context, ze_device_handle_t &dev
364372
SUCCESS_OR_TERMINATE(zeCommandListDestroy(cmdList));
365373
}
366374

367-
SUCCESS_OR_TERMINATE(zeKernelDestroy(function));
375+
SUCCESS_OR_TERMINATE(zeEventDestroy(event));
376+
SUCCESS_OR_TERMINATE(zeEventDestroy(event2));
377+
SUCCESS_OR_TERMINATE(zeEventPoolDestroy(eventPool));
378+
SUCCESS_OR_TERMINATE(zeEventPoolDestroy(eventPool2));
379+
SUCCESS_OR_TERMINATE(zeKernelDestroy(kernel));
368380
SUCCESS_OR_TERMINATE(zeModuleDestroy(module));
369381
}
370382

@@ -409,10 +421,9 @@ int main(int argc, char *argv[]) {
409421
printResult(aubMode, outputValidationSuccessful, blackBoxName, currentTest);
410422
}
411423

412-
outputValidationSuccessful = true;
413424
if (outputValidationSuccessful || aubMode) {
414425
currentTest = "Launch GPU Kernel";
415-
testAppendGpuFunction(context, device0, useSyncQueue, outputValidationSuccessful, cmdList);
426+
testAppendGpuKernel(context, device0, useSyncQueue, outputValidationSuccessful, cmdList);
416427
printResult(aubMode, outputValidationSuccessful, blackBoxName, currentTest);
417428
}
418429

level_zero/core/test/black_box_tests/zello_copy.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
#include <iomanip>
1111

12-
void testAppendMemoryCopyFromHeapToDeviceToStack(ze_context_handle_t context, ze_device_handle_t &device, bool &validRet) {
12+
void testAppendMemoryCopyFromHeapToDeviceToStack(ze_context_handle_t &context, ze_device_handle_t &device, bool &validRet) {
1313
const size_t allocSize = 4096 + 7; // +7 to break alignment and make it harder
1414
char *heapBuffer = new char[allocSize];
1515
void *zeBuffer = nullptr;
@@ -57,7 +57,7 @@ void testAppendMemoryCopyFromHeapToDeviceToStack(ze_context_handle_t context, ze
5757
SUCCESS_OR_TERMINATE(zeCommandQueueDestroy(cmdQueue));
5858
}
5959

60-
void testAppendMemoryCopyFromHostToDeviceToStack(ze_context_handle_t context, ze_device_handle_t &device, bool &validRet) {
60+
void testAppendMemoryCopyFromHostToDeviceToStack(ze_context_handle_t &context, ze_device_handle_t &device, bool &validRet) {
6161
const size_t allocSize = 4096 + 7; // +7 to break alignment and make it harder
6262
char *hostBuffer;
6363
void *zeBuffer = nullptr;
@@ -111,7 +111,7 @@ void testAppendMemoryCopyFromHostToDeviceToStack(ze_context_handle_t context, ze
111111
SUCCESS_OR_TERMINATE(zeCommandQueueDestroy(cmdQueue));
112112
}
113113

114-
void testAppendMemoryCopy2DRegion(ze_context_handle_t context, ze_device_handle_t &device, bool &validRet) {
114+
void testAppendMemoryCopy2DRegion(ze_context_handle_t &context, ze_device_handle_t &device, bool &validRet) {
115115
validRet = true;
116116

117117
ze_command_queue_handle_t cmdQueue;
@@ -220,7 +220,7 @@ void testAppendMemoryCopy2DRegion(ze_context_handle_t context, ze_device_handle_
220220
SUCCESS_OR_TERMINATE(zeCommandQueueDestroy(cmdQueue));
221221
}
222222

223-
void testMemoryFillWithWordSizedPattern(ze_context_handle_t context, ze_device_handle_t &device, bool &validRet) {
223+
void testMemoryFillWithWordSizedPattern(ze_context_handle_t &context, ze_device_handle_t &device, bool &validRet) {
224224
const size_t allocSize = 10;
225225
char pattern[] = {'\001', '\002'};
226226
void *zeBuffer = nullptr;
@@ -273,7 +273,7 @@ void testMemoryFillWithWordSizedPattern(ze_context_handle_t context, ze_device_h
273273
SUCCESS_OR_TERMINATE(zeCommandQueueDestroy(cmdQueue));
274274
}
275275

276-
void testAppendMemoryFillWithSomePattern(ze_context_handle_t context, ze_device_handle_t &device, bool &validRet) {
276+
void testAppendMemoryFillWithSomePattern(ze_context_handle_t &context, ze_device_handle_t &device, bool &validRet) {
277277
const size_t allocSize = 4096 + 7;
278278

279279
char pattern0 = 5;
@@ -364,7 +364,7 @@ void testAppendMemoryFillWithSomePattern(ze_context_handle_t context, ze_device_
364364
SUCCESS_OR_TERMINATE(zeCommandQueueDestroy(cmdQueue));
365365
}
366366

367-
void testAppendMemoryCopy3DRegion(ze_context_handle_t context, ze_device_handle_t &device, bool &validRet) {
367+
void testAppendMemoryCopy3DRegion(ze_context_handle_t &context, ze_device_handle_t &device, bool &validRet) {
368368
validRet = true;
369369

370370
ze_command_queue_handle_t cmdQueue;

level_zero/core/test/black_box_tests/zello_copy_fence.cpp

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
void testAppendMemoryCopy(ze_context_handle_t &context, ze_device_handle_t &device, bool &validRet) {
1818
const size_t allocSize = 4096;
1919
char *heapBuffer = new char[allocSize];
20-
void *xeBuffer = nullptr;
20+
void *zeBuffer = nullptr;
2121
char stackBuffer[allocSize];
2222

2323
ze_command_queue_handle_t cmdQueue = nullptr;
@@ -44,42 +44,42 @@ void testAppendMemoryCopy(ze_context_handle_t &context, ze_device_handle_t &devi
4444
deviceDesc.flags = 0;
4545
deviceDesc.pNext = nullptr;
4646
deviceDesc.ordinal = 0;
47-
SUCCESS_OR_TERMINATE(zeMemAllocDevice(context, &deviceDesc, allocSize, allocSize, device, &xeBuffer));
47+
SUCCESS_OR_TERMINATE(zeMemAllocDevice(context, &deviceDesc, allocSize, allocSize, device, &zeBuffer));
4848

4949
for (size_t i = 0; i < allocSize; ++i) {
5050
heapBuffer[i] = static_cast<char>(i + 1);
5151
}
5252
memset(stackBuffer, 0, allocSize);
5353

54-
ze_fence_handle_t hFence = {};
54+
ze_fence_handle_t fence = {};
5555
ze_fence_desc_t fenceDesc = {};
5656
fenceDesc.stype = ZE_STRUCTURE_TYPE_FENCE_DESC;
5757
fenceDesc.pNext = nullptr;
5858
fenceDesc.flags = 0;
59-
SUCCESS_OR_TERMINATE(zeFenceCreate(cmdQueue, &fenceDesc, &hFence));
59+
SUCCESS_OR_TERMINATE(zeFenceCreate(cmdQueue, &fenceDesc, &fence));
6060
for (int i = 0; i < 2; i++) {
6161
if (verbose)
6262
std::cout << "zeFenceHostSynchronize start iter:" << i << std::endl;
6363
// Copy from heap to device-allocated memory
64-
SUCCESS_OR_TERMINATE(zeCommandListAppendMemoryCopy(cmdList, xeBuffer, heapBuffer, allocSize,
64+
SUCCESS_OR_TERMINATE(zeCommandListAppendMemoryCopy(cmdList, zeBuffer, heapBuffer, allocSize,
6565
nullptr, 0, nullptr));
6666
// Copy from device-allocated memory to stack
67-
SUCCESS_OR_TERMINATE(zeCommandListAppendMemoryCopy(cmdList, stackBuffer, xeBuffer, allocSize,
67+
SUCCESS_OR_TERMINATE(zeCommandListAppendMemoryCopy(cmdList, stackBuffer, zeBuffer, allocSize,
6868
nullptr, 0, nullptr));
6969
SUCCESS_OR_TERMINATE(zeCommandListClose(cmdList));
70-
SUCCESS_OR_TERMINATE(zeCommandQueueExecuteCommandLists(cmdQueue, 1, &cmdList, hFence));
71-
SUCCESS_OR_TERMINATE(zeFenceHostSynchronize(hFence, std::numeric_limits<uint64_t>::max()));
70+
SUCCESS_OR_TERMINATE(zeCommandQueueExecuteCommandLists(cmdQueue, 1, &cmdList, fence));
71+
SUCCESS_OR_TERMINATE(zeFenceHostSynchronize(fence, std::numeric_limits<uint64_t>::max()));
7272
if (verbose)
7373
std::cout << "zeFenceHostSynchronize success iter:" << i << std::endl;
74-
SUCCESS_OR_TERMINATE(zeFenceReset(hFence));
74+
SUCCESS_OR_TERMINATE(zeFenceReset(fence));
7575
SUCCESS_OR_TERMINATE(zeCommandListReset(cmdList));
7676
}
7777
// Validate stack and xe buffers have the original data from heapBuffer
7878
validRet = (0 == memcmp(heapBuffer, stackBuffer, allocSize));
7979

8080
delete[] heapBuffer;
81-
SUCCESS_OR_TERMINATE(zeMemFree(context, xeBuffer));
82-
SUCCESS_OR_TERMINATE(zeFenceDestroy(hFence));
81+
SUCCESS_OR_TERMINATE(zeMemFree(context, zeBuffer));
82+
SUCCESS_OR_TERMINATE(zeFenceDestroy(fence));
8383
SUCCESS_OR_TERMINATE(zeCommandListDestroy(cmdList));
8484
SUCCESS_OR_TERMINATE(zeCommandQueueDestroy(cmdQueue));
8585
}

level_zero/core/test/black_box_tests/zello_copy_kernel_printf.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,11 +105,11 @@ int main(int argc, char *argv[]) {
105105
allocSize, nullptr,
106106
0, nullptr));
107107

108-
// copying of data must finish before running the user function
108+
// copying of data must finish before running the user kernel
109109
SUCCESS_OR_TERMINATE(zeCommandListAppendBarrier(
110110
cmdList, nullptr, 0, nullptr));
111111

112-
// 3. Encode run user function
112+
// 3. Set arguments for user kernel
113113
SUCCESS_OR_TERMINATE(zeKernelSetArgumentValue(kernel, 0, sizeof(dstBuffer), &dstBuffer));
114114
SUCCESS_OR_TERMINATE(zeKernelSetArgumentValue(kernel, 1, sizeof(srcBuffer), &srcBuffer));
115115

level_zero/core/test/black_box_tests/zello_dyn_local_arg.cpp

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -66,19 +66,19 @@ void createModule(ze_module_handle_t &module, ze_context_handle_t &context, ze_d
6666
SUCCESS_OR_TERMINATE(zeModuleCreate(context, device, &moduleDesc, &module, nullptr));
6767
}
6868

69-
void createKernel(ze_module_handle_t &module, ze_kernel_handle_t &function, size_t numThreads, uint32_t groupSizeX, uint32_t groupSizeY, uint32_t groupSizeZ) {
70-
ze_kernel_desc_t functionDesc = {ZE_STRUCTURE_TYPE_KERNEL_DESC};
71-
functionDesc.pKernelName = "local_barrier_arg";
72-
SUCCESS_OR_TERMINATE(zeKernelCreate(module, &functionDesc, &function));
69+
void createKernel(ze_module_handle_t &module, ze_kernel_handle_t &kernel, size_t numThreads, uint32_t groupSizeX, uint32_t groupSizeY, uint32_t groupSizeZ) {
70+
ze_kernel_desc_t kernelDesc = {ZE_STRUCTURE_TYPE_KERNEL_DESC};
71+
kernelDesc.pKernelName = "local_barrier_arg";
72+
SUCCESS_OR_TERMINATE(zeKernelCreate(module, &kernelDesc, &kernel));
7373

7474
// Set group sizes
75-
SUCCESS_OR_TERMINATE(zeKernelSuggestGroupSize(function, static_cast<uint32_t>(numThreads), 1U, 1U, &groupSizeX,
75+
SUCCESS_OR_TERMINATE(zeKernelSuggestGroupSize(kernel, static_cast<uint32_t>(numThreads), 1U, 1U, &groupSizeX,
7676
&groupSizeY, &groupSizeZ));
7777
if (verbose) {
7878
std::cout << "Group size : (" << groupSizeX << ", " << groupSizeY << ", " << groupSizeZ
7979
<< ")" << std::endl;
8080
}
81-
SUCCESS_OR_TERMINATE(zeKernelSetGroupSize(function, groupSizeX, groupSizeY, groupSizeZ));
81+
SUCCESS_OR_TERMINATE(zeKernelSetGroupSize(kernel, groupSizeX, groupSizeY, groupSizeZ));
8282
}
8383

8484
void createCmdQueueAndCmdList(ze_context_handle_t &context, ze_device_handle_t &device,
@@ -97,7 +97,7 @@ void createCmdQueueAndCmdList(ze_context_handle_t &context, ze_device_handle_t &
9797
bool testLocalBarrier(ze_context_handle_t &context, ze_device_handle_t &device) {
9898
constexpr size_t allocSize = sizeof(int);
9999
ze_module_handle_t module;
100-
ze_kernel_handle_t function;
100+
ze_kernel_handle_t kernel;
101101
ze_command_queue_handle_t cmdQueue;
102102
ze_command_list_handle_t cmdList;
103103
int *realResult = nullptr;
@@ -118,9 +118,9 @@ bool testLocalBarrier(ze_context_handle_t &context, ze_device_handle_t &device)
118118
ze_command_list_desc_t cmdListDesc = {ZE_STRUCTURE_TYPE_COMMAND_LIST_DESC};
119119
createCmdQueueAndCmdList(context, device, cmdQueue, cmdList, &cmdQueueDesc, &cmdListDesc);
120120

121-
// Create module and function
121+
// Create module and kernel
122122
createModule(module, context, device);
123-
createKernel(module, function, numThreadsPerGroup, groupSizeX, groupSizeY, groupSizeZ);
123+
createKernel(module, kernel, numThreadsPerGroup, groupSizeX, groupSizeY, groupSizeZ);
124124

125125
// Alloc buffers
126126
dstBuffer = nullptr;
@@ -138,17 +138,17 @@ bool testLocalBarrier(ze_context_handle_t &context, ze_device_handle_t &device)
138138
allocSize, nullptr, 0, nullptr));
139139
SUCCESS_OR_TERMINATE(zeCommandListAppendBarrier(cmdList, nullptr, 0, nullptr));
140140

141-
realResult = (int *)dstBuffer;
141+
realResult = reinterpret_cast<int *>(dstBuffer);
142142
if (verbose) {
143143
std::cerr << "Inital Gobal Memory Value " << *realResult << std::endl;
144144
}
145145

146-
// Set function args and get ready to dispatch
147-
SUCCESS_OR_TERMINATE(zeKernelSetArgumentValue(function, 0, sizeof(int), nullptr));
148-
SUCCESS_OR_TERMINATE(zeKernelSetArgumentValue(function, 1, sizeof(dstBuffer), &dstBuffer));
149-
SUCCESS_OR_TERMINATE(zeKernelSetArgumentValue(function, 2, sizeof(int), nullptr));
150-
SUCCESS_OR_TERMINATE(zeKernelSetArgumentValue(function, 3, sizeof(unsigned long), nullptr));
151-
SUCCESS_OR_TERMINATE(zeKernelSetArgumentValue(function, 4, sizeof(int), nullptr));
146+
// Set kernel args and get ready to dispatch
147+
SUCCESS_OR_TERMINATE(zeKernelSetArgumentValue(kernel, 0, sizeof(int), nullptr));
148+
SUCCESS_OR_TERMINATE(zeKernelSetArgumentValue(kernel, 1, sizeof(dstBuffer), &dstBuffer));
149+
SUCCESS_OR_TERMINATE(zeKernelSetArgumentValue(kernel, 2, sizeof(int), nullptr));
150+
SUCCESS_OR_TERMINATE(zeKernelSetArgumentValue(kernel, 3, sizeof(unsigned long), nullptr));
151+
SUCCESS_OR_TERMINATE(zeKernelSetArgumentValue(kernel, 4, sizeof(int), nullptr));
152152
ze_group_count_t dispatchTraits;
153153
dispatchTraits.groupCountX = 3u;
154154
dispatchTraits.groupCountY = 1u;
@@ -160,13 +160,13 @@ bool testLocalBarrier(ze_context_handle_t &context, ze_device_handle_t &device)
160160
}
161161

162162
SUCCESS_OR_TERMINATE(
163-
zeCommandListAppendLaunchKernel(cmdList, function, &dispatchTraits, nullptr, 0, nullptr));
163+
zeCommandListAppendLaunchKernel(cmdList, kernel, &dispatchTraits, nullptr, 0, nullptr));
164164

165165
SUCCESS_OR_TERMINATE(zeCommandListClose(cmdList));
166166
SUCCESS_OR_TERMINATE(zeCommandQueueExecuteCommandLists(cmdQueue, 1, &cmdList, nullptr));
167167
SUCCESS_OR_TERMINATE(zeCommandQueueSynchronize(cmdQueue, std::numeric_limits<uint64_t>::max()));
168168

169-
realResult = (int *)dstBuffer;
169+
realResult = reinterpret_cast<int *>(dstBuffer);
170170
if (verbose) {
171171
std::cerr << "Final Gobal Memory Value " << *realResult << std::endl;
172172
}
@@ -179,7 +179,7 @@ bool testLocalBarrier(ze_context_handle_t &context, ze_device_handle_t &device)
179179
SUCCESS_OR_TERMINATE(zeMemFree(context, dstBuffer));
180180
SUCCESS_OR_TERMINATE(zeCommandListDestroy(cmdList));
181181
SUCCESS_OR_TERMINATE(zeCommandQueueDestroy(cmdQueue));
182-
SUCCESS_OR_TERMINATE(zeKernelDestroy(function));
182+
SUCCESS_OR_TERMINATE(zeKernelDestroy(kernel));
183183
SUCCESS_OR_TERMINATE(zeModuleDestroy(module));
184184

185185
return outputValidationSuccess;

level_zero/core/test/black_box_tests/zello_image.cpp

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,7 @@
2121
(y)*channels * hostWidth + \
2222
(z)*channels * hostWidth * hostHeight]
2323

24-
void testAppendImageFunction(ze_driver_handle_t driver,
25-
ze_context_handle_t &context,
24+
void testAppendImageFunction(ze_context_handle_t &context,
2625
ze_device_handle_t &device,
2726
ze_command_queue_handle_t &cmdQueue,
2827
uint32_t cmdQueueOrdinal,
@@ -228,17 +227,17 @@ int main(int argc, char *argv[]) {
228227
std::string caseName;
229228
if (do1D) {
230229
caseName = "1D";
231-
testAppendImageFunction(driver, context, device, cmdQueue, cmdQueueOrdinal, success1D, ZE_IMAGE_TYPE_1D);
230+
testAppendImageFunction(context, device, cmdQueue, cmdQueueOrdinal, success1D, ZE_IMAGE_TYPE_1D);
232231
printResult(aubMode, success1D, blackBoxName, caseName);
233232
}
234233
if (do2D) {
235234
caseName = "2D";
236-
testAppendImageFunction(driver, context, device, cmdQueue, cmdQueueOrdinal, success2D, ZE_IMAGE_TYPE_2D);
235+
testAppendImageFunction(context, device, cmdQueue, cmdQueueOrdinal, success2D, ZE_IMAGE_TYPE_2D);
237236
printResult(aubMode, success1D, blackBoxName, caseName);
238237
}
239238
if (do3D) {
240239
caseName = "3D";
241-
testAppendImageFunction(driver, context, device, cmdQueue, cmdQueueOrdinal, success3D, ZE_IMAGE_TYPE_3D);
240+
testAppendImageFunction(context, device, cmdQueue, cmdQueueOrdinal, success3D, ZE_IMAGE_TYPE_3D);
242241
printResult(aubMode, success1D, blackBoxName, caseName);
243242
}
244243
teardown(context, cmdQueue);

0 commit comments

Comments
 (0)