Skip to content

Commit

Permalink
ROCm 3.5 and 3.7 CMake fixes (#3746)
Browse files Browse the repository at this point in the history
HCC was removed and replaced by HIP-Clang. The CMake linker helper was evidently not updated, but can be circumvented. Since HCC is gone now, we hopefully won't have to modify the CMake integration for every update anymore.

@biermanncarl @jngrad
  • Loading branch information
kodiakhq[bot] committed Aug 27, 2020
2 parents 64cf400 + 4c5e691 commit 79b53f6
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,7 @@ empty:
rocm-maxset:
<<: *global_job_definition
stage: build
image: docker.pkg.github.com/espressomd/docker/rocm:d496478230db4e5c286680e3bdc1621af1fccffc
image: docker.pkg.github.com/espressomd/docker/rocm:cb775a82f49a7f6d4a806f17358caec797f48f73
script:
- export myconfig=maxset with_cuda=true with_cuda_compiler=hip
- export with_stokesian_dynamics=false
Expand Down
9 changes: 7 additions & 2 deletions cmake/FindCUDACompilerHIP.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -27,21 +27,26 @@ find_package(HIP ${CUDACompilerHIP_FIND_VERSION} MODULE REQUIRED)
# patch HCC_PATH environment variable and reload HIP
if(HIP_VERSION VERSION_LESS 3.1)
set(HCC_PATH "${HIP_ROOT_DIR}")
else()
elseif(HIP_VERSION VERSION_LESS 3.5)
set(HCC_PATH "${ROCM_HOME}/hcc")
else()
set(HIP_HIPCC_CMAKE_LINKER_HELPER "${HIP_HIPCC_EXECUTABLE}")
unset(HCC_PATH)
endif()
find_package(HIP ${CUDACompilerHIP_FIND_VERSION} MODULE REQUIRED)

set(CUDA 1)
set(HIP 1)

list(APPEND HIP_HCC_FLAGS
list(APPEND HIP_HIPCC_FLAGS
-std=c++${CMAKE_CUDA_STANDARD} -pedantic -Wall -Wextra
-Wno-sign-compare -Wno-unused-function -Wno-unused-variable
-Wno-unused-parameter -Wno-missing-braces -Wno-gnu-anonymous-struct
-Wno-nested-anon-types -Wno-gnu-zero-variadic-macro-arguments
-Wno-c99-designator -Wno-macro-redefined -Wno-duplicate-decl-specifier
$<$<VERSION_GREATER_EQUAL:${HIP_VERSION},3.3>:-Wno-deprecated-copy>
$<$<VERSION_GREATER_EQUAL:${HIP_VERSION},3.7>:-Wno-c++17-extensions>
$<$<VERSION_GREATER_EQUAL:${HIP_VERSION},3.7>:-Wno-unused-command-line-argument>
$<$<BOOL:${WARNINGS_ARE_ERRORS}>:-Werror>)

list(APPEND HIP_HIPCC_FLAGS_DEBUG -g)
Expand Down

0 comments on commit 79b53f6

Please sign in to comment.