Skip to content

Commit

Permalink
Fix issues
Browse files Browse the repository at this point in the history
  • Loading branch information
fabiomestre committed Feb 13, 2024
1 parent 0a66b8a commit 2106fe1
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 6 deletions.
2 changes: 1 addition & 1 deletion test/conformance/integration/QueueBuffer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ TEST_P(QueueBufferTestWithParam, QueueBufferTest) {

uint32_t CurValueMem1 = InitialValue;
uint32_t CurValueMem2 = InitialValue;
for (int i = 0; i < NumIterations; ++i) {
for (uint32_t i = 0; i < NumIterations; ++i) {

/* Copy from DeviceMem1 to DeviceMem2 and multiply by 2 */
ASSERT_SUCCESS(
Expand Down
10 changes: 7 additions & 3 deletions test/conformance/integration/QueueEmptyStatus.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ struct QueueEmptyStatusTestWithParam : uur::IntegrationQueueTestWithParam {
constexpr size_t global_offset = 0;
constexpr size_t n_dimensions = 1;
constexpr uint32_t num_iterations = 5;
for (int i = 0; i < num_iterations; ++i) {
for (uint32_t i = 0; i < num_iterations; ++i) {
ASSERT_SUCCESS(urEnqueueKernelLaunch(Queue, kernel, n_dimensions,
&global_offset, &ArraySize,
nullptr, 0, nullptr, &Event));
Expand All @@ -68,14 +68,18 @@ struct QueueEmptyStatusTestWithParam : uur::IntegrationQueueTestWithParam {
currentWait += step) {
std::this_thread::sleep_for(step);

uint32_t is_queue_empty;
ur_bool_t is_queue_empty;
ASSERT_SUCCESS(urQueueGetInfo(Queue, UR_QUEUE_INFO_EMPTY,
sizeof(ur_bool_t), &is_queue_empty,
nullptr));
if (is_queue_empty) {
return;
}
}

/* If we are here, the test failed. Let's call queue finish to avoid
* issues when freeing memory */
ASSERT_SUCCESS(urQueueFinish(Queue));
GTEST_FAIL();
}

Expand All @@ -97,7 +101,7 @@ TEST_P(QueueEmptyStatusTestWithParam, QueueEmptyStatusTest) {
ASSERT_NO_FATAL_FAILURE(waitUntilQueueEmpty());

constexpr size_t expected_value = 3200;
for (int i = 0; i < ArraySize; ++i) {
for (uint32_t i = 0; i < ArraySize; ++i) {
ASSERT_EQ(reinterpret_cast<uint32_t *>(SharedMem)[i], expected_value);
}
}
2 changes: 1 addition & 1 deletion test/conformance/integration/QueueUSM.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ TEST_P(QueueUSMTestWithParam, QueueUSMTest) {

std::vector<ur_event_handle_t> EventsKernel;

for (int i = 0; i < NumIterations; ++i) {
for (uint32_t i = 0; i < NumIterations; ++i) {
/* Copy from DeviceMem2 to DeviceMem1 and multiply by 2 */
ASSERT_SUCCESS(urKernelSetArgPointer(kernel, 0, nullptr, &DeviceMem1));
ASSERT_SUCCESS(urKernelSetArgPointer(kernel, 1, nullptr, &DeviceMem2));
Expand Down
6 changes: 5 additions & 1 deletion test/conformance/integration/fixtures.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
// Copyright (C) 2024 Intel Corporation
// Part of the Unified-Runtime Project, under the Apache License v2.0 with LLVM Exceptions.
// See LICENSE.TXT
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

#ifndef UR_CONFORMANCE_INTEGRATION_FIXTURES_H
#define UR_CONFORMANCE_INTEGRATION_FIXTURES_H

Expand All @@ -22,7 +27,6 @@ struct IntegrationQueueTestWithParam
for (ur_event_handle_t Event : AllEvents) {
ASSERT_SUCCESS(urEventRelease(Event));
}
ASSERT_SUCCESS(urQueueRelease(Queue));

UUR_RETURN_ON_FATAL_FAILURE(
uur::urKernelExecutionTestWithParam<ur_queue_flag_t>::TearDown());
Expand Down
3 changes: 3 additions & 0 deletions test/conformance/integration/integration_adapter_hip.match
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{{OPT}}QueueEmptyStatusTestWithParam.QueueEmptyStatusTest/AMD_HIP_BACKEND___{{.*}}___IN_ORDER_QUEUE
{{OPT}}QueueEmptyStatusTestWithParam.QueueEmptyStatusTest/AMD_HIP_BACKEND___{{.*}}___OUT_OF_ORDER_QUEUE
{{OPT}}{{Segmentation fault|Aborted}}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
QueueEmptyStatusTestWithParam.QueueEmptyStatusTest/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}___IN_ORDER_QUEUE
QueueEmptyStatusTestWithParam.QueueEmptyStatusTest/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}___OUT_OF_ORDER_QUEUE

0 comments on commit 2106fe1

Please sign in to comment.