-
We use a custom threading library to spawn multiple threads each thread running halide generated function (AOT compiled). Since halide also uses threads, we want to clean up the halide thread pool before we exit our functionality, we are using the function "halide_shutdown_thread_pool", could you please let me know if it's sufficient to call this function in our main thread or this needs to be called in all threads that executed halide function? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Short answer: Just call it on the main thread. It sounds like your Halide pipelines don't use Func::parallel, so it shouldn't be necessary to stop it as it's only started on first use. If you do use the Func::parallel scheduling directive, you might want to use halide_set_custom_do_par_for to just always use your threadpool. |
Beta Was this translation helpful? Give feedback.
Short answer: Just call it on the main thread.
It sounds like your Halide pipelines don't use Func::parallel, so it shouldn't be necessary to stop it as it's only started on first use. If you do use the Func::parallel scheduling directive, you might want to use halide_set_custom_do_par_for to just always use your threadpool.