diff --git a/projects/roctracer/test/app/MatrixTranspose_test.cpp b/projects/roctracer/test/app/MatrixTranspose_test.cpp index 2d20ff2bdd..4b146255de 100644 --- a/projects/roctracer/test/app/MatrixTranspose_test.cpp +++ b/projects/roctracer/test/app/MatrixTranspose_test.cpp @@ -131,7 +131,7 @@ int main() { #endif int i; - int errors; + int errors = 0; init_tracing(); @@ -210,22 +210,21 @@ int main() { // CPU MatrixTranspose computation #if HIP_TEST matrixTransposeCPUReference(cpuTransposeMatrix, Matrix, WIDTH); -#endif // verify the results - errors = 0; double eps = 1.0E-6; for (i = 0; i < NUM; i++) { - if (abs(TransposeMatrix[i] - cpuTransposeMatrix[i]) > eps) { + if (abs((double)TransposeMatrix[i] - cpuTransposeMatrix[i]) > eps) { errors++; } } - if ((HIP_TEST != 0) && (errors != 0)) { + if (errors != 0) { fprintf(stderr, "FAILED: %d errors\n", errors); } else { errors = 0; fprintf(stderr, "PASSED!\n"); } +#endif // free the resources on device side CHECK_HIP(hipFree(gpuMatrix)); diff --git a/projects/roctracer/test/hsa/copy.cpp b/projects/roctracer/test/hsa/copy.cpp index 9da1dd6de9..e0244831a6 100644 --- a/projects/roctracer/test/hsa/copy.cpp +++ b/projects/roctracer/test/hsa/copy.cpp @@ -372,7 +372,7 @@ void test_func(int kiter, int diter, int agents) { CHECK(err); for (int j = 1; j <= diter; ++j) { - Aql packet = {0}; + Aql packet{}; packet.header.type = HSA_PACKET_TYPE_KERNEL_DISPATCH; packet.header.barrier = 1; packet.header.acquire = HSA_FENCE_SCOPE_SYSTEM;