From 4a27fb417a45c5ee999fb5697be12325c5d44016 Mon Sep 17 00:00:00 2001 From: Vinith Misra Date: Wed, 6 Nov 2024 05:04:38 -0800 Subject: [PATCH 1/2] passing samples_padded by ref to the threads. --- src/whisper.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/whisper.cpp b/src/whisper.cpp index 08f1ef01752..7a3bf72973a 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)); } From 3469ddebff64979e6cae9189b9ab7c96eb6468c6 Mon Sep 17 00:00:00 2001 From: Vinith Misra Date: Wed, 6 Nov 2024 05:04:38 -0800 Subject: [PATCH 2/2] passing samples_padded by ref to the threads. --- src/whisper.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/whisper.cpp b/src/whisper.cpp index 08f1ef01752..7a3bf72973a 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)); }