[arrayfire] 316/408: Fixing the output of af::info() for OpenCL backend

Ghislain Vaillant ghisvail-guest at moszumanska.debian.org
Mon Sep 21 19:12:21 UTC 2015


This is an automated email from the git hooks/post-receive script.

ghisvail-guest pushed a commit to branch debian/sid
in repository arrayfire.

commit 0183b6a961c68f3c504ed7e4d464c331fd8b53ce
Author: Pavan Yalamanchili <pavan at arrayfire.com>
Date:   Mon Aug 24 01:01:04 2015 -0400

    Fixing the output of af::info() for OpenCL backend
---
 src/backend/opencl/platform.cpp | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/src/backend/opencl/platform.cpp b/src/backend/opencl/platform.cpp
index a04355a..874832e 100644
--- a/src/backend/opencl/platform.cpp
+++ b/src/backend/opencl/platform.cpp
@@ -233,10 +233,15 @@ std::string getInfo()
 
         for(auto &device:devices) {
             const Platform platform(device.getInfo<CL_DEVICE_PLATFORM>());
+
             string platStr = platform.getInfo<CL_PLATFORM_NAME>();
-            bool show_braces = ((unsigned)getActiveDeviceId() == nDevices);
             string dstr = device.getInfo<CL_DEVICE_NAME>();
 
+            // Remove null termination character from the strings
+            platStr.pop_back();
+            dstr.pop_back();
+
+            bool show_braces = ((unsigned)getActiveDeviceId() == nDevices);
             string id = (show_braces ? string("[") : "-") + std::to_string(nDevices) +
                         (show_braces ? string("]") : "-");
             info << id << " " << platformMap(platStr) << ": " << ltrim(dstr) << " ";

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/arrayfire.git



More information about the debian-science-commits mailing list