Skip to content

Commit a818d50

Browse files
committed
Add draft test for extension.
Signed-off-by: JackAKirk <[email protected]>
1 parent f6dd814 commit a818d50

File tree

4 files changed

+51
-0
lines changed

4 files changed

+51
-0
lines changed

test/conformance/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,7 @@ if(UR_DPCXX)
138138
add_subdirectory(integration)
139139
add_subdirectory(exp_command_buffer)
140140
add_subdirectory(exp_usm_p2p)
141+
add_subdirectory(exp_launch_attributes)
141142
else()
142143
message(WARNING
143144
"UR_DPCXX is not defined, the following conformance test executables \
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
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+
add_conformance_test_with_kernels_environment(exp_launch_attributes
7+
launch_attributes.cpp
8+
)
9+
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
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+
struct urEnqueueKernelLaunchCustomTest : uur::urKernelExecutionTest {
9+
void SetUp() override {
10+
program_name = "fill";
11+
UUR_RETURN_ON_FATAL_FAILURE(urKernelExecutionTest::SetUp());
12+
}
13+
14+
uint32_t val = 42;
15+
size_t global_size = 32;
16+
size_t global_offset = 0;
17+
size_t n_dimensions = 1;
18+
};
19+
UUR_INSTANTIATE_DEVICE_TEST_SUITE_P(urEnqueueKernelLaunchCustomTest);
20+
21+
TEST_P(urEnqueueKernelLaunchCustomTest, Success) {
22+
ur_mem_handle_t buffer = nullptr;
23+
AddBuffer1DArg(sizeof(val) * global_size, &buffer);
24+
AddPodArg(val);
25+
ASSERT_SUCCESS(urEnqueueKernelLaunch(queue, kernel, n_dimensions,
26+
&global_offset, &global_size, nullptr,
27+
0, nullptr, nullptr));
28+
29+
ur_exp_launch_attribute_t attr[1];
30+
attr[0].id = UR_EXP_LAUNCH_ATTRIBUTE_ID_CLUSTER_DIMENSION;
31+
uint32_t dims[3] = {1024, 1, 1};
32+
attr[0].value.clusterDim = dims;
33+
size_t LocalWorkSize = 5;
34+
ASSERT_SUCCESS(urEnqueueKernelLaunchCustomExp(queue, kernel, n_dimensions,
35+
&global_size, &LocalWorkSize, 1, attr,
36+
0, nullptr, nullptr));
37+
ASSERT_SUCCESS(urQueueFinish(queue));
38+
ValidateBuffer(buffer, sizeof(val) * global_size, val);
39+
}
40+

0 commit comments

Comments
 (0)