Catch2 Test Fixes (#2961)

* test fixes

* address PR comment

* PR comment fixing Nvidia pass

* add additional kernel launch checks

* pr comments
This commit is contained in:
Paulius Velesko
2022-10-01 01:07:25 +03:00
کامیت شده توسط GitHub
والد 609edf1c9e
کامیت da453211ed
94فایلهای تغییر یافته به همراه177 افزوده شده و 34 حذف شده
@@ -73,6 +73,7 @@ TEMPLATE_TEST_CASE("Unit_AtomicAdd_Coherentwithnounsafeflag", "",
hipLaunchKernelGGL(AtomicCheck<TestType>, dim3(1), dim3(1),
0, 0, A_d,
result_d);
HIP_CHECK(hipGetLastError());
HIP_CHECK(hipDeviceSynchronize());
bool testResult;
testResult = HipTest::assemblyFile_Verification<TestType>(
@@ -72,6 +72,7 @@ TEMPLATE_TEST_CASE("Unit_AtomicAdd_Coherentwithoutflag", "",
hipLaunchKernelGGL(AtomicCheck<TestType>, dim3(1), dim3(1),
0, 0, A_d,
result_d);
HIP_CHECK(hipGetLastError());
HIP_CHECK(hipDeviceSynchronize());
bool testResult;
testResult = HipTest::assemblyFile_Verification<TestType>(
@@ -72,6 +72,7 @@ TEMPLATE_TEST_CASE("Unit_AtomicAdd_CoherentwithUnsafeflag", "",
hipLaunchKernelGGL(AtomicCheck<TestType>, dim3(1), dim3(1),
0, 0, A_d,
result_d);
HIP_CHECK(hipGetLastError());
HIP_CHECK(hipDeviceSynchronize());
bool testResult;
@@ -73,6 +73,7 @@ TEMPLATE_TEST_CASE("Unit_AtomicAdd_NonCoherentwithnounsafeflag", "",
dim3(1), dim3(1),
0, 0, A_d,
result_d);
HIP_CHECK(hipGetLastError());
HIP_CHECK(hipDeviceSynchronize());
bool testResult;
REQUIRE(A_h[0] == INITIAL_VAL + INC_VAL);
@@ -73,6 +73,7 @@ TEMPLATE_TEST_CASE("Unit_AtomicAdd_NonCoherentwithoutflag", "",
dim3(1), dim3(1),
0, 0, A_d,
result_d);
HIP_CHECK(hipGetLastError());
HIP_CHECK(hipDeviceSynchronize());
bool testResult;
REQUIRE(A_h[0] == INITIAL_VAL + INC_VAL);
@@ -72,6 +72,7 @@ TEMPLATE_TEST_CASE("Unit_AtomicAdd_NonCoherentwithUnsafeflag", "",
hipLaunchKernelGGL(AtomicCheck<TestType>, dim3(1), dim3(1),
0, 0, A_d,
result_d);
HIP_CHECK(hipGetLastError());
HIP_CHECK(hipDeviceSynchronize());
bool testResult;
REQUIRE(A_h[0] == INITIAL_VAL + INC_VAL);
@@ -76,6 +76,7 @@ TEST_CASE("Unit_BuiltInAtomicAdd_CoherentGlobalMem") {
hipLaunchKernelGGL(AtomicAdd_GlobalMem, dim3(1), dim3(1),
0, 0, A_d,
result);
HIP_CHECK(hipGetLastError());
std::cout << "test 1" << std::endl;
HIP_CHECK(hipDeviceSynchronize());
REQUIRE(A_h[0] == INITIAL_VAL);
@@ -118,6 +119,7 @@ TEST_CASE("Unit_BuiltInAtomicAdd_NonCoherentGlobalMem") {
hipLaunchKernelGGL(AtomicAdd_GlobalMem, dim3(1), dim3(1),
0, 0, static_cast<double* >(A_d),
static_cast<double* >(result));
HIP_CHECK(hipGetLastError());
HIP_CHECK(hipDeviceSynchronize());
HIP_CHECK(hipMemcpy(B_h, result, sizeof(double), hipMemcpyDeviceToHost));
REQUIRE(A_h[0] == INITIAL_VAL + INC_VAL);
@@ -112,6 +112,7 @@ TEST_CASE("Unit_BuiltinAtomics_fmaxCoherentGlobalMem") {
HIP_CHECK(hipMalloc(reinterpret_cast<void**>(&result), sizeof(double)));
hipLaunchKernelGGL(unsafeAtomicMax_GlobalMem, dim3(1), dim3(1),
0, 0, static_cast<double* >(A_d), result);
HIP_CHECK(hipGetLastError());
HIP_CHECK(hipDeviceSynchronize());
HIP_CHECK(hipMemcpy(B_h, result, sizeof(double), hipMemcpyDeviceToHost));
REQUIRE(*B_h == 0);
@@ -159,9 +160,11 @@ TEST_CASE("Unit_BuiltinAtomics_fmaxNonCoherentGlobalFlatMem") {
if (mem_type) {
hipLaunchKernelGGL(unsafeAtomicMax_GlobalMem, dim3(1), dim3(1),
0, 0, static_cast<double* >(A_d), result);
HIP_CHECK(hipGetLastError());
} else {
hipLaunchKernelGGL(unsafeAtomicMax_FlatMem, dim3(1), dim3(1),
0, 0, static_cast<double* >(A_d), result);
HIP_CHECK(hipGetLastError());
}
HIP_CHECK(hipDeviceSynchronize());
HIP_CHECK(hipMemcpy(B_h, result, sizeof(double), hipMemcpyDeviceToHost));
@@ -112,6 +112,7 @@ TEST_CASE("Unit_BuiltinAtomics_fminCoherentGlobalMem") {
HIP_CHECK(hipMalloc(reinterpret_cast<void**>(&result), sizeof(double)));
hipLaunchKernelGGL(unsafeAtomicMin_GlobalMem, dim3(1), dim3(1),
0, 0, static_cast<double* >(A_d), result);
HIP_CHECK(hipGetLastError());
HIP_CHECK(hipDeviceSynchronize());
HIP_CHECK(hipMemcpy(B_h, result, sizeof(double), hipMemcpyDeviceToHost));
REQUIRE(*B_h == 0);
@@ -159,9 +160,11 @@ TEST_CASE("Unit_BuiltinAtomics_fminNonCoherentGlobalFlatMem") {
if (mem_type) {
hipLaunchKernelGGL(unsafeAtomicMin_GlobalMem, dim3(1), dim3(1),
0, 0, static_cast<double* >(A_d), result);
HIP_CHECK(hipGetLastError());
} else {
hipLaunchKernelGGL(unsafeAtomicMin_FlatMem, dim3(1), dim3(1),
0, 0, static_cast<double* >(A_d), result);
HIP_CHECK(hipGetLastError());
}
HIP_CHECK(hipDeviceSynchronize());
HIP_CHECK(hipMemcpy(B_h, result, sizeof(double), hipMemcpyDeviceToHost));
@@ -65,6 +65,7 @@ TEST_CASE("Unit_AnyAll_CompileTest") {
hipLaunchKernelGGL(warpvote, dim3(Num_Blocks_per_Grid), dim3(Num_Threads_per_Block), 0, 0,
device_any, device_all, pshift);
HIP_CHECK(hipGetLastError());
HIP_CHECK(
hipMemcpy(host_any, device_any, Num_Warps_per_Grid * sizeof(int), hipMemcpyDeviceToHost));
HIP_CHECK(
@@ -66,6 +66,7 @@ TEST_CASE("Unit_ballot") {
hipLaunchKernelGGL(gpu_ballot, dim3(Num_Blocks_per_Grid), dim3(Num_Threads_per_Block), 0, 0,
device_ballot, Num_Warps_per_Block, pshift);
HIP_CHECK(hipGetLastError());
HIP_CHECK(hipMemcpy(host_ballot, device_ballot, Num_Warps_per_Grid * sizeof(unsigned int),
hipMemcpyDeviceToHost));
@@ -146,6 +146,7 @@ TEST_CASE("Unit_bitExtract") {
hipLaunchKernelGGL(HIP_kernel, dim3(num_blocks), dim3(num_threads_per_block), 0, 0, deviceOut32,
deviceSrc032, deviceSrc132, deviceSrc232, deviceOut64, deviceSrc064,
deviceSrc164, deviceSrc264);
HIP_CHECK(hipGetLastError());
HIP_CHECK(hipMemcpy(hostOut32, deviceOut32, NUM * sizeof(unsigned int), hipMemcpyDeviceToHost));
@@ -158,6 +158,7 @@ TEST_CASE("Unit_bitInsert") {
hipLaunchKernelGGL(HIP_kernel, dim3(num_blocks), dim3(num_threads_per_block), 0, 0, deviceOut32,
deviceSrc032, deviceSrc132, deviceSrc232, deviceSrc332, deviceOut64,
deviceSrc064, deviceSrc164, deviceSrc264, deviceSrc364);
HIP_CHECK(hipGetLastError());
HIP_CHECK(hipMemcpy(hostOut32, deviceOut32, NUM * sizeof(unsigned int), hipMemcpyDeviceToHost));
@@ -115,6 +115,7 @@ TEST_CASE("Unit_brev") {
hipLaunchKernelGGL(HIP_kernel, dim3(WIDTH / THREADS_PER_BLOCK_X, HEIGHT / THREADS_PER_BLOCK_Y),
dim3(THREADS_PER_BLOCK_X, THREADS_PER_BLOCK_Y), 0, 0, deviceA, deviceB,
deviceC, deviceD, WIDTH, HEIGHT);
HIP_CHECK(hipGetLastError());
HIP_CHECK(hipMemcpy(hostA, deviceA, NUM * sizeof(unsigned int), hipMemcpyDeviceToHost));
@@ -136,6 +136,7 @@ TEST_CASE("Unit_clz") {
dim3(WIDTH / THREADS_PER_BLOCK_X, HEIGHT / THREADS_PER_BLOCK_Y),
dim3(THREADS_PER_BLOCK_X, THREADS_PER_BLOCK_Y), 0, 0, deviceA, deviceB,
deviceC, deviceD, WIDTH, HEIGHT);
HIP_CHECK(hipGetLastError());
HIP_CHECK(hipMemcpy(hostA, deviceA, NUM * sizeof(unsigned int), hipMemcpyDeviceToHost));
@@ -110,6 +110,7 @@ TEST_CASE("Unit_ffs") {
dim3(WIDTH / THREADS_PER_BLOCK_X, HEIGHT / THREADS_PER_BLOCK_Y),
dim3(THREADS_PER_BLOCK_X, THREADS_PER_BLOCK_Y), 0, 0, deviceA, deviceB,
deviceC, deviceD, WIDTH, HEIGHT);
HIP_CHECK(hipGetLastError());
HIP_CHECK(hipMemcpy(hostA, deviceA, NUM * sizeof(unsigned int), hipMemcpyDeviceToHost));
@@ -56,6 +56,7 @@ TEST_CASE("Unit_deviceFunctions_CompileTest") {
res = hipMalloc((void**)&Outd, SIZE);
REQUIRE(res == hipSuccess);
hipLaunchKernelGGL(floatMath, dim3(LEN, 1, 1), dim3(1, 1, 1), 0, 0, Ind, Outd);
HIP_CHECK(hipGetLastError());
res = hipDeviceSynchronize();
REQUIRE(res == hipSuccess);
res = hipGetLastError();
@@ -129,6 +129,7 @@ template <typename T, typename D> void testType(int msize) {
auto kernel = testOperationsGPU<T, D>;
hipLaunchKernelGGL(kernel, 1, msize, 0, 0, d_fa, d_fb, msize);
HIP_CHECK(hipGetLastError());
HIP_CHECK(hipMemcpy(fc, d_fa, sizeof(T) * msize, hipMemcpyDeviceToHost));
@@ -145,7 +145,7 @@ TEST_CASE("Unit_funnelshift") {
hipLaunchKernelGGL(funnelshift_kernel, dim3(1), dim3(1), 0, 0, device_l_output, device_lc_output,
device_r_output, device_rc_output);
HIP_CHECK(hipGetLastError());
HIP_CHECK(hipMemcpy(host_l_output, device_l_output, NUM_TESTS * sizeof(unsigned int),
hipMemcpyDeviceToHost));
HIP_CHECK(hipMemcpy(host_lc_output, device_lc_output, NUM_TESTS * sizeof(unsigned int),
@@ -69,6 +69,7 @@ TEST_CASE("Unit_hipMemcpyToSymbolAsync_ToNFrom") {
hipMemcpyToSymbolAsync(HIP_SYMBOL(globalIn), Am, SIZE, 0, hipMemcpyHostToDevice, stream));
HIP_CHECK(hipStreamSynchronize(stream));
hipLaunchKernelGGL(Assign, dim3(1, 1, 1), dim3(NUM, 1, 1), 0, 0, Ad);
HIP_CHECK(hipGetLastError());
HIP_CHECK(hipMemcpy(B, Ad, SIZE, hipMemcpyDeviceToHost));
HIP_CHECK(hipMemcpyFromSymbolAsync(Cm, HIP_SYMBOL(globalOut), SIZE, 0, hipMemcpyDeviceToHost,
stream));
@@ -83,6 +84,7 @@ TEST_CASE("Unit_hipMemcpyToSymbolAsync_ToNFrom") {
SECTION("Calling hipMemcpyTo/FromSymbol - validate value in host memory") {
HIP_CHECK(hipMemcpyToSymbol(HIP_SYMBOL(globalIn), A, SIZE, 0, hipMemcpyHostToDevice));
hipLaunchKernelGGL(Assign, dim3(1, 1, 1), dim3(NUM, 1, 1), 0, 0, Ad);
HIP_CHECK(hipGetLastError());
HIP_CHECK(hipMemcpy(B, Ad, SIZE, hipMemcpyDeviceToHost));
HIP_CHECK(hipMemcpyFromSymbol(C, HIP_SYMBOL(globalOut), SIZE, 0, hipMemcpyDeviceToHost));
@@ -99,6 +101,7 @@ TEST_CASE("Unit_hipMemcpyToSymbolAsync_ToNFrom") {
hipMemcpyToSymbolAsync(HIP_SYMBOL(globalIn), A, SIZE, 0, hipMemcpyHostToDevice, stream));
HIP_CHECK(hipStreamSynchronize(stream));
hipLaunchKernelGGL(Assign, dim3(1, 1, 1), dim3(NUM, 1, 1), 0, 0, Ad);
HIP_CHECK(hipGetLastError());
HIP_CHECK(hipMemcpy(B, Ad, SIZE, hipMemcpyDeviceToHost));
HIP_CHECK(
hipMemcpyFromSymbolAsync(C, HIP_SYMBOL(globalOut), SIZE, 0, hipMemcpyDeviceToHost, stream));
@@ -116,6 +119,7 @@ TEST_CASE("Unit_hipMemcpyToSymbolAsync_ToNFrom") {
hipStreamPerThread));
HIP_CHECK(hipStreamSynchronize(hipStreamPerThread));
hipLaunchKernelGGL(Assign, dim3(1, 1, 1), dim3(NUM, 1, 1), 0, 0, Ad);
HIP_CHECK(hipGetLastError());
HIP_CHECK(hipMemcpy(B, Ad, SIZE, hipMemcpyDeviceToHost));
HIP_CHECK(hipMemcpyFromSymbolAsync(C, HIP_SYMBOL(globalOut), SIZE, 0, hipMemcpyDeviceToHost,
hipStreamPerThread));
@@ -139,6 +143,7 @@ TEST_CASE("Unit_hipMemcpyToSymbolAsync_ToNFrom") {
HIP_CHECK(hipGetSymbolAddress((void**)&symbolAddress, HIP_SYMBOL(globalConst)));
HIP_CHECK(hipMalloc((void**)&checkOkD, sizeof(bool)));
hipLaunchKernelGGL(checkAddress, dim3(1, 1, 1), dim3(1, 1, 1), 0, 0, symbolAddress, checkOkD);
HIP_CHECK(hipGetLastError());
HIP_CHECK(hipMemcpy(&checkOk, checkOkD, sizeof(bool), hipMemcpyDeviceToHost));
HIP_CHECK(hipFree(checkOkD));
HIP_ASSERT(checkOk);
@@ -171,6 +176,7 @@ TEST_CASE("Unit_hipGetSymbolAddressAndSize_Validation") {
HIP_CHECK(hipMalloc(&checkOkD, sizeof(bool)));
hipLaunchKernelGGL(checkGlobalConstAddress, dim3(1, 1, 1), dim3(1, 1, 1), 0, 0,
symbolArrAddress, checkOkD);
HIP_CHECK(hipGetLastError());
HIP_CHECK(hipMemcpy(&checkOk, checkOkD, sizeof(bool), hipMemcpyDeviceToHost));
HIP_CHECK(hipFree(checkOkD));
HIP_ASSERT(checkOk);
@@ -184,6 +190,7 @@ TEST_CASE("Unit_hipGetSymbolAddressAndSize_Validation") {
HIP_CHECK(hipMalloc(&checkOkD, sizeof(bool)));
hipLaunchKernelGGL(checkStaticConstVarAddress, dim3(1, 1, 1), dim3(1, 1, 1), 0, 0,
symbolVarAddress, checkOkD);
HIP_CHECK(hipGetLastError());
HIP_CHECK(hipMemcpy(&checkOk, checkOkD, sizeof(bool), hipMemcpyDeviceToHost));
HIP_CHECK(hipFree(checkOkD));
HIP_ASSERT(checkOk);
+3 -2
مشاهده پرونده
@@ -100,6 +100,7 @@ template <typename T, typename U> int dataTypesRun() {
dim3(WIDTH / THREADS_PER_BLOCK_X, HEIGHT / THREADS_PER_BLOCK_Y),
dim3(THREADS_PER_BLOCK_X, THREADS_PER_BLOCK_Y), 0, 0, deviceA,
static_cast<const T*>(deviceB), WIDTH, HEIGHT);
HIP_CHECK(hipGetLastError());
HIP_CHECK(hipMemcpy(hostA, deviceA, NUM * sizeof(T), hipMemcpyDeviceToHost));
@@ -148,7 +149,7 @@ template <typename T, typename U> int dataTypesRun2() {
dim3(WIDTH / THREADS_PER_BLOCK_X, HEIGHT / THREADS_PER_BLOCK_Y),
dim3(THREADS_PER_BLOCK_X, THREADS_PER_BLOCK_Y), 0, 0, deviceA,
static_cast<const T*>(deviceB), WIDTH, HEIGHT);
HIP_CHECK(hipGetLastError());
HIP_CHECK(hipMemcpy(hostA, deviceA, NUM * sizeof(T), hipMemcpyDeviceToHost));
@@ -198,7 +199,7 @@ template <typename T, typename U> int dataTypesRun4() {
dim3(WIDTH / THREADS_PER_BLOCK_X, HEIGHT / THREADS_PER_BLOCK_Y),
dim3(THREADS_PER_BLOCK_X, THREADS_PER_BLOCK_Y), 0, 0, deviceA,
static_cast<const T*>(deviceB), WIDTH, HEIGHT);
HIP_CHECK(hipGetLastError());
HIP_CHECK(hipMemcpy(hostA, deviceA, NUM * sizeof(T), hipMemcpyDeviceToHost));
@@ -63,7 +63,7 @@ TEST_CASE("Unit_mbcnt") {
hipLaunchKernelGGL(HIP_kernel, dim3(num_blocks), dim3(num_threads_per_block), 0, 0,
device_mbcnt_lo, device_mbcnt_hi, device_lane_id);
HIP_CHECK(hipGetLastError());
unsigned int* host_mbcnt_lo = (unsigned int*)malloc(buffer_size);
unsigned int* host_mbcnt_hi = (unsigned int*)malloc(buffer_size);
unsigned int* host_lane_id = (unsigned int*)malloc(buffer_size);
+1 -1
مشاهده پرونده
@@ -100,7 +100,7 @@ TEST_CASE("Unit_popc") {
hipLaunchKernelGGL(HIP_kernel, dim3(WIDTH / THREADS_PER_BLOCK_X, HEIGHT / THREADS_PER_BLOCK_Y),
dim3(THREADS_PER_BLOCK_X, THREADS_PER_BLOCK_Y), 0, 0, deviceA, deviceB,
deviceC, deviceD, WIDTH, HEIGHT);
HIP_CHECK(hipGetLastError());
HIP_CHECK(hipMemcpy(hostA, deviceA, NUM * sizeof(unsigned int), hipMemcpyDeviceToHost));
HIP_CHECK(hipMemcpy(hostC, deviceC, NUM * sizeof(unsigned int), hipMemcpyDeviceToHost));
@@ -88,7 +88,7 @@ static void test_syncthreads_and(int blockSize) {
// Launch Kernel
hipLaunchKernelGGL(kernel_syncthreads_and, 2, blockSize, 0, 0, syncTestD, allThreadsZeroD,
allThreadsOneD, oneThreadZeroD, allThreadsMinusOneD);
HIP_CHECK(hipGetLastError());
// Copy result from device to host
HIP_CHECK(hipMemcpy(syncTestH, syncTestD, nBytes, hipMemcpyDeviceToHost));
HIP_CHECK(hipMemcpy(allThreadsZeroH, allThreadsZeroD, nBytes, hipMemcpyDeviceToHost));
@@ -95,7 +95,7 @@ void test_syncthreads_count(int blockSize) {
// Launch Kernel
hipLaunchKernelGGL(kernel_syncthreads_count, 2, blockSize, 0, 0, syncTestD, allThreadsZeroD,
allThreadsOneD, oddThreadsOneD, allThreadsMinusOneD, allThreadsIdD);
HIP_CHECK(hipGetLastError());
// Copy result from device to host
HIP_CHECK(hipMemcpy(syncTestH, syncTestD, nBytes, hipMemcpyDeviceToHost));
HIP_CHECK(hipMemcpy(allThreadsZeroH, allThreadsZeroD, nBytes, hipMemcpyDeviceToHost));
@@ -88,7 +88,7 @@ static void test_syncthreads_or(int blockSize) {
// Launch Kernel
hipLaunchKernelGGL(kernel_syncthreads_or, 2, blockSize, 0, 0, syncTestD, allThreadsZeroD,
allThreadsOneD, oneThreadOneD, allThreadsMinusOneD);
HIP_CHECK(hipGetLastError());
// Copy result from device to host
HIP_CHECK(hipMemcpy(syncTestH, syncTestD, nBytes, hipMemcpyDeviceToHost));
HIP_CHECK(hipMemcpy(allThreadsZeroH, allThreadsZeroD, nBytes, hipMemcpyDeviceToHost));
@@ -92,6 +92,7 @@ TEST_CASE("Unit_threadfence_system") {
HIP_CHECK(hipSetDevice(next_id - 1));
hipLaunchKernelGGL(gpu_round_robin, dim_grid, dim_block, 0, 0x0, next_id, num_dev, num_iter,
data, flag);
HIP_CHECK(hipGetLastError());
HIP_CHECK(hipDeviceSynchronize());
}));
}
@@ -72,6 +72,7 @@ TEMPLATE_TEST_CASE("Unit_unsafeAtomicAdd_CoherentwithnoUnsafeflag", "",
hipLaunchKernelGGL(AtomicCheck<TestType>, dim3(1), dim3(1),
0, 0, A_d,
result_d);
HIP_CHECK(hipGetLastError());
HIP_CHECK(hipDeviceSynchronize());
bool testResult;
@@ -72,6 +72,7 @@ TEMPLATE_TEST_CASE("Unit_unsafeAtomicAdd_Coherentwithoutflag", "",
hipLaunchKernelGGL(AtomicCheck<TestType>, dim3(1), dim3(1),
0, 0, A_d,
result_d);
HIP_CHECK(hipGetLastError());
HIP_CHECK(hipDeviceSynchronize());
bool testResult;
@@ -73,6 +73,7 @@ TEMPLATE_TEST_CASE("Unit_unsafeAtomicAdd_CoherentwithUnsafeflag", "",
hipLaunchKernelGGL(AtomicCheck<TestType>, dim3(1), dim3(1),
0, 0, A_d,
result_d);
HIP_CHECK(hipGetLastError());
HIP_CHECK(hipDeviceSynchronize());
bool testResult;
@@ -72,6 +72,7 @@ TEMPLATE_TEST_CASE("Unit_unsafeAtomicAdd_NonCoherentnounsafeatomicsflag", "",
dim3(1), dim3(1),
0, 0, A_d,
result_d);
HIP_CHECK(hipGetLastError());
HIP_CHECK(hipDeviceSynchronize());
bool testResult;
REQUIRE(A_h[0] == INITIAL_VAL + INC_VAL);
@@ -72,6 +72,7 @@ TEMPLATE_TEST_CASE("Unit_unsafeAtomicAdd_NonCoherentwithoutflag", "",
dim3(1), dim3(1),
0, 0, A_d,
result_d);
HIP_CHECK(hipGetLastError());
HIP_CHECK(hipDeviceSynchronize());
bool testResult;
REQUIRE(A_h[0] == INITIAL_VAL + INC_VAL);
@@ -72,6 +72,7 @@ TEMPLATE_TEST_CASE("Unit_unsafeAtomicAdd_NonCoherentwithunsafeatomicsflag", "",
dim3(1), dim3(1),
0, 0, A_d,
result_d);
HIP_CHECK(hipGetLastError());
HIP_CHECK(hipDeviceSynchronize());
bool testResult;
REQUIRE(A_h[0] == INITIAL_VAL + INC_VAL);
@@ -224,6 +224,7 @@ template <typename V> bool run_CheckSharedVectorType() {
if (hipMalloc(&ptr, sizeof(bool)) != HIP_SUCCESS) return false;
unique_ptr<bool, decltype(hipFree)*> correct{ptr, hipFree};
hipLaunchKernelGGL((CheckSharedVectorType<V>), dim3(1, 1, 1), dim3(1, 1, 1), 0, 0, correct.get());
HIP_CHECK(hipGetLastError());
bool passed = true;
if (hipMemcpyDtoH(&passed, correct.get(), sizeof(bool)) != HIP_SUCCESS) {
return false;
@@ -252,7 +253,7 @@ TEST_CASE("Unit_vectorTypes_CompileTest") {
unique_ptr<bool, decltype(hipFree)*> correct{ptr, hipFree};
hipLaunchKernelGGL(CheckVectorTypes, dim3(1, 1, 1), dim3(1, 1, 1), 0, 0, correct.get());
HIP_CHECK(hipGetLastError());
bool passed = true;
res = hipMemcpyDtoH(&passed, correct.get(), sizeof(bool));
REQUIRE(res == hipSuccess);