| 23 | namespace gpu { |
| 24 | |
| 25 | Event::Status GpuEvent::PollForStatus() { |
| 26 | port::StatusOr<CUresult> status = |
| 27 | GpuDriver::QueryEvent(parent_->gpu_context(), gpu_event_); |
| 28 | if (!status.ok()) { |
| 29 | LOG(ERROR) << "Error polling for event status: " |
| 30 | << status.status().error_message(); |
| 31 | return Event::Status::kError; |
| 32 | } |
| 33 | |
| 34 | switch (status.ValueOrDie()) { |
| 35 | case CUDA_SUCCESS: |
| 36 | return Event::Status::kComplete; |
| 37 | case CUDA_ERROR_NOT_READY: |
| 38 | return Event::Status::kPending; |
| 39 | default: |
| 40 | LOG(INFO) << "Error condition returned for event status: " |
| 41 | << status.ValueOrDie(); |
| 42 | return Event::Status::kError; |
| 43 | } |
| 44 | } |
| 45 | |
| 46 | } // namespace gpu |
| 47 | } // namespace stream_executor |
no test coverage detected