| 213 | } |
| 214 | |
| 215 | static inline CUresult XStreamEndCaptureImpl(CUstream stream, CUgraph *graph) |
| 216 | { |
| 217 | CUstreamCaptureStatus before = CU_STREAM_CAPTURE_STATUS_NONE; |
| 218 | CUresult qres = Driver::StreamIsCapturing(stream, &before); |
| 219 | CUresult res = Driver::StreamEndCapture(stream, graph); |
| 220 | if (res != CUDA_ERROR_STREAM_CAPTURE_UNMATCHED && // end capture on the correct stream |
| 221 | qres == CUDA_SUCCESS && before != CU_STREAM_CAPTURE_STATUS_NONE) { |
| 222 | // The stream is capturing before, check if it is actually stopped. |
| 223 | CUstreamCaptureStatus after = CU_STREAM_CAPTURE_STATUS_NONE; |
| 224 | qres = Driver::StreamIsCapturing(stream, &after); |
| 225 | if (qres == CUDA_SUCCESS && after == CU_STREAM_CAPTURE_STATUS_NONE) { |
| 226 | CaptureEnd(); |
| 227 | } |
| 228 | } |
| 229 | return res; |
| 230 | } |
| 231 | |
| 232 | CUresult XStreamEndCapture(CUstream stream, CUgraph *graph) |
| 233 | { |
no test coverage detected