| 104 | } |
| 105 | |
| 106 | void BeginCapture() |
| 107 | { |
| 108 | capture_ok = false; |
| 109 | ngla::EnsureCuBlasWorkspace(); |
| 110 | prev_stream = ngs_cuda_stream; |
| 111 | ngs_cuda_stream = stream; |
| 112 | if (stream_change_callback) { |
| 113 | stream_change_callback(ngs_cuda_stream); |
| 114 | } |
| 115 | auto err = cudaStreamBeginCapture(stream, cudaStreamCaptureModeGlobal); |
| 116 | if (err != cudaSuccess) |
| 117 | throw ngstd::Exception(std::string("[CudaGraph] cudaStreamBeginCapture FAILED: ") |
| 118 | + cudaGetErrorString(err)); |
| 119 | } |
| 120 | |
| 121 | void EndCapture() |
| 122 | { |
no test coverage detected