From 68aaf9fedc89aaa1a23a7f1f6bf94a6cabc6718a Mon Sep 17 00:00:00 2001 From: David Bayer Date: Thu, 17 Oct 2024 14:53:11 +0200 Subject: [PATCH] fix nvrtc and hiprtc compilation log size --- .../vkFFT_API_handles/vkFFT_CompileKernel.h | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/vkFFT/vkFFT/vkFFT_PlanManagement/vkFFT_API_handles/vkFFT_CompileKernel.h b/vkFFT/vkFFT/vkFFT_PlanManagement/vkFFT_API_handles/vkFFT_CompileKernel.h index 37a4644..a00a0f2 100644 --- a/vkFFT/vkFFT/vkFFT_PlanManagement/vkFFT_API_handles/vkFFT_CompileKernel.h +++ b/vkFFT/vkFFT/vkFFT_PlanManagement/vkFFT_API_handles/vkFFT_CompileKernel.h @@ -366,7 +366,9 @@ static inline VkFFTResult VkFFT_CompileKernel(VkFFTApplication* app, VkFFTAxis* if (result != NVRTC_SUCCESS) { printf("nvrtcCompileProgram error: %s\n", nvrtcGetErrorString(result)); - char* log = (char*)malloc(sizeof(char) * 4000000); + size_t logSize; + nvrtcGetProgramLogSize(prog, &logSize); + char* log = (char*)malloc(sizeof(char) * logSize); if (!log) { free(code0); code0 = 0; @@ -553,7 +555,9 @@ static inline VkFFTResult VkFFT_CompileKernel(VkFFTApplication* app, VkFFTAxis* free(opts[0]); if (result != HIPRTC_SUCCESS) { printf("hiprtcCompileProgram error: %s\n", hiprtcGetErrorString(result)); - char* log = (char*)malloc(sizeof(char) * 100000); + size_t logSize; + hiprtcGetProgramLogSize(prog, &logSize); + char* log = (char*)malloc(sizeof(char) * logSize); if (!log) { free(code0); code0 = 0;