[clinfo] 141/148: clGetPlatformInfo can also take a NULL cl_platform_id

Andreas Beckmann anbe at moszumanska.debian.org
Mon Nov 17 14:09:56 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 db0a4d97cccf0478b43ddc5e476cca628d961f2c
Author: Giuseppe Bilotta <giuseppe.bilotta at gmail.com>
Date:   Tue Nov 11 17:45:23 2014 +0100

    clGetPlatformInfo can also take a NULL cl_platform_id
---
 man/clinfo.1 |  3 ++-
 src/clinfo.c | 20 +++++++++++++++++++-
 2 files changed, 21 insertions(+), 2 deletions(-)

diff --git a/man/clinfo.1 b/man/clinfo.1
index 3813e99..985d853 100644
--- a/man/clinfo.1
+++ b/man/clinfo.1
@@ -111,9 +111,10 @@ format might undergo changes.
 
 .P
 The implementation-defined behavior in case of NULL platform for
+.BR clGetPlatformInfo() ,
 .B clGetDeviceIDs()
 and
-.BR clCreateteContext()
+.B clCreateteContext()
 is also tested.
 
 .SH BUGS
diff --git a/src/clinfo.c b/src/clinfo.c
index 3fcd524..df92685 100644
--- a/src/clinfo.c
+++ b/src/clinfo.c
@@ -1767,10 +1767,25 @@ printDeviceInfo(cl_uint d)
 	extensions = NULL;
 }
 
+/* check the behavior of clGetPlatformInfo() when given a NULL platform ID */
+void checkNullGetPlatformName(void)
+{
+	current_param = "CL_PLATFORM_NAME";
+
+	error = clGetPlatformInfo(NULL, CL_PLATFORM_NAME, bufsz, strbuf, NULL);
+	if (error == CL_INVALID_PLATFORM) {
+		bufcpy(0, no_plat());
+	} else {
+		current_line = __LINE__+1;
+		had_error = REPORT_ERROR2("get %s");
+	}
+	printf(I1_STR "%s\n",
+		"clGetPlatformInfo(NULL, CL_PLATFORM_NAME, ...)", strbuf);
+}
+
 /* check the behavior of clGetDeviceIDs() when given a NULL platform ID;
  * return the index of the default platform in our array of platform IDs
  */
-
 cl_int checkNullGetDevices(void)
 {
 	cl_int i = 0; /* generic iterator */
@@ -1901,6 +1916,9 @@ void checkNullBehavior(void)
 	cl_int p = 0;
 
 	printf("NULL platform behavior\n");
+
+	checkNullGetPlatformName();
+
 	pidx = checkNullGetDevices();
 
 	/* If there's a default platform, and it has devices, try

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