[clinfo] 64/148: Ensure better pretty-printing of param names
Andreas Beckmann
anbe at moszumanska.debian.org
Mon Nov 17 14:09:46 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 d42ba105b7a38f71bb06e0d6ecbdc4698ebc7149
Author: Giuseppe Bilotta <giuseppe.bilotta at gmail.com>
Date: Mon Sep 22 16:27:01 2014 +0200
Ensure better pretty-printing of param names
---
src/clinfo.c | 6 +++---
src/strbuf.h | 6 +++---
2 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/src/clinfo.c b/src/clinfo.c
index ef78190..6b76397 100644
--- a/src/clinfo.c
+++ b/src/clinfo.c
@@ -63,7 +63,7 @@ size_t wgm[NUM_KERNELS];
printf(I1_STR "%s\n", name, str)
#define SHOW_STRING(cmd, param, name, ...) do { \
- GET_STRING(cmd, param, __VA_ARGS__); \
+ GET_STRING(cmd, param, #param, __VA_ARGS__); \
STR_PRINT(name, strbuf); \
} while (0)
@@ -140,7 +140,7 @@ getWGsizes(cl_platform_id pid, cl_device_id dev)
error = clBuildProgram(prg, 1, &dev, NULL, NULL, NULL);
#if 0
if (error != CL_SUCCESS) {
- GET_STRING(clGetProgramBuildInfo, CL_PROGRAM_BUILD_LOG, prg, dev);
+ GET_STRING(clGetProgramBuildInfo, CL_PROGRAM_BUILD_LOG, "CL_PROGRAM_BUILD_LOG", prg, dev);
fputs(strbuf, stderr);
exit(1);
}
@@ -280,7 +280,7 @@ printDeviceInfo(cl_uint d)
STR_PARAM(OPENCL_C_VERSION, "OpenCL C Version");
// we get the extensions information here, but only print it at the end
- GET_STRING(clGetDeviceInfo, CL_DEVICE_EXTENSIONS, dev);
+ GET_STRING(clGetDeviceInfo, CL_DEVICE_EXTENSIONS, "CL_DEVICE_EXTENSIONS", dev);
size_t len = strlen(strbuf);
ALLOC(extensions, len+1, "extensions");
memcpy(extensions, strbuf, len);
diff --git a/src/strbuf.h b/src/strbuf.h
index 7d61bbf..f4292f7 100644
--- a/src/strbuf.h
+++ b/src/strbuf.h
@@ -4,15 +4,15 @@
char *strbuf;
size_t bufsz, nusz;
-#define GET_STRING(cmd, param, ...) do { \
+#define GET_STRING(cmd, param, param_str, ...) do { \
error = cmd(__VA_ARGS__, param, 0, NULL, &nusz); \
- CHECK_ERROR("get " #param " size"); \
+ CHECK_ERROR("get " param_str " size"); \
if (nusz > bufsz) { \
REALLOC(strbuf, nusz, #param); \
bufsz = nusz; \
} \
error = cmd(__VA_ARGS__, param, bufsz, strbuf, 0); \
- CHECK_ERROR("get " #param); \
+ CHECK_ERROR("get " param_str); \
} while (0)
--
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