Simplify OpenCL info dumping code#15814
Simplify OpenCL info dumping code#15814opencv-pushbot merged 1 commit into3.4from unknown repository
Conversation
| { | ||
| platform->getDevice(current_device, j); | ||
| const char* deviceTypeStr = (current_device.type() == Device::TYPE_CPU) ? "CPU" : | ||
| (current_device.type() == Device::TYPE_GPU ? current_device.hostUnifiedMemory() ? "iGPU" : "dGPU" : "unknown"); |
There was a problem hiding this comment.
These two lines would benefit of even further refactoring, consider extracting a function for getting deviceTypeStr
There was a problem hiding this comment.
I'd like to avoid touching that part, because device.type() looks odd to me. It's type is int and not cl_device_type. It's also different from Device::TYPE_* enum, because condition of having iGPU is "device.type() == Device::TYPE_GPU && device.hostUnifiedMemory()" instead of "device.type() == Device::TYPE_IGPU".
There was a problem hiding this comment.
I just did this refactoring in #15883. I would appreciate a review from you!
|
Thank you for this PR, good work! |
* Reduce code nesting * Drop redundant .c_str() calls
alalek
left a comment
There was a problem hiding this comment.
Looks good to me 👍
BTW, try to avoid huge patches which don't fix anything
Simplify OpenCL info dumping code:
Just a cleanup. Makes line lengths more reasonable.