[clinfo] 07/30: Conditional non-default NULL context test
Andreas Beckmann
anbe at moszumanska.debian.org
Tue Apr 28 12:53:52 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 6067512fa9a86aed094acc022c2b5f5ef1cc9587
Author: Giuseppe Bilotta <giuseppe.bilotta at gmail.com>
Date: Tue Nov 18 21:20:43 2014 +0100
Conditional non-default NULL context test
Don't test non-default platforms if there's only one platform.
---
src/clinfo.c | 24 +++++++++++++-----------
1 file changed, 13 insertions(+), 11 deletions(-)
diff --git a/src/clinfo.c b/src/clinfo.c
index 392217e..f64e544 100644
--- a/src/clinfo.c
+++ b/src/clinfo.c
@@ -2201,18 +2201,20 @@ void checkNullBehavior(void)
}
printf(I1_STR "%s\n", "clCreateContext(NULL, ...) [default]", strbuf);
- /* Now look for a device from a non-default platform */
- p = 0;
- dev = all_devices;
- while (p < num_platforms && (p == pidx || pdata[p].ndevs == 0)) {
- dev += pdata[p++].ndevs;
- }
- if (p < num_platforms) {
- checkNullCtx(p, dev, "non-default");
- } else {
- bufcpy(0, "<error: no devices in non-default plaforms>");
+ /* Look for a device from a non-default platform, if there are any */
+ if (pidx < 0 || num_platforms > 1) {
+ p = 0;
+ dev = all_devices;
+ while (p < num_platforms && (p == pidx || pdata[p].ndevs == 0)) {
+ dev += pdata[p++].ndevs;
+ }
+ if (p < num_platforms) {
+ checkNullCtx(p, dev, "non-default");
+ } else {
+ bufcpy(0, "<error: no devices in non-default plaforms>");
+ }
+ printf(I1_STR "%s\n", "clCreateContext(NULL, ...) [other]", strbuf);
}
- printf(I1_STR "%s\n", "clCreateContext(NULL, ...) [other]", strbuf);
checkNullCtxFromType();
--
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