Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/torch/torch7.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSoumith Chintala <soumith@gmail.com>2017-01-01 09:06:18 +0300
committerGitHub <noreply@github.com>2017-01-01 09:06:18 +0300
commit6bfc00883d5478d2631f1e21cc41e476111362bb (patch)
treefa39deb9b929fec6e1a4baefb6afaa7a0dad820b
parent84418838f0e4342a8a243293c70dbc8f080f0e9a (diff)
Revert "TH_GENERIC_USE_HALF=1 by default, half enabled by default"revert-888-halfgeneric
-rw-r--r--CMakeLists.txt2
-rw-r--r--lib/TH/THGeneral.h.in2
-rw-r--r--lib/TH/THHalf.h11
3 files changed, 8 insertions, 7 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 611258b..fb2de09 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -25,6 +25,8 @@ IF(MSVC)
ADD_DEFINITIONS(-D_CRT_SECURE_NO_DEPRECATE=1)
ENDIF(MSVC)
+ADD_DEFINITIONS(-DTH_GENERIC_USE_HALF=1)
+
# OpenMP support?
SET(WITH_OPENMP ON CACHE BOOL "OpenMP support if available?")
IF (APPLE AND CMAKE_COMPILER_IS_GNUCC)
diff --git a/lib/TH/THGeneral.h.in b/lib/TH/THGeneral.h.in
index d45e06f..6873db6 100644
--- a/lib/TH/THGeneral.h.in
+++ b/lib/TH/THGeneral.h.in
@@ -47,7 +47,7 @@
#endif
#ifndef TH_GENERIC_USE_HALF
-# define TH_GENERIC_USE_HALF 1
+# define TH_GENERIC_USE_HALF 0
#endif
#ifndef TH_NATIVE_HALF
diff --git a/lib/TH/THHalf.h b/lib/TH/THHalf.h
index 0549d21..930477d 100644
--- a/lib/TH/THHalf.h
+++ b/lib/TH/THHalf.h
@@ -6,18 +6,18 @@
/* Neither built-in nor included from Cutorch, use our definition lifted from CUDA */
#if defined(__GNUC__)
-#define __thalign__(n) __attribute__((aligned(n)))
+#define __align__(n) __attribute__((aligned(n)))
#elif defined(_WIN32)
-#define __thalign__(n) __declspec(align(n))
+#define __align__(n) __declspec(align(n))
#else
-#define __thalign__(n)
+#define __align__(n)
#endif
-typedef struct __thalign__(2){
+typedef struct __align__(2){
unsigned short x;
} __THHalf;
-typedef struct __thalign__(4) {
+typedef struct __align__(4) {
unsigned int x;
} __THHalf2;
@@ -36,5 +36,4 @@ TH_API float TH_half2float(THHalf a);
#define TH_HALF_MAX TH_HALF_BITS_TO_LITERAL(0x7BFF)
-#undef __thalign__
#endif