[clinfo] 16/30: Different glyph for last device in list view

Andreas Beckmann anbe at moszumanska.debian.org
Tue Apr 28 12:53:53 UTC 2015


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

anbe pushed a commit to branch master
in repository clinfo.

commit 9509a9914cfbf2cbcf912efd2b066b3381a8191a
Author: Giuseppe Bilotta <giuseppe.bilotta at gmail.com>
Date:   Wed Mar 25 13:48:04 2015 +0100

    Different glyph for last device in list view
---
 src/clinfo.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/src/clinfo.c b/src/clinfo.c
index 2ffa59a..6be3606 100644
--- a/src/clinfo.c
+++ b/src/clinfo.c
@@ -1892,6 +1892,8 @@ int processOfflineDevicesAMD(cl_uint p)
 
 	for (d = 0; d < num_devs; ++d) {
 		if (list_only) {
+			if (d == num_devs - 1 && output_mode != CLINFO_RAW)
+				line_pfx[0] = '\\';
 			had_error = device_info_str_get(device[d], CL_DEVICE_NAME, "CL_DEVICE_NAME", NULL);
 			printf("%s%u: %s\n", line_pfx, d, strbuf);
 		} else {
@@ -1945,6 +1947,10 @@ void listPlatformsAndDevices(cl_bool show_offline)
 		}
 
 		for (d = 0; d < pdata[p].ndevs; ++d) {
+			cl_bool last_device = (d == pdata[p].ndevs - 1 && output_mode != CLINFO_RAW &&
+				(!show_offline || !pdata[p].has_amd_offline));
+			if (last_device)
+				line_pfx[0] = '\\';
 			had_error = device_info_str_get(device[d], CL_DEVICE_NAME, "CL_DEVICE_NAME", NULL);
 			printf("%s%u: %s\n", line_pfx, d, strbuf);
 			fflush(stdout);

-- 
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