diff --git a/projects/roctracer/test/MatrixTranspose/MatrixTranspose.cpp b/projects/roctracer/test/MatrixTranspose/MatrixTranspose.cpp index 95d699f341..de5136a42d 100644 --- a/projects/roctracer/test/MatrixTranspose/MatrixTranspose.cpp +++ b/projects/roctracer/test/MatrixTranspose/MatrixTranspose.cpp @@ -67,7 +67,7 @@ int main() { hipDeviceProp_t devProp; hipGetDeviceProperties(&devProp, 0); - std::cout << "Device name " << devProp.name << std::endl; + std::cerr << "Device name " << devProp.name << std::endl; int i; int errors; @@ -87,7 +87,7 @@ int main() { uint32_t iterations = 100; while (iterations-- > 0) { - std::cout << "## Iteration (" << iterations << ") #################" << std::endl; + std::cerr << "## Iteration (" << iterations << ") #################" << std::endl; // Memory transfer from host to device hipMemcpy(gpuMatrix, Matrix, NUM * sizeof(float), hipMemcpyHostToDevice); @@ -124,9 +124,9 @@ int main() { } } if (errors != 0) { - printf("FAILED: %d errors\n", errors); + fprintf(stderr, "FAILED: %d errors\n", errors); } else { - printf("PASSED!\n"); + fprintf(stderr, "PASSED!\n"); } } diff --git a/projects/roctracer/test/MatrixTranspose_test/MatrixTranspose.cpp b/projects/roctracer/test/MatrixTranspose_test/MatrixTranspose.cpp index 87c4167dce..1c7051de3c 100644 --- a/projects/roctracer/test/MatrixTranspose_test/MatrixTranspose.cpp +++ b/projects/roctracer/test/MatrixTranspose_test/MatrixTranspose.cpp @@ -126,7 +126,7 @@ int main() { int gpuCount = 1; #if MGPU_TEST hipGetDeviceCount(&gpuCount); - printf("Number of GPUs: %d\n", gpuCount); + fprintf(stderr, "Number of GPUs: %d\n", gpuCount); #endif iterations *= gpuCount; #endif @@ -141,7 +141,7 @@ int main() { hipDeviceProp_t devProp; HIP_CALL(hipGetDeviceProperties(&devProp, 0)); - printf("Device %d name: %s\n", devIndex, devProp.name); + fprintf(stderr, "Device %d name: %s\n", devIndex, devProp.name); #endif Matrix = (float*)malloc(NUM * sizeof(float)); @@ -206,10 +206,10 @@ int main() { } } if ((HIP_TEST != 0) && (errors != 0)) { - printf("FAILED: %d errors\n", errors); + fprintf(stderr, "FAILED: %d errors\n", errors); } else { errors = 0; - printf("PASSED!\n"); + fprintf(stderr, "PASSED!\n"); } // free the resources on device side @@ -325,7 +325,7 @@ void activity_callback(const char* begin, const char* end, void* arg) { } else if (record->domain == ACTIVITY_DOMAIN_EXT_API) { SPRINT(" external_id(%lu)", record->external_id); } else { - fprintf(stderr, "Bad domain %d\n\n", record->domain); + fprintf(stdout, "Bad domain %d\n\n", record->domain); abort(); } SPRINT("\n"); @@ -337,7 +337,7 @@ void activity_callback(const char* begin, const char* end, void* arg) { // Init tracing routine void init_tracing() { - printf("# INIT #############################\n"); + fprintf(stderr, "# INIT #############################\n"); // roctracer properties roctracer_set_properties(ACTIVITY_DOMAIN_HIP_API, NULL); // Allocating tracing pool @@ -361,7 +361,7 @@ void init_tracing() { // Start tracing routine void start_tracing() { - printf("# START (%d) #############################\n", iterations); + fprintf(stderr, "# START (%d) #############################\n", iterations); // Start if ((iterations & 1) == 1) roctracer_start(); @@ -379,7 +379,7 @@ void stop_tracing() { ROCTRACER_CALL(roctracer_disable_domain_activity(ACTIVITY_DOMAIN_HSA_OPS)); ROCTRACER_CALL(roctracer_disable_domain_callback(ACTIVITY_DOMAIN_ROCTX)); ROCTRACER_CALL(roctracer_flush_activity()); - printf("# STOP #############################\n"); + fprintf(stderr, "# STOP #############################\n"); } #else void init_tracing() {} diff --git a/projects/roctracer/test/run.sh b/projects/roctracer/test/run.sh index e0143c1cfa..608fe56e26 100755 --- a/projects/roctracer/test/run.sh +++ b/projects/roctracer/test/run.sh @@ -80,7 +80,7 @@ eval_test() { echo "test $test_number: $test_name \"$label\"" echo "CMD: \"$cmdline\"" test_runnum=$((test_runnum + 1)) - eval "$cmdline" >$test_trace 2>&1 + eval "$cmdline" 1>$test_trace 2>$test_name.err is_failed=$? if [ $is_failed != 0 ] ; then cat $test_trace