Skip to content

Commit

Permalink
[CTS] fix 2 errors in urEnequeuKernelLaunch on PVC
Browse files Browse the repository at this point in the history
Fix urEnqueueKernelLaunchUSMLinkedList by providing
required alignment and calling urKernelSetExecInfo.

Also, skip InvalidKernelArgs for L0 as L0
cannot check kernel arguments.
  • Loading branch information
igchor committed Oct 18, 2024
1 parent 3a8bf2c commit b3bf6f8
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/multi_device.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,4 +63,4 @@ jobs:

- name: Test adapters
working-directory: ${{github.workspace}}/build
run: env UR_CTS_ADAPTER_PLATFORM="${{matrix.adapter.platform}}" ctest -C ${{matrix.build_type}} --output-on-failure -L "conformance" -E "enqueue|kernel|program|integration|exp_command_buffer|exp_enqueue_native|exp_launch_properties|exp_usm_p2p" --timeout 180
run: env UR_CTS_ADAPTER_PLATFORM="${{matrix.adapter.platform}}" ctest -C ${{matrix.build_type}} --output-on-failure -L "conformance" -E "kernel|program|integration|exp_command_buffer|exp_enqueue_native|exp_launch_properties|exp_usm_p2p" --timeout 180
2 changes: 0 additions & 2 deletions test/conformance/enqueue/enqueue_adapter_level_zero.match
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
{{OPT}}urEnqueueKernelLaunchTest.InvalidKernelArgs/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}_
{{OPT}}urEnqueueKernelLaunchKernelWgSizeTest.Success/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}_
{{OPT}}urEnqueueKernelLaunchKernelSubGroupTest.Success/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}_
{{OPT}}urEnqueueKernelLaunchUSMLinkedList.Success/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}__UsePoolEnabled
{{OPT}}urEnqueueKernelLaunchUSMLinkedList.Success/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}__UsePoolDisabled
{{OPT}}urEnqueueMemBufferCopyRectTestWithParam.Success/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}___copy_2d_3d
{{OPT}}urEnqueueMemBufferCopyRectTestWithParam.Success/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}___copy_3d_2d
{{OPT}}urEnqueueMemBufferReadRectTestWithParam.Success/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}___write_non_zero_offsets_2D
Expand Down
2 changes: 0 additions & 2 deletions test/conformance/enqueue/enqueue_adapter_level_zero_v2.match
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
urEnqueueKernelLaunchTest.InvalidKernelArgs/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}_
urEnqueueKernelLaunchKernelWgSizeTest.Success/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}_
urEnqueueKernelLaunchWithVirtualMemory.Success/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}_
urEnqueueKernelLaunchUSMLinkedList.Success/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}___UsePoolEnabled
urEnqueueKernelLaunchUSMLinkedList.Success/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}___UsePoolDisabled
{{OPT}}urEnqueueKernelLaunchIncrementTest.Success/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}___UseEventsEnabled
{{OPT}}urEnqueueKernelLaunchIncrementTest.Success/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}___UseEventsDisabled
{{OPT}}urEnqueueKernelLaunchIncrementMultiDeviceMultiThreadTest.Success/UseEventsNoQueuePerThread
Expand Down
16 changes: 11 additions & 5 deletions test/conformance/enqueue/urEnqueueKernelLaunch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -139,8 +139,9 @@ TEST_P(urEnqueueKernelLaunchTest, InvalidKernelArgs) {
nullptr));

if (backend == UR_PLATFORM_BACKEND_CUDA ||
backend == UR_PLATFORM_BACKEND_HIP) {
GTEST_FAIL() << "AMD and Nvidia can't check kernel arguments.";
backend == UR_PLATFORM_BACKEND_HIP ||
backend == UR_PLATFORM_BACKEND_LEVEL_ZERO) {
GTEST_FAIL() << "AMD, L0 and Nvidia can't check kernel arguments.";
}

// Enqueue kernel without setting any args
Expand Down Expand Up @@ -561,16 +562,16 @@ TEST_P(urEnqueueKernelLaunchUSMLinkedList, Success) {
}

// Build linked list with USM allocations
ASSERT_SUCCESS(urUSMSharedAlloc(context, device, nullptr, pool,
sizeof(Node),
ur_usm_desc_t desc{UR_STRUCTURE_TYPE_USM_DESC, nullptr, 0, alignof(Node)};
ASSERT_SUCCESS(urUSMSharedAlloc(context, device, &desc, pool, sizeof(Node),
reinterpret_cast<void **>(&list_head)));
ASSERT_NE(list_head, nullptr);
Node *list_cur = list_head;
for (int i = 0; i < num_nodes; i++) {
list_cur->num = i * 2;
if (i < num_nodes - 1) {
ASSERT_SUCCESS(
urUSMSharedAlloc(context, device, nullptr, pool, sizeof(Node),
urUSMSharedAlloc(context, device, &desc, pool, sizeof(Node),
reinterpret_cast<void **>(&list_cur->next)));
ASSERT_NE(list_cur->next, nullptr);
} else {
Expand All @@ -579,6 +580,11 @@ TEST_P(urEnqueueKernelLaunchUSMLinkedList, Success) {
list_cur = list_cur->next;
}

ur_bool_t indirect = true;
ASSERT_SUCCESS(urKernelSetExecInfo(kernel,
UR_KERNEL_EXEC_INFO_USM_INDIRECT_ACCESS,
sizeof(indirect), nullptr, &indirect));

// Run kernel which will iterate the list and modify the values
ASSERT_SUCCESS(urKernelSetArgPointer(kernel, 0, nullptr, list_head));
ASSERT_SUCCESS(urEnqueueKernelLaunch(queue, kernel, 1, &global_offset,
Expand Down

0 comments on commit b3bf6f8

Please sign in to comment.