From: Vin Misra Date: Wed, 6 Nov 2024 21:02:11 +0000 (-0800) Subject: whisper : fix extra memory usage (#2534) X-Git-Tag: upstream/1.7.4~279 X-Git-Url: https://git.djapps.eu/?a=commitdiff_plain;h=31aea563a83803c710691fed3e8d700e06ae6788;p=pkg%2Fggml%2Fsources%2Fwhisper.cpp whisper : fix extra memory usage (#2534) * passing samples_padded by ref to the threads. * passing samples_padded by ref to the threads. --------- Co-authored-by: Vinith Misra --- diff --git a/src/whisper.cpp b/src/whisper.cpp index 08f1ef01..e97a6883 100644 --- a/src/whisper.cpp +++ b/src/whisper.cpp @@ -3164,7 +3164,7 @@ static bool log_mel_spectrogram( std::vector workers(n_threads - 1); for (int iw = 0; iw < n_threads - 1; ++iw) { workers[iw] = std::thread( - log_mel_spectrogram_worker_thread, iw + 1, hann, samples_padded, + log_mel_spectrogram_worker_thread, iw + 1, hann, std::cref(samples_padded), n_samples + stage_2_pad, frame_size, frame_step, n_threads, std::cref(filters), std::ref(mel)); }