| 11 | using namespace xsched::protocol; |
| 12 | |
| 13 | HipQueue::HipQueue(hipStream_t stream): kStream(stream) |
| 14 | { |
| 15 | // Get hip context |
| 16 | // FIXME: we should get the context from the stream |
| 17 | hipCtx_t current_context = nullptr; |
| 18 | HIP_ASSERT(Driver::CtxGetCurrent(¤t_context)); |
| 19 | context_ = current_context; |
| 20 | |
| 21 | // Get device |
| 22 | hipDevice_t device = 0; |
| 23 | HIP_ASSERT(Driver::CtxGetDevice(&device)); |
| 24 | |
| 25 | // Get device PCI address |
| 26 | hipDeviceProp_t prop; |
| 27 | HIP_ASSERT(Driver::GetDeviceProperties(&prop, device)); |
| 28 | device_ = MakeDevice( |
| 29 | kDeviceTypeGPU, MakePciId(prop.pciDomainID, prop.pciBusID, prop.pciDeviceID, 0)); |
| 30 | |
| 31 | // Get stream flags |
| 32 | HIP_ASSERT(Driver::StreamGetFlags(kStream, &stream_flags_)); |
| 33 | |
| 34 | // Make sure no commands are running on stream_ |
| 35 | HIP_ASSERT(Driver::StreamSynchronize(kStream)); |
| 36 | |
| 37 | } |
| 38 | |
| 39 | void HipQueue::Synchronize() |
| 40 | { |
nothing calls this directly
no test coverage detected