[clinfo] 45/148: Tune handling of no-dev platforms
Andreas Beckmann
anbe at moszumanska.debian.org
Mon Nov 17 14:09:44 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 9747e6a45b36d5a9408fef0669cd1cb9ed4712b3
Author: Giuseppe Bilotta <giuseppe.bilotta at gmail.com>
Date: Mon Apr 28 17:02:07 2014 +0200
Tune handling of no-dev platforms
In case no devices are present, just skip getting the device IDs.
This ensure more consistent output (specifically, no-dev platforms
don't get stuck together with the following platform).
Also add a missing CHECK_ERROR when actually getting the IDs.
---
src/clinfo.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/src/clinfo.c b/src/clinfo.c
index e3052d3..765e8c6 100644
--- a/src/clinfo.c
+++ b/src/clinfo.c
@@ -693,10 +693,11 @@ int main(void)
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]);
- if (num_devs[p] == 0)
- continue;
- error = clGetDeviceIDs(platform[p], CL_DEVICE_TYPE_ALL, num_devs[p], device, NULL);
+ if (num_devs[p] > 0) {
+ error = clGetDeviceIDs(platform[p], CL_DEVICE_TYPE_ALL, num_devs[p], device, NULL);
+ CHECK_ERROR("device IDs");
+ }
for (d = 0; d < num_devs[p]; ++d) {
printDeviceInfo(d);
if (d < num_devs[p] - 1)
--
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