| 73 | } |
| 74 | |
| 75 | bool CapturedGraph::launch(void* stream, std::string& err) const { |
| 76 | if (!exec_) { err = "launch: not recorded"; return false; } |
| 77 | cudaError_t e = cudaGraphLaunch(exec_, (cudaStream_t) stream); |
| 78 | if (e != cudaSuccess) return fail(err, "cudaGraphLaunch", e); |
| 79 | e = cudaEventRecord(done_, (cudaStream_t) stream); |
| 80 | if (e != cudaSuccess) return fail(err, "cudaEventRecord", e); |
| 81 | return true; |
| 82 | } |
| 83 | |
| 84 | bool CapturedGraph::wait_ms(int timeout_ms) const { |
| 85 | if (!done_) return false; |