[arrayfire] 247/284: Add documentation for deviceInfo

Ghislain Vaillant ghisvail-guest at moszumanska.debian.org
Sun Feb 7 18:59:38 UTC 2016


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

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

commit 7eb905f1f05bd9e3906551dcc801c05254aa202d
Author: Shehzan Mohammed <shehzan at arrayfire.com>
Date:   Mon Jan 25 17:47:21 2016 -0500

    Add documentation for deviceInfo
---
 docs/details/device.dox         | 16 ++++++++++++++++
 include/af/device.h             | 16 +++++-----------
 src/backend/cuda/platform.cpp   |  4 ++--
 src/backend/opencl/platform.cpp |  3 +--
 4 files changed, 24 insertions(+), 15 deletions(-)

diff --git a/docs/details/device.dox b/docs/details/device.dox
index c89d2a1..1aa43e7 100644
--- a/docs/details/device.dox
+++ b/docs/details/device.dox
@@ -2,6 +2,22 @@
 \addtogroup arrayfire_func
 @{
 
+\defgroup device_func_prop deviceInfo
+\ingroup device_mat
+
+\brief Gets the information about device and platform as strings
+
+\param d_name pointer to a user-allocated char array. Recommended minimum size is 64.
+The name of the device is stored in this array.
+\param d_platform pointer to a user-allocated char array. Recommended minimum size is 10.
+The platform information is stored in this array.
+\param d_toolkit pointer to a user-allocated char array. Recommended minimum size is 64.
+The toolkit information is stored in this array.
+\param d_compute pointer to a user-allocated char array. Recommended minimum size is 10.
+The compute version of the device is stored in this array.
+
+===============================================================================
+
 \defgroup device_func_count getDeviceCount
 \ingroup device_mat
 
diff --git a/include/af/device.h b/include/af/device.h
index 2883067..c0d787e 100644
--- a/include/af/device.h
+++ b/include/af/device.h
@@ -50,19 +50,11 @@ namespace af
     */
 
     /**
-       \defgroup device_func_prop deviceInfo
+        \copydoc device_func_prop
 
-       Get device information
-
-       @{
-
-       \ingroup arrayfire_func
-       \ingroup device_mat
+        \ingroup device_func_prop
     */
     AFAPI void deviceInfo(char* d_name, char* d_platform, char *d_toolkit, char* d_compute);
-    /**
-       @}
-    */
 
     /// \brief Gets the number of devices
     ///
@@ -267,7 +259,9 @@ extern "C" {
     AFAPI af_err af_info_string(char** str, const bool verbose);
 
     /**
-       \ingroup device_func_prop
+        \copydoc device_func_prop
+
+        \ingroup device_func_prop
     */
     AFAPI af_err af_device_info(char* d_name, char* d_platform, char *d_toolkit, char* d_compute);
 
diff --git a/src/backend/cuda/platform.cpp b/src/backend/cuda/platform.cpp
index 744bf7e..5e53fc0 100644
--- a/src/backend/cuda/platform.cpp
+++ b/src/backend/cuda/platform.cpp
@@ -214,7 +214,7 @@ void devprop(char* d_name, char* d_platform, char *d_toolkit, char* d_compute)
     cudaDeviceProp dev = getDeviceProp(getActiveDeviceId());
 
     // Name
-    snprintf(d_name, 32, "%s", dev.name);
+    snprintf(d_name, 64, "%s", dev.name);
 
     //Platform
     std::string cudaRuntime = getCUDARuntimeVersion();
@@ -225,7 +225,7 @@ void devprop(char* d_name, char* d_platform, char *d_toolkit, char* d_compute)
     snprintf(d_compute, 10, "%d.%d", dev.major, dev.minor);
 
     // Sanitize input
-    for (int i = 0; i < 31; i++) {
+    for (int i = 0; i < 63; i++) {
         if (d_name[i] == ' ') {
             if (d_name[i + 1] == 0 || d_name[i + 1] == ' ') d_name[i] = 0;
             else d_name[i] = '_';
diff --git a/src/backend/opencl/platform.cpp b/src/backend/opencl/platform.cpp
index 1abb032..12bb71d 100644
--- a/src/backend/opencl/platform.cpp
+++ b/src/backend/opencl/platform.cpp
@@ -418,8 +418,7 @@ std::string getInfo()
         info << " -- Device driver " << driVersion;
         info << " -- FP64 Support: "
              << (device->getInfo<CL_DEVICE_PREFERRED_VECTOR_WIDTH_DOUBLE>()>0 ? "True" : "False")
-             << "";
-        info << "Unified Memory("
+        info << " -- Unified Memory ("
              << (isHostUnifiedMemory(*device) ? "True" : "False")
              << ")";
 #endif

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