Skip to content

Commit

Permalink
Merge pull request apache#105 from yajiedesign/addops
Browse files Browse the repository at this point in the history
fix compile error with vs2013
  • Loading branch information
tqchen committed Apr 1, 2016
2 parents 9aa2b4c + 51a8a7e commit 9c289f8
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion mshadow/half.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@
#if (MSHADOW_USE_CUDA && CUDA_VERSION >= 7050 && defined(__CUDA_ARCH__))
#define MSHADOW_CUDA_HALF 1
#include <cuda_fp16.h>
/*! \brief __half2float_warp */
__host__ __device__ float __half2float_warp(const volatile __half& h) { /* NOLINT(*) */
__half val;
val.x = h.x;
return __half2float(val);
}
#else
#define MSHADOW_CUDA_HALF 0
#endif
Expand Down Expand Up @@ -49,7 +55,7 @@ namespace half {
return T(__half2float(cuhalf_)); /* NOLINT(*)*/ \
} \
MSHADOW_XINLINE operator T() const volatile { \
return T(__half2float(cuhalf_)); /* NOLINT(*)*/ \
return T(__half2float_warp(cuhalf_)); /* NOLINT(*)*/ \
}
#else
#define MSHADOW_HALF_CONVERSIONOP(T) \
Expand Down

0 comments on commit 9c289f8

Please sign in to comment.