Remove cuda::compat functions in aten (#18905)
authorbddppq <bai@in.tum.de>
Fri, 5 Apr 2019 18:09:15 +0000 (11:09 -0700)
committerFacebook Github Bot <facebook-github-bot@users.noreply.github.com>
Fri, 5 Apr 2019 18:15:16 +0000 (11:15 -0700)
Summary:
Looks like the issue of using `std::` functions is fixed in new rocm version
Pull Request resolved: https://github.com/pytorch/pytorch/pull/18905

Differential Revision: D14792943

Pulled By: bddppq

fbshipit-source-id: af11acbb85872943f23b6e55415db1f0699e7b8f

aten/src/ATen/native/Distributions.h

index 31167d5..72b3ec9 100644 (file)
@@ -21,7 +21,7 @@ static inline THGenerator* get_generator(at::Generator* gen) {
 }}  // namespace at::native
 
 // ROCM hcc doesn't work well with using std:: in kernel functions
-#if defined(__CUDA_ARCH__) || defined(__HIP_PLATFORM_HCC__)
+#if defined(__CUDA_ARCH__) || defined(__HIPCC__)
 #include <c10/cuda/CUDAMathCompat.h>
 #define compat_exp c10::cuda::compat::exp
 #define compat_floor c10::cuda::compat::floor
@@ -40,7 +40,7 @@ static inline THGenerator* get_generator(at::Generator* gen) {
 
 namespace {
 
-#if !defined(__CUDA_ARCH__) && !defined(__HIP_PLATFORM_HCC__)
+#if !defined(__CUDA_ARCH__) && !defined(__HIPCC__)
 // we cannot use std::isnan directly due to some incompatibility of
 // gcc constexpr'ing and nvcc
 #define isnan std::isnan