| 10 | using namespace xsched::protocol; |
| 11 | |
| 12 | OclQueue::OclQueue(cl_command_queue cmdq): kCmdq(cmdq) |
| 13 | { |
| 14 | // get device |
| 15 | cl_device_id id; |
| 16 | cl_device_type type; |
| 17 | cl_device_pci_bus_info_khr pci; |
| 18 | XDeviceId dev_id = 0; // TODO: find a fallback for devices without PCI bus info |
| 19 | OCL_ASSERT(Driver::GetCommandQueueInfo(kCmdq, CL_QUEUE_DEVICE, sizeof(id), &id, nullptr)); |
| 20 | OCL_ASSERT(Driver::GetDeviceInfo(id, CL_DEVICE_TYPE, sizeof(type), &type, nullptr)); |
| 21 | cl_int ret = Driver::GetDeviceInfo(id, CL_DEVICE_PCI_BUS_INFO_KHR, sizeof(pci), &pci, nullptr); |
| 22 | if (ret == CL_SUCCESS) { |
| 23 | dev_id = MakePciId(pci.pci_domain, pci.pci_bus, pci.pci_device, pci.pci_function); |
| 24 | } |
| 25 | device_ = MakeDevice(GetXDeviceType(type), dev_id); |
| 26 | |
| 27 | // make sure no tasks are running on stream_ |
| 28 | XDEBG("OclQueue (%p) created for cmdq (%p)", this, kCmdq); |
| 29 | OCL_ASSERT(Driver::Flush(kCmdq)); |
| 30 | OCL_ASSERT(Driver::Finish(kCmdq)); |
| 31 | } |
| 32 | |
| 33 | void OclQueue::Launch(std::shared_ptr<preempt::HwCommand> hw_cmd) |
| 34 | { |
nothing calls this directly
no test coverage detected