Skip to content

Commit bfcfdb2

Browse files
author
Hugh Delaney
committed
Add more tests for native enqueue
Check that deps work before and after standard UR enqueue calls.
1 parent 378f19c commit bfcfdb2

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

test/conformance/exp_enqueue_native/enqueue_native_cuda.cpp

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,3 +88,35 @@ TEST_P(urCudaEnqueueNativeCommandTest, Dependencies) {
8888
ASSERT_EQ(i, val);
8989
}
9090
}
91+
92+
TEST_P(urCudaEnqueueNativeCommandTest, DependenciesURBefore) {
93+
ur_event_handle_t event_1, event_2;
94+
95+
ASSERT_SUCCESS(urEnqueueUSMFill(queue, device_ptr, sizeof(val), &val,
96+
allocation_size, 0,
97+
nullptr /*phEventWaitList=*/, &event_1));
98+
99+
InteropData2 data_2{device_ptr, host_vec.data()};
100+
ASSERT_SUCCESS(urEnqueueNativeCommandExp(
101+
queue, &interop_func_2, &data_2, 0, nullptr /*phMemList=*/,
102+
nullptr /*pProperties=*/, 1, &event_1, &event_2));
103+
urQueueFinish(queue);
104+
for (auto &i : host_vec) {
105+
ASSERT_EQ(i, val);
106+
}
107+
}
108+
109+
TEST_P(urCudaEnqueueNativeCommandTest, DependenciesURAfter) {
110+
ur_event_handle_t event_1;
111+
112+
InteropData1 data_1{device_ptr};
113+
ASSERT_SUCCESS(urEnqueueNativeCommandExp(
114+
queue, &interop_func_1, &data_1, 0, nullptr /*phMemList=*/,
115+
nullptr /*pProperties=*/, 0, nullptr /*phEventWaitList=*/, &event_1));
116+
117+
urEnqueueUSMMemcpy(queue, /*blocking*/ true, host_vec.data(), device_ptr,
118+
allocation_size, 1, &event_1, nullptr);
119+
for (auto &i : host_vec) {
120+
ASSERT_EQ(i, val);
121+
}
122+
}

0 commit comments

Comments
 (0)