From b984c78fa26b3193e3b8eb1c0eaab9e965b22d27 Mon Sep 17 00:00:00 2001 From: Johannes M Dieterich Date: Mon, 11 Jun 2018 14:05:04 -0500 Subject: [PATCH] Remove legacy hcRNG (hiprng API) from the make system in favor of the supported rocRAND (hiprand API). This requires a newer version of the pyHIPIFY script to correctly change the API translation. --- aten/src/ATen/CMakeLists.txt | 4 ++-- cmake/Dependencies.cmake | 4 ++-- cmake/public/LoadHIP.cmake | 8 -------- 3 files changed, 4 insertions(+), 12 deletions(-) diff --git a/aten/src/ATen/CMakeLists.txt b/aten/src/ATen/CMakeLists.txt index 96a8f4f496afd..6eac12a0e5426 100644 --- a/aten/src/ATen/CMakeLists.txt +++ b/aten/src/ATen/CMakeLists.txt @@ -283,9 +283,9 @@ ENDIF() IF(USE_ROCM) ### Link in the ROCm libraries BLAS / RNG. FIND_LIBRARY(HIPBLAS_LIBRARY hipblas HINTS ${HIPBLAS_PATH}/lib) - FIND_LIBRARY(HIPRNG_LIBRARY hiprng HINTS ${HIPRNG_PATH}/lib) + FIND_LIBRARY(HIPRAND_LIBRARY hiprand HINTS ${HIPRAND_PATH}/lib) - list(APPEND ATen_CUDA_DEPENDENCY_LIBS ${HIPBLAS_LIBRARY} ${HIPRNG_LIBRARY}) + list(APPEND ATen_CUDA_DEPENDENCY_LIBS ${HIPBLAS_LIBRARY} ${HIPRAND_LIBRARY}) # Set necessary HIPCC Flags SET(HIP_HCC_FLAGS "-DCUDA_HAS_FP16=1 -D__HIP_NO_HALF_OPERATORS__=1 -D__HIP_NO_HALF_CONVERSIONS__=1 -D__HIP_PLATFORM_HCC__=1 ${HIP_HCC_FLAGS}") diff --git a/cmake/Dependencies.cmake b/cmake/Dependencies.cmake index aea46e7ac2e65..30802b28590a5 100644 --- a/cmake/Dependencies.cmake +++ b/cmake/Dependencies.cmake @@ -477,7 +477,7 @@ if(BUILD_CAFFE2 OR BUILD_ATEN) set(Caffe2_HIP_INCLUDES ${hip_INCLUDE_DIRS} ${rocrand_INCLUDE_DIRS} ${hiprand_INCLUDE_DIRS} ${rocblas_INCLUDE_DIRS} ${miopen_INCLUDE_DIRS} ${Caffe2_HIP_INCLUDES} ${thrust_INCLUDE_DIRS}) set(Caffe2_HIP_DEPENDENCY_LIBS - ${rocrand_LIBRARIES} ${hiprand_LIBRARIES} ${PYTORCH_HIP_HCC_LIBRARIES} ${PYTORCH_MIOPEN_LIBRARIES} ${hipsparse_LIBRARIES} ${hipblas_LIBRARIES} ${hiprng_LIBRARIES}) + ${rocrand_LIBRARIES} ${hiprand_LIBRARIES} ${PYTORCH_HIP_HCC_LIBRARIES} ${PYTORCH_MIOPEN_LIBRARIES} ${hipsparse_LIBRARIES} ${hipblas_LIBRARIES}) # TODO: There is a bug in rocblas's cmake files that exports the wrong targets name in ${rocblas_LIBRARIES} list(APPEND Caffe2_HIP_DEPENDENCY_LIBS @@ -492,7 +492,7 @@ if(USE_ROCM AND NOT BUILD_CAFFE2) include_directories(${HIP_PATH}/include) include_directories(${HIPBLAS_PATH}/include) include_directories(${HIPSPARSE_PATH}/include) - include_directories(${HIPRNG_PATH}/include) + include_directories(${HIPRAND_PATH}/include) include_directories(${THRUST_PATH}) # load HIP cmake module and load platform id diff --git a/cmake/public/LoadHIP.cmake b/cmake/public/LoadHIP.cmake index 5136a99dbb746..33cef8d0095fe 100644 --- a/cmake/public/LoadHIP.cmake +++ b/cmake/public/LoadHIP.cmake @@ -38,13 +38,6 @@ ELSE() SET(ROCBLAS_PATH $ENV{ROCBLAS_PATH}) ENDIF() -# HIPRNG_PATH -IF(NOT DEFINED ENV{HIPRNG_PATH}) - SET(HIPRNG_PATH ${ROCM_PATH}/hcrng) -ELSE() - SET(HIPRNG_PATH $ENV{HIPRNG_PATH}) -ENDIF() - # HIPSPARSE_PATH IF(NOT DEFINED ENV{HIPSPARSE_PATH}) SET(HIPSPARSE_PATH ${ROCM_PATH}/hcsparse) @@ -122,7 +115,6 @@ IF(HIP_FOUND) # however currently it's just the lib name FIND_LIBRARY(PYTORCH_MIOPEN_LIBRARIES ${miopen_LIBRARIES} HINTS ${MIOPEN_PATH}/lib) FIND_LIBRARY(hiprand_LIBRARIES hiprand HINTS ${HIPRAND_PATH}/lib) - FIND_LIBRARY(hiprng_LIBRARIES hiprng HINTS ${HIPRNG_PATH}/lib) FIND_LIBRARY(hipblas_LIBRARIES hipblas HINTS ${HIPBLAS_PATH}/lib) FIND_LIBRARY(hipsparse_LIBRARIES hipsparse HINTS ${HIPSPARSE_PATH}/lib)