CUDA driver routines may require a large amount of stack (particularly cuModuleLoadDataEx, 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.
| 103 | // thread::ThreadPool on some platforms), we run certain routines in this pool |
| 104 | // and wait for completion. |
| 105 | port::ThreadPool* GetDriverExecutor() { |
| 106 | static port::ThreadPool* thread_pool = new port::ThreadPool( |
| 107 | port::Env::Default(), port::ThreadOptions(), "cuda_driver", 1); |
| 108 | return thread_pool; |
| 109 | } |
| 110 | |
| 111 | } // namespace |
| 112 |
no test coverage detected