From 125f84aa0257b334f5b5415893dc4d4cce2212b3 Mon Sep 17 00:00:00 2001 From: Concedo <39025047+LostRuins@users.noreply.github.com> Date: Mon, 8 Apr 2024 16:40:55 +0800 Subject: [PATCH] fixed compiler warnings --- gpttype_adapter.cpp | 2 +- otherarch/ggml_v3-cuda.cu | 24 ++++++++++++------------ otherarch/sdcpp/sdtype_adapter.cpp | 8 ++++---- 3 files changed, 17 insertions(+), 17 deletions(-) diff --git a/gpttype_adapter.cpp b/gpttype_adapter.cpp index fe6383ae99d2a..2acf414455613 100644 --- a/gpttype_adapter.cpp +++ b/gpttype_adapter.cpp @@ -2313,7 +2313,7 @@ generation_outputs gpttype_generate(const generation_inputs inputs) float pt2 = (time2*1000.0/(realnpredict==0?1:realnpredict)); float ts2 = (1000.0/pt2); float tokens_per_second = (realnpredict == 0 ? 0 : realnpredict / (time1 + time2)); - printf("\nCtxLimit: %d/%d, Process:%.2fs (%.1fms/T = %.2fT/s), Generate:%.2fs (%.1fms/T = %.2fT/s), Total:%.2fs (%.2fT/s)",current_context_tokens.size(),nctx, time1, pt1, ts1, time2, pt2, ts2, (time1 + time2), tokens_per_second); + printf("\nCtxLimit: %d/%d, Process:%.2fs (%.1fms/T = %.2fT/s), Generate:%.2fs (%.1fms/T = %.2fT/s), Total:%.2fs (%.2fT/s)",(int)current_context_tokens.size(),(int)nctx, time1, pt1, ts1, time2, pt2, ts2, (time1 + time2), tokens_per_second); fflush(stdout); output.status = 1; generation_finished = true; diff --git a/otherarch/ggml_v3-cuda.cu b/otherarch/ggml_v3-cuda.cu index a5201f001e818..1b57b901b81f6 100644 --- a/otherarch/ggml_v3-cuda.cu +++ b/otherarch/ggml_v3-cuda.cu @@ -627,18 +627,18 @@ static __device__ __forceinline__ float warp_reduce_max(float x) { return x; } -static __device__ __forceinline__ half2 warp_reduce_max(half2 x) { -#if !(defined(GGML_USE_HIPBLAS) && defined(__HIP_PLATFORM_AMD__)) && __CUDA_ARCH__ >= CC_PASCAL && CUDART_VERSION >= CUDART_HMAX -#pragma unroll - for (int mask = 16; mask > 0; mask >>= 1) { - x = __hmax2(x, __shfl_xor_sync(0xffffffff, x, mask, 32)); - } - return x; -#else - (void) x; - bad_arch(); -#endif // !(defined(GGML_USE_HIPBLAS) && defined(__HIP_PLATFORM_AMD__)) && __CUDA_ARCH__ >= CC_PASCAL && CUDART_VERSION >= CUDART_HMAX -} +// static __device__ __forceinline__ half2 warp_reduce_max(half2 x) { +// #if !(defined(GGML_USE_HIPBLAS) && defined(__HIP_PLATFORM_AMD__)) && __CUDA_ARCH__ >= CC_PASCAL && CUDART_VERSION >= CUDART_HMAX +// #pragma unroll +// for (int mask = 16; mask > 0; mask >>= 1) { +// x = __hmax2(x, __shfl_xor_sync(0xffffffff, x, mask, 32)); +// } +// return x; +// #else +// (void) x; +// bad_arch(); +// #endif // !(defined(GGML_USE_HIPBLAS) && defined(__HIP_PLATFORM_AMD__)) && __CUDA_ARCH__ >= CC_PASCAL && CUDART_VERSION >= CUDART_HMAX +// } static __device__ __forceinline__ float op_repeat(const float a, const float b) { return b; diff --git a/otherarch/sdcpp/sdtype_adapter.cpp b/otherarch/sdcpp/sdtype_adapter.cpp index cd231d22f258f..4cd7e8892f75b 100644 --- a/otherarch/sdcpp/sdtype_adapter.cpp +++ b/otherarch/sdcpp/sdtype_adapter.cpp @@ -326,7 +326,7 @@ sd_generation_outputs sdtype_generate(const sd_generation_inputs inputs) if(!is_quiet && sddebugmode==1) { - printf("\nTXT2IMG PROMPT:%s\nNPROMPT:%s\nCLPSKP:%d\nCFGSCLE:%f\nW:%d\nH:%d\nSM:%d\nSTEP:%d\nSEED:%d\nBATCH:%d\nCIMG:%d\nCSTR:%f\n\n", + printf("\nTXT2IMG PROMPT:%s\nNPROMPT:%s\nCLPSKP:%d\nCFGSCLE:%f\nW:%d\nH:%d\nSM:%d\nSTEP:%d\nSEED:%d\nBATCH:%d\nCIMG:%p\nCSTR:%f\n\n", sd_params->prompt.c_str(), sd_params->negative_prompt.c_str(), sd_params->clip_skip, @@ -335,7 +335,7 @@ sd_generation_outputs sdtype_generate(const sd_generation_inputs inputs) sd_params->height, sd_params->sample_method, sd_params->sample_steps, - sd_params->seed, + (int)sd_params->seed, sd_params->batch_count, control_image, sd_params->control_strength); @@ -392,7 +392,7 @@ sd_generation_outputs sdtype_generate(const sd_generation_inputs inputs) if(!is_quiet && sddebugmode==1) { - printf("\nIMG2IMG PROMPT:%s\nNPROMPT:%s\nCLPSKP:%d\nCFGSCLE:%f\nW:%d\nH:%d\nSM:%d\nSTEP:%d\nSEED:%d\nBATCH:%d\nCIMG:%d\nSTR:%f\n\n", + printf("\nIMG2IMG PROMPT:%s\nNPROMPT:%s\nCLPSKP:%d\nCFGSCLE:%f\nW:%d\nH:%d\nSM:%d\nSTEP:%d\nSEED:%d\nBATCH:%d\nCIMG:%p\nSTR:%f\n\n", sd_params->prompt.c_str(), sd_params->negative_prompt.c_str(), sd_params->clip_skip, @@ -401,7 +401,7 @@ sd_generation_outputs sdtype_generate(const sd_generation_inputs inputs) sd_params->height, sd_params->sample_method, sd_params->sample_steps, - sd_params->seed, + (int)sd_params->seed, sd_params->batch_count, control_image, sd_params->strength);