MCPcopy Create free account
hub / github.com/XpuOS/xsched / OclQueue

Method OclQueue

platforms/opencl/hal/src/ocl_queue.cpp:12–31  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

10using namespace xsched::protocol;
11
12OclQueue::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
33void OclQueue::Launch(std::shared_ptr<preempt::HwCommand> hw_cmd)
34{

Callers

nothing calls this directly

Calls 3

MakePciIdFunction · 0.85
MakeDeviceFunction · 0.85
GetXDeviceTypeFunction · 0.50

Tested by

no test coverage detected