SWDEV-491253 - Create stream capture test for kernel APIs (#1189)
This commit is contained in:
@@ -213,6 +213,39 @@ TEST_CASE("Unit_hipModuleLaunchCooperativeKernel_Negative_Parameters") {
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* Test Description
|
||||
* ------------------------
|
||||
* - Test `hipModuleLaunchCooperativeKernel` when it is captured.
|
||||
* Test source
|
||||
* ------------------------
|
||||
* - unit/module/hipModuleLaunchCooperativeKernel.cc
|
||||
* Test requirements
|
||||
* ------------------------
|
||||
* - HIP_VERSION >= 5.5
|
||||
*/
|
||||
TEST_CASE("Unit_hipModuleLaunchCooperativeKernel_Verify_Capture") {
|
||||
if (!DeviceAttributesSupport(0, hipDeviceAttributeCooperativeLaunch)) {
|
||||
HipTest::HIP_SKIP_TEST("CooperativeLaunch not supported");
|
||||
return;
|
||||
}
|
||||
|
||||
auto mg = ModuleGuard::InitModule("launch_kernel_module.code");
|
||||
|
||||
hipStream_t stream;
|
||||
HIP_CHECK(hipStreamCreate(&stream));
|
||||
GENERATE_CAPTURE();
|
||||
BEGIN_CAPTURE(stream);
|
||||
|
||||
hipFunction_t f = GetKernel(mg.module(), "CoopKernel");
|
||||
HIP_CHECK(hipModuleLaunchCooperativeKernel(f, 2, 2, 1, 1, 1, 1, 0, stream, nullptr));
|
||||
|
||||
END_CAPTURE(stream);
|
||||
|
||||
HIP_CHECK(hipDeviceSynchronize());
|
||||
HIP_CHECK(hipStreamDestroy(stream));
|
||||
}
|
||||
|
||||
/**
|
||||
* End doxygen group ModuleTest.
|
||||
* @}
|
||||
|
||||
@@ -318,3 +318,21 @@ TEST_CASE("Unit_hipModuleLaunchKernel_Fntl") {
|
||||
REQUIRE(testStatus == true);
|
||||
}
|
||||
}
|
||||
|
||||
TEST_CASE("Unit_hipModuleLaunchKernel_Verify_Capture") {
|
||||
hipStream_t stream;
|
||||
HIP_CHECK(hipStreamCreate(&stream));
|
||||
|
||||
auto mg = ModuleGuard::InitModule("launch_kernel_module.code");
|
||||
|
||||
GENERATE_CAPTURE();
|
||||
BEGIN_CAPTURE(stream);
|
||||
|
||||
hipFunction_t f = GetKernel(mg.module(), "NOPKernel");
|
||||
HIP_CHECK(hipModuleLaunchKernel(f, 1, 1, 1, 1, 1, 1, 0, stream, nullptr, nullptr));
|
||||
|
||||
END_CAPTURE(stream);
|
||||
|
||||
HIP_CHECK(hipDeviceSynchronize());
|
||||
HIP_CHECK(hipStreamDestroy(stream));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user