[arrayfire] 13/248: Cleaned up function call in hapi functions

Ghislain Vaillant ghisvail-guest at moszumanska.debian.org
Tue Nov 17 15:53:49 UTC 2015


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

ghisvail-guest pushed a commit to branch dfsg-clean
in repository arrayfire.

commit 280af8dbd73b2fa7d96f71ce20ab272602c7d7e5
Author: Pradeep <pradeep at arrayfire.com>
Date:   Wed Aug 26 16:20:41 2015 -0400

    Cleaned up function call in hapi functions
---
 src/api/hapi/data.cpp           | 11 ++++-------
 src/api/hapi/symbol_manager.hpp |  6 ++++++
 2 files changed, 10 insertions(+), 7 deletions(-)

diff --git a/src/api/hapi/data.cpp b/src/api/hapi/data.cpp
index e3edf88..c65f273 100644
--- a/src/api/hapi/data.cpp
+++ b/src/api/hapi/data.cpp
@@ -15,20 +15,17 @@ af_err af_create_array(af_array *result, const void * const data,
                        const unsigned ndims, const dim_t * const dims,
                        const af_dtype type)
 {
-    AFSymbolManager& symbolManager = AFSymbolManager::getInstance();
-    return symbolManager.call("af_create_array", result, data, ndims, dims, type);
+    return CALL(result, data, ndims, dims, type);
 }
 
 af_err af_constant(af_array *result, const double value,
                    const unsigned ndims, const dim_t * const dims,
                    const af_dtype type)
 {
-    AFSymbolManager& symbolManager = AFSymbolManager::getInstance();
-    return symbolManager.call("af_constant", result, value, ndims, dims, type);
+    return CALL(result, value, ndims, dims, type);
 }
 
 af_err af_release_array(af_array arr)
 {
-    AFSymbolManager& symbolManager = AFSymbolManager::getInstance();
-    return symbolManager.call("af_release_array", arr);
-}
+    return CALL(arr);
+}
\ No newline at end of file
diff --git a/src/api/hapi/symbol_manager.hpp b/src/api/hapi/symbol_manager.hpp
index f51f0b1..85ed720 100644
--- a/src/api/hapi/symbol_manager.hpp
+++ b/src/api/hapi/symbol_manager.hpp
@@ -70,3 +70,9 @@ class AFSymbolManager {
         af::Backend activeBknd;
         LibHandle activeHandle;
 };
+
+#if defined(OS_WIN)
+#define CALL(...) AFSymbolManager::getInstance().call(__FUNCTION__, __VA_ARGS__)
+#else
+#define CALL(...) AFSymbolManager::getInstance().call(__func__, __VA_ARGS__)
+#endif
\ No newline at end of file

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