[clinfo] 51/148: Add support for AMD device topology property

Andreas Beckmann anbe at moszumanska.debian.org
Mon Nov 17 14:09:44 UTC 2014


This is an automated email from the git hooks/post-receive script.

anbe pushed a commit to branch clinfo
in repository clinfo.

commit f0333665f86dabf378fb55b3e4d4a05a50e668f9
Author: Giuseppe Bilotta <giuseppe.bilotta at gmail.com>
Date:   Sun Jun 22 23:18:29 2014 +0200

    Add support for AMD device topology property
---
 src/clinfo.c | 21 +++++++++++++++++++--
 1 file changed, 19 insertions(+), 2 deletions(-)

diff --git a/src/clinfo.c b/src/clinfo.c
index 614afc1..2f59eb6 100644
--- a/src/clinfo.c
+++ b/src/clinfo.c
@@ -317,8 +317,25 @@ printDeviceInfo(cl_uint d)
 	is_gpu = !!(devtype & CL_DEVICE_TYPE_GPU);
 	STR_PARAM(PROFILE, "Profile");
 	if (*has_amd) {
-		// TODO CL_DEVICE_TOPOLOGY_AMD
-		STR_PARAM(BOARD_NAME_AMD, "Board Name");
+		STR_PARAM(BOARD_NAME_AMD, "Board Name (AMD)");
+
+		cl_device_topology_amd devtopo;
+		GET_PARAM(TOPOLOGY_AMD, devtopo);
+
+		switch (devtopo.raw.type) {
+		case 0:
+			snprintf(strbuf, bufsz, "(%s)", na);
+			break;
+		case CL_DEVICE_TOPOLOGY_TYPE_PCIE_AMD:
+			snprintf(strbuf, bufsz, "PCI-E, %02x:%02x.%u",
+				devtopo.pcie.bus, devtopo.pcie.device, devtopo.pcie.function);
+			break;
+		default:
+			snprintf(strbuf, bufsz, "<unknown (%u): %u %u %u %u %u>", devtopo.raw.type,
+				devtopo.raw.data[0], devtopo.raw.data[1], devtopo.raw.data[2],
+				devtopo.raw.data[3], devtopo.raw.data[4]);
+		}
+		STR_PRINT("Device Topology (AMD)", strbuf);
 	}
 
 	// compute units and clock

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-opencl/clinfo.git



More information about the Pkg-opencl-commits mailing list