Description
Both UR_DEVICE_INFO_UUID
and UR_DEVICE_INFO_PCI_ADDRESS
return char[]
. However, for PCI address, it is a pretty-printed string:
$ stdbuf -i0 -o0 -e0 ./bin/urinfo --verbose 2>&1 | grep --binary-files=text PCI_ADDRESS
PCI_ADDRESS: 0000:03:00.0
PCI_ADDRESS: 0000:00:02.0
PCI_ADDRESS: 0000:0a:00.0
PCI_ADDRESS: 0000:0C:00.0
But for UUID, it's the raw 16 bytes of the UUID itself (and the reason grep
needs extra flags, because they don't fit ASCII when treated as a string):
$ stdbuf -i0 -o0 -e0 ./bin/urinfo --verbose 2>&1 | grep --binary-files=text UUID
UUID: ���V
UUID: ���F
UUID: XX
UUID: sa����"��%~�]�
Both of these parameters are containing an object that is, at its core, a fixed-length sequence of bytes, but which also has a well-esteblished string representation. I don't have any preferences, but it would be nice to have a uniform treatment, or at least make the docs clear what exactly is returned in each case. char[]
return type, as opposed to unsigned char[]
suggests a formatted string.
P.S.: It's not very relevant for GROMACS project (although, we're considering querying PCI Addresses for CPU-GPU affinity checks); just reporting a counterintuitive behavior.