SWDEV-491253 - Create stream capture test for kernel APIs (#1189)

这个提交包含在:
vstojilj 编写, GitHub 于 2025-11-27 17:40:11 +01:00 提交
1 父节点 1c09c87cc7
当前提交 259010f2d5
6 个文件已更改
+108 -9

没有与搜索条件相匹配的文件

@@ -66,4 +66,24 @@ TEST_CASE("Unit___hipPushCallConfiguration_Positive_Basic") {
REQUIRE(block.z == 1);
REQUIRE(shmem == 1024);
REQUIRE(stream == stream_guard.stream());
}
TEST_CASE("Unit_hipLaunchByPtr_Verify_Capture") {
LinearAllocGuard<int> alloc(LinearAllocs::hipMallocManaged, 4);
hipStream_t stream;
HIP_CHECK(hipStreamCreate(&stream));
GENERATE_CAPTURE();
BEGIN_CAPTURE(stream);
HIP_CHECK(hipConfigureCall(dim3{1}, dim3{1}, 0, stream));
int* arg = alloc.ptr();
HIP_CHECK(hipSetupArgument(&arg, sizeof(int*), 0));
HIP_CHECK(hipLaunchByPtr(reinterpret_cast<void*>(kernel_42)));
END_CAPTURE(stream);
HIP_CHECK(hipDeviceSynchronize());
HIP_CHECK(hipStreamDestroy(stream));
REQUIRE(alloc.ptr()[0] == 42);
}