SWDEV-1 - Fix warnings while building tests (#201)

Change-Id: I7faf3446f8c9dafbbfc6bab4c6c1b756f0e4219d
Αυτή η υποβολή περιλαμβάνεται σε:
Maneesh Gupta
2023-03-14 21:42:20 +05:30
υποβλήθηκε από GitHub
γονέας a25ea2ca40
υποβολή ac4267e21e
13 αρχεία άλλαξαν με 46 προσθήκες και 39 διαγραφές
@@ -24,7 +24,6 @@ THE SOFTWARE.
// Tolerance for error
const double tolerance = 1e-6;
const bool verbose = false;
#define LEN 64
@@ -117,14 +116,15 @@ void test() {
hipLaunchKernelGGL(kernel<FloatT>, dim3(1), dim3(LEN), 0, 0,
Ad, Bd, Cd, CK);
HIP_CHECK(hipMemcpy(C, Cd, sizeof(ComplexT)*LEN, hipMemcpyDeviceToHost));
bool pass = true;
for (int i = 0; i < LEN; i++) {
ComplexT Expected = calc(A[i], B[i], CK);
FloatT error = abs(C[i] - Expected);
if (abs(Expected) > tolerance)
error /= abs(Expected);
bool pass = error < tolerance;
pass &= error < tolerance;
}
return true;
return pass;
};
#define OP(x) assert(test_fun(CK_##x));
@@ -140,6 +140,7 @@ void test() {
delete[] D;
}
#if HT_AMD
TEST_CASE("Unit_StdComplex") {
SECTION("Test run with float") {
test<float>();
@@ -148,3 +149,4 @@ TEST_CASE("Unit_StdComplex") {
test<double>();
}
}
#endif