Skip to content

Commit

Permalink
Replace hipcc with amdclang (#450)
Browse files Browse the repository at this point in the history
Co-authored-by: jsandham <[email protected]>
  • Loading branch information
jsandham and jsandham authored Aug 12, 2024
1 parent 20ddf56 commit 2c0881f
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 11 deletions.
2 changes: 1 addition & 1 deletion deps/external-gtest.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ set( gtest_git_tag "release-1.11.0" CACHE STRING "URL to download gtest from" )
if( MSVC )
list( APPEND gtest_cmake_args -Dgtest_force_shared_crt=ON -DCMAKE_DEBUG_POSTFIX=d )
# else( )
# GTEST_USE_OWN_TR1_TUPLE necessary to compile with hipcc
# GTEST_USE_OWN_TR1_TUPLE necessary to compile with hip-clang
# list( APPEND gtest_cmake_args -DGTEST_USE_OWN_TR1_TUPLE=1 )
endif( )

Expand Down
8 changes: 4 additions & 4 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ function display_help()
echo " [--compiler] specify host compiler"
echo " [--cuda] build library for cuda backend"
echo " [--static] build static library"
echo " [--address-sanitizer] build with address sanitizer enabled. Uses hipcc to compile"
echo " [--address-sanitizer] build with address sanitizer enabled. Uses hip-clang to compile"
echo " [--matrices-dir] existing client matrices directory"
echo " [--matrices-dir-install] install client matrices directory"
echo " [--rm-legacy-include-dir] Remove legacy include dir Packaging added for file/folder reorg backward compatibility."
Expand Down Expand Up @@ -330,7 +330,7 @@ while true; do
shift ;;
--address-sanitizer)
build_address_sanitizer=true
compiler=hipcc
compiler=amdclang++
shift ;;
--rm-legacy-include-dir)
build_freorg_bkwdcomp=false
Expand Down Expand Up @@ -381,7 +381,7 @@ fi
# If matrices_dir_install has been set up then install matrices dir and exit.
#
if ! [[ "${matrices_dir_install}" == "" ]];then
cmake -DCMAKE_CXX_COMPILER="${rocm_path}/bin/hipcc" -DCMAKE_C_COMPILER="${rocm_path}/bin/hipcc" -DPROJECT_BINARY_DIR=${matrices_dir_install} -DCMAKE_MATRICES_DIR=${matrices_dir_install} -P ./cmake/ClientMatrices.cmake
cmake -DCMAKE_CXX_COMPILER="${rocm_path}/bin/amdclang++" -DCMAKE_C_COMPILER="${rocm_path}/bin/amdclang" -DPROJECT_BINARY_DIR=${matrices_dir_install} -DCMAKE_MATRICES_DIR=${matrices_dir_install} -P ./cmake/ClientMatrices.cmake
exit 0
fi

Expand All @@ -398,7 +398,7 @@ if ! [[ "${matrices_dir}" == "" ]];then
# Let's 'reinstall' to the specified location to check if all good
# Will be fast if everything already exists as expected.
# This is to prevent any empty directory.
cmake -DCMAKE_CXX_COMPILER="${rocm_path}/bin/hipcc" -DCMAKE_C_COMPILER="${rocm_path}/bin/hipcc" -DPROJECT_BINARY_DIR=${matrices_dir} -DCMAKE_MATRICES_DIR=${matrices_dir} -P ./cmake/ClientMatrices.cmake
cmake -DCMAKE_CXX_COMPILER="${rocm_path}/bin/amdclang++" -DCMAKE_C_COMPILER="${rocm_path}/bin/amdclang" -DPROJECT_BINARY_DIR=${matrices_dir} -DCMAKE_MATRICES_DIR=${matrices_dir} -P ./cmake/ClientMatrices.cmake
fi


Expand Down
17 changes: 11 additions & 6 deletions toolchain-linux.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,18 @@
if (DEFINED ENV{ROCM_PATH})
set(rocm_bin "$ENV{ROCM_PATH}/bin")
else()
set(ROCM_PATH "/opt/rocm" CACHE PATH "Path to the ROCm installation.")
set(rocm_bin "/opt/rocm/bin")
endif()

set(CMAKE_CXX_COMPILER "${rocm_bin}/hipcc")
set(CMAKE_C_COMPILER "${rocm_bin}/hipcc")
set(python "python3")
if (NOT DEFINED ENV{CXX})
set(CMAKE_CXX_COMPILER "${rocm_bin}/amdclang++")
else()
set(CMAKE_CXX_COMPILER "$ENV{CXX}")
endif()

# TODO remove, just to speed up slow cmake
# set(CMAKE_C_COMPILER_WORKS 1)
# set(CMAKE_CXX_COMPILER_WORKS 1)
if (NOT DEFINED ENV{CC})
set(CMAKE_C_COMPILER "${rocm_bin}/amdclang")
else()
set(CMAKE_C_COMPILER "$ENV{CC}")
endif()

0 comments on commit 2c0881f

Please sign in to comment.