[clinfo] 131/148: Raw output tuning

Andreas Beckmann anbe at moszumanska.debian.org
Mon Nov 17 14:09:55 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 1f7ef31bf31d4ad6daa3f73a5e0dfd467ed1810a
Author: Giuseppe Bilotta <giuseppe.bilotta at gmail.com>
Date:   Sat Nov 8 21:14:07 2014 +0100

    Raw output tuning
---
 src/clinfo.c | 15 ++++++++++++---
 1 file changed, 12 insertions(+), 3 deletions(-)

diff --git a/src/clinfo.c b/src/clinfo.c
index 757edcc..8360361 100644
--- a/src/clinfo.c
+++ b/src/clinfo.c
@@ -1870,7 +1870,10 @@ int main(int argc, char *argv[])
 	error = clGetPlatformIDs(0, NULL, &num_platforms);
 	CHECK_ERROR("number of platforms");
 
-	printf(I0_STR "%u\n", "Number of platforms", num_platforms);
+	printf(I0_STR "%u\n",
+		(output_mode == CLINFO_HUMAN ?
+		 "Number of platforms" : "#PLATFORMS"),
+		num_platforms);
 	if (!num_platforms)
 		return 0;
 
@@ -1892,8 +1895,14 @@ int main(int argc, char *argv[])
 	for (p = 0, device = all_devices;
 	     p < num_platforms;
 	     device += num_devs[p++]) {
-		printf(I1_STR "%s\n", "Platform Name", platform_name[p]);
-		printf(I0_STR "%u\n", "Number of devices", num_devs[p]);
+		printf(I1_STR "%s\n",
+			(output_mode == CLINFO_HUMAN ?
+			pinfo_traits[0].pname : pinfo_traits[0].sname),
+			platform_name[p]);
+		printf(I0_STR "%u\n",
+			(output_mode == CLINFO_HUMAN ?
+			 "Number of devices" : "#DEVICES"),
+			num_devs[p]);
 
 		if (num_devs[p] > 0) {
 			error = clGetDeviceIDs(platform[p], CL_DEVICE_TYPE_ALL, num_devs[p], device, NULL);

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