Skip to content

Commit

Permalink
Merge pull request #899 from aarongreig/aaron/remainingCLCTSDiff
Browse files Browse the repository at this point in the history
Another small batch of CTS fixes
  • Loading branch information
aarongreig authored Sep 28, 2023
2 parents 269626f + d61b8f0 commit 366bd77
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 14 deletions.
1 change: 1 addition & 0 deletions test/conformance/event/fixtures.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ struct urEventReferenceTest : uur::urProfilingQueueTest {
input.assign(count, 42);
ASSERT_SUCCESS(urEnqueueMemBufferWrite(
queue, buffer, false, 0, size, input.data(), 0, nullptr, &event));
ASSERT_SUCCESS(urEventWait(1, &event));
}

void TearDown() override {
Expand Down
2 changes: 1 addition & 1 deletion test/conformance/kernel/urKernelCreateWithNativeHandle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ struct urKernelCreateWithNativeHandleTest : uur::urKernelTest {
ur_kernel_native_properties_t properties = {
UR_STRUCTURE_TYPE_KERNEL_NATIVE_PROPERTIES, /*sType*/
nullptr, /*pNext*/
true /*isNativeHandleOwned*/
false /*isNativeHandleOwned*/
};
};
UUR_INSTANTIATE_KERNEL_TEST_SUITE_P(urKernelCreateWithNativeHandleTest);
Expand Down
8 changes: 4 additions & 4 deletions test/conformance/queue/urQueueCreateWithNativeHandle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ TEST_P(urQueueCreateWithNativeHandleTest, Success) {
&properties, &q));
ASSERT_NE(q, nullptr);

uint32_t q_size = 0;
ASSERT_SUCCESS(urQueueGetInfo(q, UR_QUEUE_INFO_SIZE, sizeof(uint32_t),
&q_size, nullptr));

ur_context_handle_t q_context = nullptr;
ASSERT_SUCCESS(urQueueGetInfo(q, UR_QUEUE_INFO_CONTEXT, sizeof(q_context),
&q_context, nullptr));
ASSERT_EQ(q_context, context);
ASSERT_SUCCESS(urQueueRelease(q));
}
23 changes: 14 additions & 9 deletions test/conformance/queue/urQueueGetInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,17 +29,22 @@ UUR_TEST_SUITE_P(urQueueGetInfoTestWithInfoParam,
TEST_P(urQueueGetInfoTestWithInfoParam, Success) {
ur_queue_info_t info_type = getParam();
size_t size = 0;
ASSERT_SUCCESS(urQueueGetInfo(queue, info_type, 0, nullptr, &size));
ASSERT_NE(size, 0);
auto result = urQueueGetInfo(queue, info_type, 0, nullptr, &size);

if (const auto expected_size = queue_info_size_map.find(info_type);
expected_size != queue_info_size_map.end()) {
ASSERT_EQ(expected_size->second, size);
}
if (result == UR_RESULT_SUCCESS) {
ASSERT_NE(size, 0);

if (const auto expected_size = queue_info_size_map.find(info_type);
expected_size != queue_info_size_map.end()) {
ASSERT_EQ(expected_size->second, size);
}

std::vector<uint8_t> data(size);
ASSERT_SUCCESS(
urQueueGetInfo(queue, info_type, size, data.data(), nullptr));
std::vector<uint8_t> data(size);
ASSERT_SUCCESS(
urQueueGetInfo(queue, info_type, size, data.data(), nullptr));
} else {
ASSERT_EQ_RESULT(result, UR_RESULT_ERROR_UNSUPPORTED_ENUMERATION);
}
}

using urQueueGetInfoTest = uur::urQueueTest;
Expand Down

0 comments on commit 366bd77

Please sign in to comment.