-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Conversation
…l with a new get_extra_device_info function
No idea what the reason is behind most of this except to cause problems by changing things around |
The reason I looked at api.c at all, is that I wanted to make a GUI aggregating multiple cgminer servers in one display. For that, I wanted to add newly-available device info to the device info requests. I discovered the current api.c code was duplicating the same code for the 3 different device types, so I figured I'd help clean it up by refactoring it to use a single function for all devices. By moving protocol-specific information into the driver, api.c depends less on internal OpenCL-driver code, and other drivers can provide more info without messing with api.c. The 'devs' command, prior to my fixing it, aborted early if (nDevs == 0 && opt_n_threads == 0); nDevs is a legacy variable containing the number of OpenCL devices, and opt_n_threads is a configuration variable for the number of CPU devices. If there are neither OpenCL device nor CPU devices, this would therefore abort. This was the first problem I encountered trying to interface with the API, since I only have PGAs. This change should have been part of adding PGA support to the JSON API, which wasn't something I did. I have checked the output of the JSON API that I changed, comparing the before and after, and it looks correct. If there are more extensive tests you would like me to run, please let me know. |
…ynamic information), adding a new "devdetail" JSON API method to get the former
The refactor moves data around (and isn't necessary)
|
Will not merge based on API maintainer not agreeing with changes. |
This patchset combines gpustatus, pgastatus, and cpustatus (which were mostly doing the same thing) into a single function, and adds the GPU-specific information via a new get_extra_device_info function on the driver API. It also exposes new device information (recently added) to API users when applicable: Driver, Kernel, Model, and Device Path