From eecc040e98c51233e0ddc8248a7dec4da3ccf5d9 Mon Sep 17 00:00:00 2001 From: Dr-Noob Date: Mon, 16 Aug 2021 12:27:23 +0200 Subject: [PATCH] [v0.04] Small fixes to presentation --- src/common/gpu.cpp | 7 ++++--- src/common/main.cpp | 6 +++--- src/cuda/cuda.cpp | 2 +- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/src/common/gpu.cpp b/src/common/gpu.cpp index 765e29a..e720bfe 100644 --- a/src/common/gpu.cpp +++ b/src/common/gpu.cpp @@ -3,6 +3,7 @@ #include #include #include +#include #include "../common/global.hpp" #include "gpu.hpp" @@ -37,11 +38,11 @@ int32_t get_value_as_smallest_unit(char ** str, uint64_t value) { *str = (char *) emalloc(sizeof(char)* (max_len + 1)); if(value/1024 >= (1 << 20)) - ret = snprintf(*str, max_len, "%.4g" STRING_GIGABYTES, (double)value/(1<<30)); + ret = snprintf(*str, max_len, "%.2f " STRING_GIGABYTES, (double)value/(1<<30) - 0.005); else if(value/1024 >= (1 << 10)) - ret = snprintf(*str, max_len, "%.4g" STRING_MEGABYTES, (double)value/(1<<20)); + ret = snprintf(*str, max_len, "%.2f " STRING_MEGABYTES, (double)value/(1<<20) - 0.005); else - ret = snprintf(*str, max_len, "%.4g" STRING_KILOBYTES, (double)value/(1<<10)); + ret = snprintf(*str, max_len, "%.2f " STRING_KILOBYTES, (double)value/(1<<10) - 0.005); return ret; } diff --git a/src/common/main.cpp b/src/common/main.cpp index cb0413c..8b2cb9d 100644 --- a/src/common/main.cpp +++ b/src/common/main.cpp @@ -52,9 +52,9 @@ int main(int argc, char* argv[]) { set_log_level(true); printWarn("gpufetch is in beta. The provided information may be incomplete or wrong.\n\ - If you want to help to improve gpufetch, please compare the output of the program\n\ - with a reliable source which you know is right (e.g, techpowerup.com) and report\n\ - any inconsistencies to https://github.com/Dr-Noob/gpufetch/issues"); +If you want to help to improve gpufetch, please compare the output of the program\n\ +with a reliable source which you know is right (e.g, techpowerup.com) and report\n\ +any inconsistencies to https://github.com/Dr-Noob/gpufetch/issues"); struct gpu_info* gpu = get_gpu_info(); if(gpu == NULL) diff --git a/src/cuda/cuda.cpp b/src/cuda/cuda.cpp index 7c89e14..562e4fd 100644 --- a/src/cuda/cuda.cpp +++ b/src/cuda/cuda.cpp @@ -74,7 +74,7 @@ struct gpu_info* get_gpu_info() { cudaSetDevice(dev); cudaDeviceProp deviceProp; cudaGetDeviceProperties(&deviceProp, dev); - printf("\r"); + printf("\r "); gpu->freq = deviceProp.clockRate * 1e-3f; gpu->vendor = GPU_VENDOR_NVIDIA;