SWDEV-425248 - numerous bug fixes

https://gerrit-git.amd.com/c/compute/ec/clr/+/849086 changed stream sync behaviour and accordingly updated Unit_hipStreamCreateWithFlags_DefaultStreamInteraction.
Update error code to match for hipStreamWaitEvent.
Thread detach makes executions all async and while that is happening, It is unexpected effect for device reset so join thread is better.

Change-Id: I1affa84089626dee478d8bcc5aaa318e320fd6b0
Este commit está contenido en:
Jaydeep Patel authored and Rakesh Roy committed 2023-11-17 06:30:38 -05:00
1 padre 0f3750cf2c
commit be88e1dffc
3 files changed
+10 -7

No files matched your search

+5 -5
Ver fichero
@@ -59,10 +59,7 @@ TEST_CASE("Unit_hipStreamCreateWithFlags_Default") {
TEST_CASE("Unit_hipStreamCreateWithFlags_DefaultStreamInteraction") {
const hipStream_t defaultStream = GENERATE(static_cast<hipStream_t>(nullptr), hipStreamPerThread);
const unsigned int flagUnderTest = GENERATE(hipStreamDefault, hipStreamNonBlocking);
const hipError_t expectedError = (flagUnderTest == hipStreamDefault) && (defaultStream == nullptr)
? hipErrorNotReady
: hipSuccess;
CAPTURE(defaultStream, flagUnderTest, expectedError, hipGetErrorString(expectedError));
CAPTURE(defaultStream, flagUnderTest);
hipStream_t stream{};
HIP_CHECK(hipStreamCreateWithFlags(&stream, flagUnderTest));
@@ -70,12 +67,15 @@ TEST_CASE("Unit_hipStreamCreateWithFlags_DefaultStreamInteraction") {
constexpr auto delay = std::chrono::milliseconds(500);
SECTION("default stream waiting for created stream") {
const hipError_t expectedError = (flagUnderTest == hipStreamDefault) && (defaultStream == nullptr)
? hipErrorNotReady
: hipSuccess;
LaunchDelayKernel(delay, stream);
REQUIRE(hipStreamQuery(defaultStream) == expectedError);
}
SECTION("created stream waiting for default stream") {
LaunchDelayKernel(delay, defaultStream);
REQUIRE(hipStreamQuery(stream) == expectedError);
REQUIRE(hipStreamQuery(stream) == hipSuccess);
}
HIP_CHECK(hipDeviceSynchronize());