[clinfo] 102/148: Hack to pass devtype to the device info checks

Andreas Beckmann anbe at moszumanska.debian.org
Mon Nov 17 14:09:51 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 274b6041e866365a475d1bb446c6caa51fd3577a
Author: Giuseppe Bilotta <giuseppe.bilotta at gmail.com>
Date:   Tue Nov 4 19:25:45 2014 +0100

    Hack to pass devtype to the device info checks
---
 src/clinfo.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/src/clinfo.c b/src/clinfo.c
index 239417b..eede7c2 100644
--- a/src/clinfo.c
+++ b/src/clinfo.c
@@ -505,6 +505,9 @@ int device_info_devtype(cl_device_id dev, cl_device_info param, const char *pnam
 		strbuf[szval] = '\0';
 	}
 	printf(I1_STR "%s\n", pname, strbuf);
+	/* we abuse global strbuf to pass the device type over to the caller */
+	if (!had_error)
+		memcpy(strbuf, &val, sizeof(val));
 	return had_error;
 }
 
@@ -694,7 +697,8 @@ printDeviceInfo(cl_uint d)
 			identify_device_extensions(extensions, &chk);
 			break;
 		case CL_DEVICE_TYPE:
-			/* TODO put device type in chk */
+			/* strbuf was abused to give us the dev type */
+			memcpy(&(chk.devtype), strbuf, sizeof(chk.devtype));
 			break;
 		default:
 			/* do nothing */

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