SWDEV-273235 - catch2 windows build (#2422)
Change-Id: I331c6c2525a65746e2d0799ec8dc2f608af1176a
This commit is contained in:
@@ -9,12 +9,18 @@ set(TEST_SRC
|
||||
brev.cc
|
||||
popc.cc
|
||||
ldg.cc
|
||||
syncthreadsand.cc
|
||||
syncthreadscount.cc
|
||||
syncthreadsor.cc
|
||||
threadfence_system.cc
|
||||
)
|
||||
|
||||
# skipped for windows compiler issue - Illegal instruction detected
|
||||
if(UNIX)
|
||||
set(TEST_SRC ${TEST_SRC}
|
||||
syncthreadsand.cc
|
||||
syncthreadscount.cc
|
||||
syncthreadsor.cc)
|
||||
endif()
|
||||
|
||||
|
||||
# AMD only tests
|
||||
set(AMD_TEST_SRC
|
||||
unsafeAtomicAdd.cc
|
||||
|
||||
@@ -3,10 +3,15 @@ set(TEST_SRC
|
||||
Unit_hipEvent_Negative.cc
|
||||
Unit_hipEvent.cc
|
||||
Unit_hipEventElapsedTime.cc
|
||||
Unit_hipEventRecord.cc
|
||||
Unit_hipEventIpc.cc
|
||||
)
|
||||
|
||||
# skipped for windows due to duplicate symbols
|
||||
if(UNIX)
|
||||
set(TEST_SRC ${TEST_SRC}
|
||||
Unit_hipEventRecord.cc
|
||||
Unit_hipEventIpc.cc)
|
||||
endif()
|
||||
|
||||
hip_add_exe_to_target(NAME EventTest
|
||||
TEST_SRC ${TEST_SRC}
|
||||
TEST_TARGET_NAME build_tests)
|
||||
|
||||
@@ -5,8 +5,6 @@ set(TEST_SRC
|
||||
malloc.cc
|
||||
hipMemcpy2DToArray.cc
|
||||
hipMemcpy2DToArrayAsync.cc
|
||||
hipMemcpyPeer.cc
|
||||
hipMemcpyPeerAsync.cc
|
||||
hipMemcpy3D.cc
|
||||
hipMemcpy3DAsync.cc
|
||||
hipMemcpyParam2D.cc
|
||||
@@ -17,37 +15,25 @@ set(TEST_SRC
|
||||
hipMemcpy2DFromArrayAsync.cc
|
||||
hipMemcpyAtoH.cc
|
||||
hipMemcpyHtoA.cc
|
||||
hipMemcpyDtoD.cc
|
||||
hipMemcpyDtoDAsync.cc
|
||||
hipMemcpyAsync.cc
|
||||
hipMemcpy.cc
|
||||
hipMemcpyWithStream.cc
|
||||
hipMemcpyAllApiNegative.cc
|
||||
hipMemcpyWithStreamMultiThread.cc
|
||||
hipMemcpy_MultiThread.cc
|
||||
hipHostMalloc.cc
|
||||
hipHostRegister.cc
|
||||
hipMemPtrGetInfo.cc
|
||||
hipPointerGetAttributes.cc
|
||||
hipHostGetFlags.cc
|
||||
hipMemoryAllocateCoherent.cc
|
||||
hipMallocManaged_MultiScenario.cc
|
||||
hipMemsetInvalidPtr.cc
|
||||
hipMemset.cc
|
||||
hipMemsetAsyncMultiThread.cc
|
||||
hipMemsetAsyncAndKernel.cc
|
||||
hipMemset3D.cc
|
||||
hipMemset2D.cc
|
||||
hipMemset2DAsyncMultiThreadAndKernel.cc
|
||||
hipHostMallocTests.cc
|
||||
hipMallocConcurrency.cc
|
||||
hipMemset3DFunctional.cc
|
||||
hipMemset3DNegative.cc
|
||||
hipMemset3DRegressMultiThread.cc
|
||||
hipMallocManagedFlagsTst.cc
|
||||
hipMemPrefetchAsyncExtTsts.cc
|
||||
hipMemAdviseMmap.cc
|
||||
hipMallocManaged.cc
|
||||
hipMemCoherencyTst.cc
|
||||
)
|
||||
else()
|
||||
@@ -56,8 +42,6 @@ set(TEST_SRC
|
||||
malloc.cc
|
||||
hipMemcpy2DToArray.cc
|
||||
hipMemcpy2DToArrayAsync.cc
|
||||
hipMemcpyPeer.cc
|
||||
hipMemcpyPeerAsync.cc
|
||||
hipMemcpy3D.cc
|
||||
hipMemcpy3DAsync.cc
|
||||
hipMemcpyParam2D.cc
|
||||
@@ -68,39 +52,45 @@ set(TEST_SRC
|
||||
hipMemcpy2DFromArrayAsync.cc
|
||||
hipMemcpyAtoH.cc
|
||||
hipMemcpyHtoA.cc
|
||||
hipMemcpyDtoD.cc
|
||||
hipMemcpyDtoDAsync.cc
|
||||
hipMemcpyAsync.cc
|
||||
hipMemcpy.cc
|
||||
hipMemcpyWithStream.cc
|
||||
hipMemcpyAllApiNegative.cc
|
||||
hipMemcpyWithStreamMultiThread.cc
|
||||
hipMemcpy_MultiThread.cc
|
||||
hipHostMalloc.cc
|
||||
hipHostRegister.cc
|
||||
hipHostGetFlags.cc
|
||||
hipMemoryAllocateCoherent.cc
|
||||
hipMallocManaged_MultiScenario.cc
|
||||
hipMemsetInvalidPtr.cc
|
||||
hipMemset.cc
|
||||
hipMemsetAsyncMultiThread.cc
|
||||
hipMemsetAsyncAndKernel.cc
|
||||
hipMemset3D.cc
|
||||
hipMemset2D.cc
|
||||
hipMemset2DAsyncMultiThreadAndKernel.cc
|
||||
hipHostMallocTests.cc
|
||||
hipMallocConcurrency.cc
|
||||
hipMemset3DFunctional.cc
|
||||
hipMemset3DNegative.cc
|
||||
hipMemset3DRegressMultiThread.cc
|
||||
hipMallocManagedFlagsTst.cc
|
||||
hipMemPrefetchAsyncExtTsts.cc
|
||||
hipMemAdviseMmap.cc
|
||||
hipMallocManaged.cc
|
||||
hipMemCoherencyTst.cc
|
||||
)
|
||||
endif()
|
||||
|
||||
#skipped in windows -duplicate HipTest::vectorADD sym (compiler issue)
|
||||
if(UNIX)
|
||||
set(TEST_SRC ${TEST_SRC}
|
||||
hipMemcpyPeer.cc
|
||||
hipMemcpyPeerAsync.cc
|
||||
hipMemcpyWithStream.cc
|
||||
hipMemcpyWithStreamMultiThread.cc
|
||||
hipMemsetAsyncAndKernel.cc
|
||||
hipMemset2DAsyncMultiThreadAndKernel.cc
|
||||
hipMallocManaged.cc
|
||||
hipMallocConcurrency.cc
|
||||
hipMemcpyDtoD.cc
|
||||
hipMemcpyDtoDAsync.cc
|
||||
hipMemoryAllocateCoherent.cc
|
||||
hipHostMalloc.cc
|
||||
hipMemcpy.cc
|
||||
hipMemcpyAsync.cc)
|
||||
endif()
|
||||
|
||||
hip_add_exe_to_target(NAME MemoryTest
|
||||
TEST_SRC ${TEST_SRC}
|
||||
TEST_TARGET_NAME build_tests)
|
||||
|
||||
@@ -572,7 +572,7 @@ TEMPLATE_TEST_CASE("Unit_hipMemcpy_PinnedRegMemWithKernelLaunch",
|
||||
HipTest::checkVectorADD(A_h, B_h, C_h, NUM_ELM);
|
||||
|
||||
unsigned int seed = time(0);
|
||||
HIP_CHECK(hipSetDevice(rand_r(&seed) % (numDevices-1)+1));
|
||||
HIP_CHECK(hipSetDevice(HipTest::RAND_R(&seed) % (numDevices-1)+1));
|
||||
|
||||
int device;
|
||||
hipGetDevice(&device);
|
||||
|
||||
@@ -350,7 +350,7 @@ TEMPLATE_TEST_CASE("Unit_hipMemcpyAsync_PinnedRegMemWithKernelLaunch",
|
||||
HipTest::checkVectorADD(A_h, B_h, C_h, NUM_ELM);
|
||||
|
||||
unsigned int seed = time(0);
|
||||
HIP_CHECK(hipSetDevice(rand_r(&seed) % (numDevices-1)+1));
|
||||
HIP_CHECK(hipSetDevice(HipTest::RAND_R(&seed) % (numDevices-1)+1));
|
||||
|
||||
int device;
|
||||
HIP_CHECK(hipGetDevice(&device));
|
||||
|
||||
@@ -236,7 +236,7 @@ static void seekAndSet3DArraySlice(bool bAsync) {
|
||||
|
||||
// select random slice for memset
|
||||
unsigned int seed = time(nullptr);
|
||||
int slice_index = rand_r(&seed) % ZSIZE_S;
|
||||
int slice_index = HipTest::RAND_R(&seed) % ZSIZE_S;
|
||||
|
||||
INFO("memset3d for sliceindex " << slice_index);
|
||||
|
||||
|
||||
@@ -148,7 +148,7 @@ void clusterAllocs(int numAllocs, size_t minSize, size_t maxSize) {
|
||||
}
|
||||
for (int i = 0; i < numAllocs; i++) {
|
||||
unsigned rand_seed = time(NULL);
|
||||
bool isDevice = rand_r(&rand_seed) & 0x1;
|
||||
bool isDevice = HipTest::RAND_R(&rand_seed) & 0x1;
|
||||
reference[i]._sizeBytes = zrand(maxSize - minSize) + minSize;
|
||||
|
||||
reference[i]._attrib.device = zrand(numDevices);
|
||||
|
||||
@@ -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)));
|
||||
|
||||
Reference in New Issue
Block a user