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