From 6f555f1b47c22d3b01e82572db4765cf466c3602 Mon Sep 17 00:00:00 2001 From: Dr-Noob Date: Tue, 28 Dec 2021 16:43:11 +0100 Subject: [PATCH] [v0.22] Small various fixes --- build.sh | 6 +++--- src/common/gpu.hpp | 12 +++++++----- src/common/main.cpp | 2 +- src/intel/intel.cpp | 2 +- src/intel/uarch.cpp | 2 +- 5 files changed, 13 insertions(+), 11 deletions(-) diff --git a/build.sh b/build.sh index 46ac7f9..86ab0ab 100755 --- a/build.sh +++ b/build.sh @@ -18,13 +18,13 @@ fi # - set CMAKE_CUDA_COMPILER to your nvcc binary: # - set CMAKE_CUDA_COMPILER_TOOLKIT_ROOT to the CUDA root dir # for example: -# cmake -DCMAKE_CUDA_COMPILER=/usr/local/cuda/bin/nvcc -DCMAKE_CUDA_COMPILER_TOOLKIT_ROOT=/usr/local/cuda/ .. +# cmake -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DCMAKE_CUDA_COMPILER=/usr/local/cuda/bin/nvcc -DCMAKE_CUDA_COMPILER_TOOLKIT_ROOT=/usr/local/cuda/ .. # In case you want to explicitely disable a backend, you can: # Disable CUDA backend: -# cmake -DENABLE_CUDA_BACKEND=OFF .. +# cmake -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DENABLE_CUDA_BACKEND=OFF .. # Disable Intel backend: -# cmake -DENABLE_INTEL_BACKEND=OFF .. +# cmake -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DENABLE_INTEL_BACKEND=OFF .. cmake -DCMAKE_BUILD_TYPE=$BUILD_TYPE .. make -j$(nproc) diff --git a/src/common/gpu.hpp b/src/common/gpu.hpp index f0cd8ab..53092c7 100644 --- a/src/common/gpu.hpp +++ b/src/common/gpu.hpp @@ -60,18 +60,20 @@ struct memory { }; struct gpu_info { + int32_t idx; VENDOR vendor; struct uarch* arch; char* name; int64_t freq; struct pci* pci; - struct topology_c* topo_c; - struct topology_i* topo_i; + int64_t peak_performance; + // CUDA specific + int64_t peak_performance_tcu; struct memory* mem; struct cache* cach; - int64_t peak_performance; - int64_t peak_performance_tcu; - int32_t idx; + struct topology_c* topo_c; + // Intel specific + struct topology_i* topo_i; }; VENDOR get_gpu_vendor(struct gpu_info* gpu); diff --git a/src/common/main.cpp b/src/common/main.cpp index d6d5367..474d6bc 100644 --- a/src/common/main.cpp +++ b/src/common/main.cpp @@ -8,7 +8,7 @@ #include "../cuda/cuda.hpp" #include "../cuda/uarch.hpp" -static const char* VERSION = "0.21"; +static const char* VERSION = "0.22"; void print_help(char *argv[]) { const char **t = args_str; diff --git a/src/intel/intel.cpp b/src/intel/intel.cpp index 08a77eb..11f8a1f 100644 --- a/src/intel/intel.cpp +++ b/src/intel/intel.cpp @@ -43,7 +43,7 @@ struct gpu_info* get_gpu_info_intel() { bool print_gpu_intel(struct gpu_info* gpu) { if(gpu->vendor != GPU_VENDOR_INTEL) return false; - printf("Intel %s\n", gpu->name); + printf("%s\n", gpu->name); return true; } diff --git a/src/intel/uarch.cpp b/src/intel/uarch.cpp index e76d3bb..25bae4d 100644 --- a/src/intel/uarch.cpp +++ b/src/intel/uarch.cpp @@ -166,7 +166,7 @@ struct uarch* get_uarch_from_pci(struct pci* pci) { char* get_name_from_uarch(struct uarch* arch) { char* name = (char *) emalloc(sizeof(char) * (strlen(arch->chip_str) + 6 + 1)); - sprintf(name, "Intel %s", arch->chip_str); + sprintf(name, "%s", arch->chip_str); return name; }