ROCM driver routines may require a large amount of stack (particularly hipModuleLoadDataEx, in our experience). To avoid stack overflow when using stack-limited threads (such as those spawned by a default-argument thread::ThreadPool on some platforms), we run certain routines in this pool and wait for completion.
| 125 | // thread::ThreadPool on some platforms), we run certain routines in this pool |
| 126 | // and wait for completion. |
| 127 | port::ThreadPool* GetDriverExecutor() { |
| 128 | static port::ThreadPool* thread_pool = new port::ThreadPool( |
| 129 | port::Env::Default(), port::ThreadOptions(), "rocm_driver", 1); |
| 130 | return thread_pool; |
| 131 | } |
| 132 | |
| 133 | } // namespace |
| 134 |
no test coverage detected