Skip to content

Commit 1ad5171

Browse files
authored
[SYCL] Use urEnqueueKernelLaunchWithArgsExp in KernelCopy unit test (#20786)
Update the KernelArgsTest.KernelCopy unit test to use urEnqueueKernelLaunchWithArgsExp instead of urKernelSetArgValue.
1 parent 0cdfaee commit 1ad5171

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

sycl/unittests/kernel-and-program/KernelArgs.cpp

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ struct KernelInfo<TestKernelWithIntPtr> : public unittest::MockKernelInfoBase {
3737

3838
private:
3939
static constexpr detail::kernel_param_desc_t IntParamDesc = {
40-
detail::kernel_param_kind_t::kind_std_layout, 0, 0};
40+
detail::kernel_param_kind_t::kind_std_layout, sizeof(int), 0};
4141
};
4242

4343
} // namespace detail
@@ -50,11 +50,13 @@ static sycl::unittest::MockDeviceImageArray<1> ImgArray{&Img};
5050

5151
static int ArgInt = 123;
5252

53-
ur_result_t redefined_urKernelSetArgValue(void *pParams) {
54-
auto params = *static_cast<ur_kernel_set_arg_value_params_t *>(pParams);
53+
ur_result_t redefined_EnqueueKernelLaunchWithArgsExp(void *pParams) {
54+
auto params =
55+
*static_cast<ur_enqueue_kernel_launch_with_args_exp_params_t *>(pParams);
56+
auto args = *params.ppArgs;
57+
int value = *static_cast<const int *>(args[0].value.value);
5558

56-
int ArgValue = *static_cast<const int *>(*params.ppArgValue);
57-
EXPECT_EQ(ArgValue, ArgInt);
59+
EXPECT_EQ(value, ArgInt);
5860

5961
return UR_RESULT_SUCCESS;
6062
}
@@ -77,8 +79,9 @@ void runKernelWithArgs(queue &Queue, int ArgI) {
7779
// of the kernel lambda is deallocated.
7880
TEST(KernelArgsTest, KernelCopy) {
7981
sycl::unittest::UrMock<> Mock;
80-
mock::getCallbacks().set_before_callback("urKernelSetArgValue",
81-
&redefined_urKernelSetArgValue);
82+
mock::getCallbacks().set_before_callback(
83+
"urEnqueueKernelLaunchWithArgsExp",
84+
&redefined_EnqueueKernelLaunchWithArgsExp);
8285

8386
platform Plt = sycl::platform();
8487

0 commit comments

Comments
 (0)