| 6895 | } |
| 6896 | |
| 6897 | bool Verifier::done(std::string& err) { |
| 6898 | if (!fl_active_ || fl_k_ < fl_total_) return false; |
| 6899 | const OnDevice on_device(device_); |
| 6900 | const cudaError_t q = cudaEventQuery(ev_done_); |
| 6901 | if (q == cudaErrorNotReady) { |
| 6902 | const double now = now_ms(); |
| 6903 | if (now - fl_flush_ms_ > 2.0) { fl_flush_ms_ = now; (void) cudaStreamQuery(cs_); } |
| 6904 | if (now - fl_since_ms_ > 20000.0) { // every layer served, and the graph still runs: #267 as above |
| 6905 | err = "verify: the window never finished" + released_note(release_gpu_waits(5000)); |
| 6906 | } |
| 6907 | return false; |
| 6908 | } |
| 6909 | if (q != cudaSuccess) { err = std::string("verify: ") + cudaGetErrorString(q); return false; } |
| 6910 | if (copy_used_) { // no host function of this window may raise flag B in the next one |
| 6911 | if (cudaStreamQuery(copy_) == cudaErrorNotReady) return false; |
| 6912 | copy_used_ = false; |
| 6913 | } |
| 6914 | return true; |
| 6915 | } |
| 6916 | |
| 6917 | bool Verifier::pl_finish(int32_t* out, std::string& err) { |
| 6918 | using namespace strata::kernels; |