| 6 | using namespace xsched::opencl; |
| 7 | |
| 8 | OpenclQueue::OpenclQueue(cl_command_queue cmdq): cmdq_(cmdq) |
| 9 | { |
| 10 | // get device |
| 11 | cl_device_id id; |
| 12 | cl_device_type cl_type; |
| 13 | XDeviceType x_type; |
| 14 | Driver::GetCommandQueueInfo(cmdq_, CL_QUEUE_DEVICE, sizeof(id), &id, nullptr); |
| 15 | Driver::GetDeviceInfo(id, CL_DEVICE_TYPE, sizeof(cl_type), &cl_type, nullptr); |
| 16 | |
| 17 | switch (cl_type) |
| 18 | { |
| 19 | case CL_DEVICE_TYPE_CPU: |
| 20 | x_type = XDeviceType::kDeviceTypeCPU; |
| 21 | break; |
| 22 | case CL_DEVICE_TYPE_GPU: |
| 23 | x_type = XDeviceType::kDeviceTypeGPU; |
| 24 | break; |
| 25 | default: |
| 26 | x_type = XDeviceType::kDeviceTypeUnknown; |
| 27 | break; |
| 28 | } |
| 29 | device_ = xsched::protocol::MakeDevice(x_type, 0); |
| 30 | } |
| 31 | |
| 32 | void OpenclQueue::Launch(std::shared_ptr<preempt::HwCommand> hw_cmd) |
| 33 | { |
nothing calls this directly
no test coverage detected