Skip to content

Commit

Permalink
[ROCm] more 6.0 changes (pytorch#115946)
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffdaily authored and dmenig committed Dec 21, 2023
1 parent 7dd7784 commit 9e2932f
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion aten/src/ATen/cuda/detail/CUDAHooks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ bool CUDAHooks::isPinnedPtr(const void* data) const {
return false;
}
#endif
#if !defined(USE_ROCM)
#if !defined(USE_ROCM) || (defined(USE_ROCM) && ROCM_VERSION >= 50700)
return attr.type == cudaMemoryTypeHost;
#else
return attr.memoryType == cudaMemoryTypeHost;
Expand Down
2 changes: 1 addition & 1 deletion caffe2/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -698,7 +698,7 @@ if(USE_ROCM)
add_library(caffe2_nvrtc SHARED ${ATen_NVRTC_STUB_SRCS})
target_link_libraries(caffe2_nvrtc ${PYTORCH_HIP_LIBRARIES} ${ROCM_HIPRTC_LIB})
target_include_directories(caffe2_nvrtc PRIVATE ${CMAKE_BINARY_DIR})
target_compile_definitions(caffe2_nvrtc PRIVATE USE_ROCM __HIP_PLATFORM_HCC__)
target_compile_definitions(caffe2_nvrtc PRIVATE USE_ROCM __HIP_PLATFORM_AMD__)
install(TARGETS caffe2_nvrtc DESTINATION "${TORCH_INSTALL_LIB_DIR}")
endif()

Expand Down
2 changes: 1 addition & 1 deletion caffe2/core/common_gpu.h
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ namespace caffe2 {
class TensorCoreEngine {};
#endif // USE_ROCM

#if !defined(USE_ROCM)
#if !defined(USE_ROCM) || (defined(USE_ROCM) && ROCM_VERSION >= 50700)
#define CAFFE2_CUDA_PTRATTR_MEMTYPE type
#else
#define CAFFE2_CUDA_PTRATTR_MEMTYPE memoryType
Expand Down
2 changes: 2 additions & 0 deletions caffe2/operators/elementwise_ops.cu
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,10 @@
// until we use hipblas v2
// hipify correctly maps things like CUDA_R_16F to HIP_R_16F,
// however hipblas v1 is still using its custom type
#ifndef HIPBLAS_V2
#define HIP_R_16F HIPBLAS_R_16F
#define HIP_R_32F HIPBLAS_R_32F
#endif
#endif // USE_ROCM

namespace caffe2 {
Expand Down
3 changes: 1 addition & 2 deletions cmake/public/LoadHIP.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -187,8 +187,7 @@ if(HIP_FOUND)
else()
find_library(PYTORCH_RCCL_LIBRARIES ${rccl_LIBRARIES} HINTS ${ROCM_PATH}/lib)
endif()
# hiprtc is part of HIP
find_library(ROCM_HIPRTC_LIB amdhip64 HINTS ${ROCM_PATH}/lib)
find_library(ROCM_HIPRTC_LIB hiprtc HINTS ${ROCM_PATH}/lib)
# roctx is part of roctracer
find_library(ROCM_ROCTX_LIB roctx64 HINTS ${ROCM_PATH}/lib)

Expand Down

0 comments on commit 9e2932f

Please sign in to comment.