[arrayfire] 02/29: Removing ARCH_32 and ARCH_64 flags

Ghislain Vaillant ghisvail-guest at moszumanska.debian.org
Mon Oct 19 17:48:51 UTC 2015


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

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

commit 5028db2ad75fd3c993ea47735d10ab8ea67e1582
Author: Pavan Yalamanchili <pavan at arrayfire.com>
Date:   Fri Oct 2 07:38:47 2015 -0400

    Removing ARCH_32 and ARCH_64 flags
    
    - Everything not x86_64 was assumed as 32 bit.
---
 CMakeLists.txt                  |  5 -----
 src/backend/cpu/math.cpp        |  3 ---
 src/backend/cpu/math.hpp        |  3 ---
 src/backend/cpu/platform.cpp    | 10 +++-------
 src/backend/cuda/platform.cpp   | 10 +++-------
 src/backend/opencl/platform.cpp | 10 +++-------
 6 files changed, 9 insertions(+), 32 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index ef2a80a..aee379c 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -148,11 +148,6 @@ ENDIF()
 # Architechture Definitions
 INCLUDE(${CMAKE_MODULE_PATH}/TargetArch.cmake)
 target_architecture(ARCH)
-IF(${ARCH} STREQUAL "x86_64")
-    ADD_DEFINITIONS(-DARCH_64)
-ELSE(${ARCH})
-    ADD_DEFINITIONS(-DARCH_32)
-ENDIF()
 
 INCLUDE(${CMAKE_MODULE_PATH}/Version.cmake)
 
diff --git a/src/backend/cpu/math.cpp b/src/backend/cpu/math.cpp
index 12a126b..5a6bcbc 100644
--- a/src/backend/cpu/math.cpp
+++ b/src/backend/cpu/math.cpp
@@ -14,9 +14,6 @@ namespace cpu
     uint abs(uint val) { return val; }
     uchar abs(uchar val) { return val; }
     uintl abs(uintl val) { return val; }
-#if !(defined(OS_WIN) || (defined(ARCH_32) && defined(OS_LNX)))  // Not(Windows or Tegra)
-    size_t abs(size_t val) { return val; }
-#endif
 
     cfloat  scalar(float val)
     {
diff --git a/src/backend/cpu/math.hpp b/src/backend/cpu/math.hpp
index de4da0a..5314f41 100644
--- a/src/backend/cpu/math.hpp
+++ b/src/backend/cpu/math.hpp
@@ -20,9 +20,6 @@ namespace cpu
     uint abs(uint val);
     uchar abs(uchar val);
     uintl abs(uintl val);
-#if !(defined(OS_WIN) || (defined(ARCH_32) && defined(OS_LNX)))  // Not(Windows or Tegra)
-    size_t abs(size_t val);
-#endif
 
     template<typename T> static inline T min(T lhs, T rhs) { return std::min(lhs, rhs); }
     cfloat min(cfloat lhs, cfloat rhs);
diff --git a/src/backend/cpu/platform.cpp b/src/backend/cpu/platform.cpp
index 7d77907..ac8ec54 100644
--- a/src/backend/cpu/platform.cpp
+++ b/src/backend/cpu/platform.cpp
@@ -172,15 +172,11 @@ CPUInfo::CPUInfo()
 namespace cpu
 {
 
-static const char *get_system(void)
+static const std::string get_system(void)
 {
-    return
-#if defined(ARCH_32)
-    "32-bit "
-#elif defined(ARCH_64)
-    "64-bit "
-#endif
+    std::string arch = (sizeof(void *) == 4) ? "32-bit " : "64-bit ";
 
+    return arch +
 #if defined(OS_LNX)
     "Linux";
 #elif defined(OS_WIN)
diff --git a/src/backend/cuda/platform.cpp b/src/backend/cuda/platform.cpp
index 4fe24c6..c4aef2b 100644
--- a/src/backend/cuda/platform.cpp
+++ b/src/backend/cuda/platform.cpp
@@ -116,15 +116,11 @@ static inline bool card_compare_num(const cudaDevice_t &l, const cudaDevice_t &r
     return 0;
 }
 
-static const char *get_system(void)
+static const std::string get_system(void)
 {
-    return
-#if defined(ARCH_32)
-    "32-bit "
-#elif defined(ARCH_64)
-    "64-bit "
-#endif
+    std::string arch = (sizeof(void *) == 4) ? "32-bit " : "64-bit ";
 
+    return arch +
 #if defined(OS_LNX)
     "Linux";
 #elif defined(OS_WIN)
diff --git a/src/backend/opencl/platform.cpp b/src/backend/opencl/platform.cpp
index dd96d2e..8d13354 100644
--- a/src/backend/opencl/platform.cpp
+++ b/src/backend/opencl/platform.cpp
@@ -60,15 +60,11 @@ static const std::string CL_GL_SHARING_EXT = "cl_APPLE_gl_sharing";
 static const std::string CL_GL_SHARING_EXT = "cl_khr_gl_sharing";
 #endif
 
-static const char *get_system(void)
+static const std::string get_system(void)
 {
-    return
-#if defined(ARCH_32)
-    "32-bit "
-#elif defined(ARCH_64)
-    "64-bit "
-#endif
+    std::string arch = (sizeof(void *) == 4) ? "32-bit " : "64-bit ";
 
+    return arch +
 #if defined(OS_LNX)
     "Linux";
 #elif defined(OS_WIN)

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