SWDEV-273235 - catch2 windows build (#2422)

Change-Id: I331c6c2525a65746e2d0799ec8dc2f608af1176a

[ROCm/hip commit: 0d361c5621]
This commit is contained in:
agunashe
2021-11-25 22:22:46 -08:00
committed by GitHub
parent 6a5e1ea51e
commit e90cc323e3
16 changed files with 178 additions and 71 deletions
@@ -4,14 +4,20 @@ set(TEST_SRC
hipStreamGetFlags.cc
hipStreamGetPriority.cc
hipMultiStream.cc
hipStreamACb_MultiThread.cc
hipStreamAddCallback.cc
hipStreamCreateWithFlags.cc
hipStreamCreateWithPriority.cc
hipStreamWithCUMask.cc
hipStreamGetCUMask.cc
hipAPIStreamDisable.cc
)
#skipped in windows - duplicate HipTest::vector_square sym (compiler issue)
if(UNIX)
set(TEST_SRC ${TEST_SRC}
hipStreamWithCUMask.cc
hipStreamACb_MultiThread.cc)
endif()
else()
set(TEST_SRC
hipStreamCreate.cc
@@ -26,7 +26,8 @@ Testcase Scenarios :
#include <hip_test_common.hh>
#include <hip_test_kernels.hh>
#include <unistd.h>
#include <chrono>
#include <thread>
#define UNUSED(expr) do { (void)(expr); } while (0)
@@ -89,7 +90,7 @@ bool testStreamCallbackFunctionality(bool isDefault) {
HIP_CHECK(hipMemcpyAsync(C_h, C_d, Nbytes, hipMemcpyDeviceToHost,
0));
HIP_CHECK(hipStreamAddCallback(0, Callback, nullptr, 0));
while (!gcbDone) usleep(100000); // Sleep for 100 ms
while (!gcbDone) std::this_thread::sleep_for(std::chrono::microseconds(100000)); // Sleep for 100 ms
} else {
hipStream_t mystream;
HIP_CHECK(hipStreamCreateWithFlags(&mystream, hipStreamNonBlocking));
@@ -105,7 +106,7 @@ bool testStreamCallbackFunctionality(bool isDefault) {
HIP_CHECK(hipMemcpyAsync(C_h, C_d, Nbytes, hipMemcpyDeviceToHost,
mystream));
HIP_CHECK(hipStreamAddCallback(mystream, Callback, nullptr, 0));
while (!gcbDone) usleep(100000); // Sleep for 100 ms
while (!gcbDone) std::this_thread::sleep_for(std::chrono::microseconds(100000)); // Sleep for 100 ms
HIP_CHECK(hipStreamDestroy(mystream));
}
HIP_CHECK(hipFree(reinterpret_cast<void*>(C_d)));
@@ -192,7 +193,7 @@ TEST_CASE("Unit_hipStreamAddCallback_ParamTst") {
HIP_CHECK(hipStreamAddCallback(mystream, Callback_ChkUsrdataPtr,
gusrptr, 0));
while (!gcbDone) {
usleep(100000); // Sleep for 100 ms
std::this_thread::sleep_for(std::chrono::microseconds(100000)); // Sleep for 100 ms
}
REQUIRE_FALSE(!gPassed);
}
@@ -204,7 +205,7 @@ TEST_CASE("Unit_hipStreamAddCallback_ParamTst") {
HIP_CHECK(hipStreamAddCallback(mystream, Callback_ChkStreamValue,
nullptr, 0));
while (!gcbDone) {
usleep(100000); // Sleep for 100 ms
std::this_thread::sleep_for(std::chrono::microseconds(100000)); // Sleep for 100 ms
}
REQUIRE_FALSE(!gPassed);
}
@@ -36,7 +36,8 @@ are ignored and hipExtStreamCreateWithCUMask must return hipSuccess.
#include <hip_test_common.hh>
#include <hip_test_kernels.hh>
#include <unistd.h>
#include <chrono>
#include <thread>
#include <iostream>
#include <vector>
@@ -159,7 +160,7 @@ TEST_CASE("Unit_hipExtStreamCreateWithCUMask_ValidateCallbackFunc") {
HIP_CHECK(hipMemcpyAsync(C_h, C_d, Nbytes, hipMemcpyDeviceToHost,
mystream));
HIP_CHECK(hipStreamAddCallback(mystream, Callback, nullptr, 0));
while (!cbDone) usleep(100000); // Sleep for 100 ms
while (!cbDone) std::this_thread::sleep_for(std::chrono::microseconds(100000)); // Sleep for 100 ms
HIP_CHECK(hipStreamDestroy(mystream));
HIP_CHECK(hipFree(reinterpret_cast<void*>(C_d)));
HIP_CHECK(hipFree(reinterpret_cast<void*>(A_d)));