Skip to content

Commit

Permalink
Merge pull request oneapi-src#2074 from igchor/fix_cts
Browse files Browse the repository at this point in the history
[CTS] Fix urEnqueueKernelLaunchIncrementMultiDeviceMultiThreadTest test
  • Loading branch information
pbalcer authored Sep 10, 2024
2 parents b8b76f4 + 734fe75 commit e26bba5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 20 deletions.
4 changes: 4 additions & 0 deletions test/conformance/enqueue/enqueue_adapter_level_zero_v2.match
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ urEnqueueKernelLaunchKernelSubGroupTest.Success/Intel_R__oneAPI_Unified_Runtime_
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
{{OPT}}urEnqueueKernelLaunchIncrementMultiDeviceMultiThreadTest.Success/NoUseEventsNoQueuePerThread
urEnqueueMemBufferCopyRectTestWithParam.Success/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}___copy_whole_buffer_2D
urEnqueueMemBufferCopyRectTestWithParam.Success/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}___copy_non_zero_offsets_2D
urEnqueueMemBufferCopyRectTestWithParam.Success/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}___copy_different_buffer_sizes_2D
Expand Down
23 changes: 3 additions & 20 deletions test/conformance/enqueue/urEnqueueKernelLaunchAndMemcpyInOrder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -343,8 +343,8 @@ TEST_P(urEnqueueKernelLaunchIncrementMultiDeviceMultiThreadTest, Success) {
constexpr size_t n_dimensions = 1;

auto queue = queuePerThread ? queues[i] : queues.back();
auto kernel = queuePerThread ? kernels[i] : kernels.back();
auto sharedPtr = queuePerThread ? SharedMem[i] : SharedMem.back();
auto kernel = kernels[i];
auto sharedPtr = SharedMem[i];

std::vector<uur::raii::Event> Events(numOpsPerThread + 1);
for (size_t j = 0; j < numOpsPerThread; j++) {
Expand Down Expand Up @@ -381,29 +381,12 @@ TEST_P(urEnqueueKernelLaunchIncrementMultiDeviceMultiThreadTest, Success) {
size_t ExpectedValue = InitialValue;
ExpectedValue += numOpsPerThread;
for (uint32_t j = 0; j < ArraySize; ++j) {
if (queuePerThread) {
ASSERT_EQ(data[j], ExpectedValue);
} else {
// All threads write to the same memory, so the value might be greater
ASSERT_GE(data[j], ExpectedValue);
}
ASSERT_EQ(data[j], ExpectedValue);
}
});
}

for (auto &thread : threads) {
thread.join();
}

if (!queuePerThread) {
size_t ExpectedValue = InitialValue;
ExpectedValue += numOpsPerThread * numThreads;

for (size_t i = 0; i < devices.size(); i++) {
for (uint32_t j = 0; j < ArraySize; ++j) {
ASSERT_EQ(reinterpret_cast<uint32_t *>(SharedMem.back())[j],
ExpectedValue);
}
}
}
}

0 comments on commit e26bba5

Please sign in to comment.