Skip to content

Commit

Permalink
Remove deprecated HIP flags (#360)
Browse files Browse the repository at this point in the history
Summary:
Removes the outdated HIP flags appended to HIP_CXX_FLAGS

The will help remove the following warnings in the pytorch build log

```
[6238/6889] Building CXX object caffe2/CMakeFiles/torch_hip.dir/__/aten/src/ATen/native/cudnn/hip/Conv_v8.cpp.o
cc1plus: warning: command line option ‘-Wno-duplicate-decl-specifier’ is valid for C/ObjC but not for C++
cc1plus: warning: unrecognized command line option ‘-Wno-unused-command-line-argument’
cc1plus: warning: unrecognized command line option ‘-Wno-exceptions’
cc1plus: warning: unrecognized command line option ‘-Wno-inconsistent-missing-override’
cc1plus: warning: unrecognized command line option ‘-Wno-macro-redefined’
```

(There is a similar change also required in `pytorch/cmake/Dependencies.cmake` to fully remove these warnings)

This PR also replaces the deprecated `--amdgpu-target` hip flag with `--offload-arch` as previously updated in pytorch https://github.com/pytorch/pytorch/pull/97620/files

cc: pruthvistony

Pull Request resolved: #360

Reviewed By: zou3519

Differential Revision: D46023158

Pulled By: malfet

fbshipit-source-id: 1444a6ccae27f008a8ca7f5dd95df026c15b48dc
  • Loading branch information
jataylo authored and facebook-github-bot committed May 19, 2023
1 parent 31b1f02 commit 597accf
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions cmake/Dependencies.cmake
Expand Up @@ -146,12 +146,8 @@ if(USE_ROCM)
list(APPEND HIP_CXX_FLAGS -D__HIP_NO_HALF_OPERATORS__=1)
list(APPEND HIP_CXX_FLAGS -D__HIP_NO_HALF_CONVERSIONS__=1)
list(APPEND HIP_CXX_FLAGS -DHIP_VERSION=${HIP_VERSION_MAJOR})
list(APPEND HIP_CXX_FLAGS -Wno-macro-redefined)
list(APPEND HIP_CXX_FLAGS -Wno-inconsistent-missing-override)
list(APPEND HIP_CXX_FLAGS -Wno-exceptions)
list(APPEND HIP_CXX_FLAGS -Wno-shift-count-negative)
list(APPEND HIP_CXX_FLAGS -Wno-shift-count-overflow)
list(APPEND HIP_CXX_FLAGS -Wno-unused-command-line-argument)
list(APPEND HIP_CXX_FLAGS -Wno-duplicate-decl-specifier)
list(APPEND HIP_CXX_FLAGS -DUSE_MIOPEN)

Expand All @@ -161,7 +157,7 @@ if(USE_ROCM)
list(APPEND HIP_CLANG_FLAGS -fno-gpu-rdc)
list(APPEND HIP_CLANG_FLAGS -Wno-defaulted-function-deleted)
foreach(gloo_rocm_arch ${GLOO_ROCM_ARCH})
list(APPEND HIP_CLANG_FLAGS --amdgpu-target=${gloo_rocm_arch})
list(APPEND HIP_CLANG_FLAGS --offload-arch=${gloo_rocm_arch})
endforeach()

set(GLOO_HIP_INCLUDE ${hip_INCLUDE_DIRS} $<BUILD_INTERFACE:${HIPIFY_OUTPUT_ROOT_DIR}> $<INSTALL_INTERFACE:include> ${GLOO_HIP_INCLUDE})
Expand Down

0 comments on commit 597accf

Please sign in to comment.