SWDEV-1 - Fix warnings while building tests (#201)
Change-Id: I7faf3446f8c9dafbbfc6bab4c6c1b756f0e4219d
Αυτή η υποβολή περιλαμβάνεται σε:
@@ -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
|
||||
|
||||
Αναφορά σε νέο ζήτημα
Block a user