Skip to content

Commit 9d46351

Browse files
committed
Remove L0 limitation from command-buffer update CTS tests
The command-buffer kernel update CTS tests currently assume that L0 doesn't support updating the ND-Range configuration of kernels in a command-buffer. This is no longer the case, and the skips in these situations can be removed. This patch also contains tweaks to the tests to address issues hidden while the tests were skipped on Level Zero.
1 parent 8e47ab5 commit 9d46351

File tree

4 files changed

+31
-49
lines changed

4 files changed

+31
-49
lines changed

test/conformance/exp_command_buffer/buffer_fill_kernel_update.cpp

Lines changed: 19 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -148,10 +148,6 @@ TEST_P(BufferFillCommandTest, UpdateParameters) {
148148

149149
// Test updating the global size so that the fill outputs to a larger buffer
150150
TEST_P(BufferFillCommandTest, UpdateGlobalSize) {
151-
if (!updatable_execution_range_support) {
152-
GTEST_SKIP() << "Execution range update is not supported.";
153-
}
154-
155151
ASSERT_SUCCESS(urCommandBufferEnqueueExp(updatable_cmd_buf_handle, queue, 0,
156152
nullptr, nullptr));
157153
ASSERT_SUCCESS(urQueueFinish(queue));
@@ -208,8 +204,7 @@ TEST_P(BufferFillCommandTest, SeparateUpdateCalls) {
208204
ASSERT_SUCCESS(urQueueFinish(queue));
209205
ValidateBuffer(buffer, sizeof(val) * global_size, val);
210206

211-
size_t new_global_size =
212-
updatable_execution_range_support ? 64 : global_size;
207+
size_t new_global_size = global_size * 2;
213208
const size_t new_buffer_size = sizeof(val) * new_global_size;
214209
ASSERT_SUCCESS(urMemBufferCreate(context, UR_MEM_FLAG_READ_WRITE,
215210
new_buffer_size, nullptr, &new_buffer));
@@ -272,26 +267,24 @@ TEST_P(BufferFillCommandTest, SeparateUpdateCalls) {
272267
ASSERT_SUCCESS(urCommandBufferUpdateKernelLaunchExp(command_handle,
273268
&input_update_desc));
274269

275-
if (updatable_execution_range_support) {
276-
ur_exp_command_buffer_update_kernel_launch_desc_t
277-
global_size_update_desc = {
278-
UR_STRUCTURE_TYPE_EXP_COMMAND_BUFFER_UPDATE_KERNEL_LAUNCH_DESC, // stype
279-
nullptr, // pNext
280-
0, // numNewMemObjArgs
281-
0, // numNewPointerArgs
282-
0, // numNewValueArgs
283-
0, // newWorkDim
284-
nullptr, // pNewMemObjArgList
285-
nullptr, // pNewPointerArgList
286-
nullptr, // pNewValueArgList
287-
nullptr, // pNewGlobalWorkOffset
288-
&new_global_size, // pNewGlobalWorkSize
289-
nullptr, // pNewLocalWorkSize
290-
};
291-
292-
ASSERT_SUCCESS(urCommandBufferUpdateKernelLaunchExp(
293-
command_handle, &global_size_update_desc));
294-
}
270+
size_t new_local_size = local_size;
271+
ur_exp_command_buffer_update_kernel_launch_desc_t global_size_update_desc = {
272+
UR_STRUCTURE_TYPE_EXP_COMMAND_BUFFER_UPDATE_KERNEL_LAUNCH_DESC, // stype
273+
nullptr, // pNext
274+
0, // numNewMemObjArgs
275+
0, // numNewPointerArgs
276+
0, // numNewValueArgs
277+
static_cast<uint32_t>(n_dimensions), // newWorkDim
278+
nullptr, // pNewMemObjArgList
279+
nullptr, // pNewPointerArgList
280+
nullptr, // pNewValueArgList
281+
nullptr, // pNewGlobalWorkOffset
282+
&new_global_size, // pNewGlobalWorkSize
283+
&new_local_size, // pNewLocalWorkSize
284+
};
285+
286+
ASSERT_SUCCESS(urCommandBufferUpdateKernelLaunchExp(
287+
command_handle, &global_size_update_desc));
295288

296289
ASSERT_SUCCESS(urCommandBufferEnqueueExp(updatable_cmd_buf_handle, queue, 0,
297290
nullptr, nullptr));

test/conformance/exp_command_buffer/fixtures.h

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -112,11 +112,6 @@ struct urUpdatableCommandBufferExpExecutionTest
112112
GTEST_SKIP() << "Updating EXP command-buffers is not supported.";
113113
}
114114

115-
// Currently level zero driver doesn't support updating execution range.
116-
if (backend == UR_PLATFORM_BACKEND_LEVEL_ZERO) {
117-
updatable_execution_range_support = false;
118-
}
119-
120115
// Create a command-buffer with update enabled.
121116
ur_exp_command_buffer_desc_t desc{
122117
UR_STRUCTURE_TYPE_EXP_COMMAND_BUFFER_DESC, nullptr, true};
@@ -154,7 +149,6 @@ struct urUpdatableCommandBufferExpExecutionTest
154149
}
155150

156151
ur_exp_command_buffer_handle_t updatable_cmd_buf_handle = nullptr;
157-
ur_bool_t updatable_execution_range_support = true;
158152
ur_queue_handle_t queue = nullptr;
159153
};
160154

test/conformance/exp_command_buffer/ndrange_update.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,6 @@ struct NDRangeUpdateTest
1515
UUR_RETURN_ON_FATAL_FAILURE(
1616
urUpdatableCommandBufferExpExecutionTest::SetUp());
1717

18-
if (!updatable_execution_range_support) {
19-
GTEST_SKIP() << "Execution range update is not supported.";
20-
}
21-
2218
ur_device_usm_access_capability_flags_t shared_usm_flags;
2319
ASSERT_SUCCESS(
2420
uur::GetDeviceUSMSingleSharedSupport(device, shared_usm_flags));

test/conformance/exp_command_buffer/usm_fill_kernel_update.cpp

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,7 @@ TEST_P(USMFillCommandTest, UpdateParameters) {
8888
Validate((uint32_t *)shared_ptr, global_size, val);
8989

9090
// Allocate a new USM pointer of larger size if feature is supported.
91-
size_t new_global_size =
92-
updatable_execution_range_support ? 64 : global_size;
91+
size_t new_global_size = global_size * 2;
9392
const size_t new_allocation_size = sizeof(val) * new_global_size;
9493
ASSERT_SUCCESS(urUSMSharedAlloc(context, device, nullptr, nullptr,
9594
new_allocation_size, &new_shared_ptr));
@@ -116,20 +115,20 @@ TEST_P(USMFillCommandTest, UpdateParameters) {
116115
&new_val, // hArgValue
117116
};
118117

118+
size_t new_local_size = local_size;
119119
ur_exp_command_buffer_update_kernel_launch_desc_t update_desc = {
120120
UR_STRUCTURE_TYPE_EXP_COMMAND_BUFFER_UPDATE_KERNEL_LAUNCH_DESC, // stype
121121
nullptr, // pNext
122-
0, // numNewMemObjArgs
123-
1, // numNewPointerArgs
124-
1, // numNewValueArgs
125-
0, // newWorkDim
126-
nullptr, // pNewMemObjArgList
127-
&new_output_desc, // pNewPointerArgList
128-
&new_input_desc, // pNewValueArgList
129-
nullptr, // pNewGlobalWorkOffset
130-
updatable_execution_range_support ? &new_global_size
131-
: nullptr, // pNewGlobalWorkSize
132-
nullptr, // pNewLocalWorkSize
122+
0, // numNewMemObjArgs
123+
1, // numNewPointerArgs
124+
1, // numNewValueArgs
125+
static_cast<uint32_t>(n_dimensions), // newWorkDim
126+
nullptr, // pNewMemObjArgList
127+
&new_output_desc, // pNewPointerArgList
128+
&new_input_desc, // pNewValueArgList
129+
nullptr, // pNewGlobalWorkOffset
130+
&new_global_size, // pNewGlobalWorkSize
131+
&new_local_size, // pNewLocalWorkSize
133132
};
134133

135134
// Update kernel and enqueue command-buffer again

0 commit comments

Comments
 (0)