Skip to content

Commit f7dbe90

Browse files
committed
Temporary test with no kernels
1 parent 34e4196 commit f7dbe90

File tree

2 files changed

+53
-0
lines changed

2 files changed

+53
-0
lines changed

test/adapters/level_zero/CMakeLists.txt

+12
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,18 @@ function(add_adapter_tests adapter)
9696
target_link_libraries(test-adapter-${adapter}_ipc PRIVATE
9797
ur_umf
9898
)
99+
100+
add_adapter_test(${adapter}_enqueue_alloc_no_kernels
101+
FIXTURE DEVICES
102+
SOURCES
103+
enqueue_alloc_no_kernels.cpp
104+
ENVIRONMENT
105+
"UR_ADAPTERS_FORCE_LOAD=\"$<TARGET_FILE:ur_adapter_${adapter}>\""
106+
)
107+
108+
target_link_libraries(test-adapter-${adapter}_enqueue_alloc_no_kernels PRIVATE
109+
ur_umf
110+
)
99111
endif()
100112
endfunction()
101113

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
// Copyright (C) 2024 Intel Corporation
2+
// Part of the Unified-Runtime Project, under the Apache License v2.0 with LLVM Exceptions.
3+
// See LICENSE.TXT
4+
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
5+
6+
#include <uur/fixtures.h>
7+
8+
// using urL0EnqueueAllocTest = uur::urQueueTest;
9+
struct urL0EnqueueAllocTest : uur::urQueueTest {
10+
void ValidateEnqueueFree(void *ptr) {
11+
ur_event_handle_t freeEvent = nullptr;
12+
ASSERT_NE(ptr, nullptr);
13+
ASSERT_SUCCESS(
14+
urEnqueueUSMFreeExp(queue, nullptr, ptr, 0, nullptr, &freeEvent));
15+
ASSERT_NE(freeEvent, nullptr);
16+
ASSERT_SUCCESS(urQueueFinish(queue));
17+
}
18+
19+
static constexpr uint32_t DATA = 0xC0FFEE;
20+
};
21+
22+
UUR_INSTANTIATE_DEVICE_TEST_SUITE_P(urL0EnqueueAllocTest);
23+
24+
TEST_P(urL0EnqueueAllocTest, SuccessHost) {
25+
ur_device_usm_access_capability_flags_t hostUSMSupport = 0;
26+
ASSERT_SUCCESS(uur::GetDeviceUSMHostSupport(device, hostUSMSupport));
27+
if (!hostUSMSupport) {
28+
GTEST_SKIP() << "Host USM is not supported.";
29+
}
30+
31+
void *ptr = nullptr;
32+
ur_event_handle_t allocEvent = nullptr;
33+
ASSERT_SUCCESS(urEnqueueUSMHostAllocExp(queue, nullptr, sizeof(uint32_t),
34+
nullptr, 0, nullptr, &ptr,
35+
&allocEvent));
36+
ASSERT_SUCCESS(urQueueFinish(queue));
37+
ASSERT_NE(ptr, nullptr);
38+
ASSERT_NE(allocEvent, nullptr);
39+
*(uint32_t *)ptr = DATA;
40+
ValidateEnqueueFree(ptr);
41+
}

0 commit comments

Comments
 (0)