Skip to content

Commit a6522cf

Browse files
csarofeensoumith
authored andcommitted
Updates for CUDA 9
1 parent 90afcbf commit a6522cf

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

lib/THCUNN/BatchNormalization.cu

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
#include "THCDeviceTensor.cuh"
77
#include "THCDeviceTensorUtils.cuh"
8-
8+
#include "THCDeviceUtils.cuh"
99
const int WARP_SIZE = 32;
1010

1111
// The maximum number of threads in a block
@@ -80,7 +80,7 @@ template <typename T>
8080
static __device__ __forceinline__ T warpSum(T val) {
8181
#if __CUDA_ARCH__ >= 300
8282
for (int i = 0; i < getMSB(WARP_SIZE); ++i) {
83-
val += __shfl_xor(val, 1 << i, WARP_SIZE);
83+
val += WARP_SHFL_XOR(val, 1 << i, WARP_SIZE);
8484
}
8585
#else
8686
__shared__ T values[MAX_BLOCK_SIZE];

lib/THCUNN/CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,10 @@ if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
5151
endif(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER "4.9.3")
5252
endif(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
5353

54+
if(CUDA_VERSION VERSION_GREATER "8.0")
55+
LIST(APPEND CUDA_NVCC_FLAGS "-D__CUDA_NO_HALF_OPERATORS__")
56+
endif(CUDA_VERSION VERSION_GREATER "8.0")
57+
5458
IF(MSVC)
5559
LIST(APPEND CUDA_NVCC_FLAGS "-Xcompiler /wd4819")
5660
ADD_DEFINITIONS(-DTH_EXPORTS)

0 commit comments

Comments
 (0)