Do not load ROCm cmake files if USE_ROCM is off (#14261)
authorYour Name <bai@in.tum.de>
Thu, 29 Nov 2018 19:15:03 +0000 (11:15 -0800)
committerFacebook Github Bot <facebook-github-bot@users.noreply.github.com>
Thu, 29 Nov 2018 19:17:19 +0000 (11:17 -0800)
Summary:
Previously if it unconditionally tries to load rocm cmake files, so there was no way to disable rocm build. After this change, USE_ROCM=0 will disable rocm build.
Should fix #14025

soumith
Pull Request resolved: https://github.com/pytorch/pytorch/pull/14261

Differential Revision: D13242090

Pulled By: bddppq

fbshipit-source-id: 652ec7d49dce9b357778bfa53a8e04b7079787ab

CMakeLists.txt
cmake/Dependencies.cmake

index 484e89b..159b153 100644 (file)
@@ -80,7 +80,7 @@ cmake_dependent_option(
 option(USE_ACL "Use ARM Compute Library" OFF)
 option(USE_ASAN "Use Address Sanitizer" OFF)
 option(USE_CUDA "Use CUDA" ON)
-option(USE_ROCM "Use ROCm" OFF)
+option(USE_ROCM "Use ROCm" ON)
 option(CAFFE2_STATIC_LINK_CUDA "Statically link CUDA libraries" OFF)
 cmake_dependent_option(
     USE_CUDNN "Use cuDNN" ON
index 22abb30..2f72ac0 100644 (file)
@@ -721,7 +721,7 @@ if(USE_CUDA)
 endif()
 
 # ---[ HIP
-if(NOT BUILD_ATEN_MOBILE)
+if(USE_ROCM)
   include(${CMAKE_CURRENT_LIST_DIR}/public/LoadHIP.cmake)
   if(PYTORCH_FOUND_HIP)
     message(INFO "Compiling with HIP for AMD.")