Skip to content

Commit 57f8d99

Browse files
authored
[src] fix cudadecoder crash with invalid --cuda-worker-threads (kaldi-asr#4596)
num_worker_threads had been pulled from the `config` struct, not `config_`. The latter is sanitized by a call to `CheckAndFixConfigs()`, the former isn't. This was the root cause for the segfault.
1 parent 405724b commit 57f8d99

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/cudadecoder/batched-threaded-nnet3-cuda-online-pipeline.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ class BatchedThreadedNnet3CudaOnlinePipeline {
137137
config_.compute_opts.CheckAndFixConfigs(am_nnet_->GetNnet().Modulus());
138138
config_.CheckAndFixConfigs();
139139
Initialize(decode_fst);
140-
int num_worker_threads = config.num_worker_threads;
140+
int num_worker_threads = config_.num_worker_threads;
141141
thread_pool_ = std::make_unique<ThreadPoolLight>(num_worker_threads);
142142
}
143143

0 commit comments

Comments
 (0)