Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch from using hipcc to clang #107

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions .jenkins/common.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@ def runCompileCommand(platform, project, jobName, boolean debug=false, boolean s
String cmake = platform.jenkinsLabel.contains('centos') ? 'cmake3' : 'cmake'
//Set CI node's gfx arch as target if PR, otherwise use default targets of the library
String amdgpuTargets = env.BRANCH_NAME.startsWith('PR-') ? '-DAMDGPU_TARGETS=\$gfx_arch' : ''
String compiler = '/opt/rocm/bin/hipcc'
String toolchainOrCompiler="--toolchain=toolchain-linux.cmake"
String useCUDA = ''
if (platform.jenkinsLabel.contains('cuda'))
{
compiler = 'g++'
compiler = '-DCMAKE_CXX_COMPILER=g++'
useCUDA = '-DBUILD_WITH_LIB=CUDA'
amdgpuTargets = ''
}
Expand All @@ -39,7 +39,7 @@ def runCompileCommand(platform, project, jobName, boolean debug=false, boolean s
# gfxTargetParser reads gfxarch and adds target features such as xnack
${auxiliary.gfxTargetParser()}
echo "ROCM_PATH = \${ROCM_PATH}"
${cmake} -DCMAKE_CXX_COMPILER=${compiler} ${useCUDA} ${buildTypeArg} ${buildStatic} ${amdgpuTargets} -DBUILD_TEST=ON -DBUILD_BENCHMARK=ON ../..
${cmake} --toolchain=toolchain-linux.cmake ${useCUDA} ${buildTypeArg} ${buildStatic} ${amdgpuTargets} -DBUILD_TEST=ON -DBUILD_BENCHMARK=ON ../..
make -j\$(nproc)
"""

Expand All @@ -49,7 +49,7 @@ def runCompileCommand(platform, project, jobName, boolean debug=false, boolean s
def runTestCommand (platform, project)
{
String sudo = auxiliary.sudo(platform.jenkinsLabel)

def extraArgs = platform.jenkinsLabel.contains('cuda') ? "-E test_hiprand_linkage" : ""
def testCommand = "ctest ${extraArgs} --output-on-failure"

Expand All @@ -72,4 +72,3 @@ def runPackageCommand(platform, project)
}

return this

7 changes: 3 additions & 4 deletions install
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ else
mkdir -p debug; cd debug
fi

cmake_common_options="--toolchain=toolchain-linux.cmake"
# build type
if [[ "${build_release}" == true ]]; then
cmake_common_options="${cmake_common_options} -DCMAKE_BUILD_TYPE=Release"
Expand All @@ -142,8 +143,6 @@ fi
# before 'cmake' or setting cmake option 'CMAKE_CXX_COMPILER' to path to the HIPCC compiler.
#

compiler="hipcc"

cmake_executable="cmake"

if($build_clients); then
Expand All @@ -159,15 +158,15 @@ cmake_common_options="${cmake_common_options} -DDEPENDENCIES_FORCE_DOWNLOAD=ON"
fi

if [[ "${build_relocatable}" == true ]]; then
CXX=${rocm_path}/bin/$compiler ${cmake_executable} -DCMAKE_INSTALL_PREFIX="${rocm_path}" \
${cmake_executable} -DCMAKE_INSTALL_PREFIX="${rocm_path}" \
-DBUILD_TEST=ON -DBUILD_BENCHMARK=ON ${cmake_common_options} \
-DCMAKE_PREFIX_PATH="${rocm_path} ${rocm_path}/hip" \
-DCMAKE_SHARED_LINKER_FLAGS="${rocm_rpath}" \
-DROCM_DISABLE_LDCONFIG=ON \
-DCMAKE_MODULE_PATH="${rocm_path}/hip/cmake" \
../../. # or cmake-gui ../.
else
CXX=${rocm_path}/bin/$compiler ${cmake_executable} ${clients} ${cmake_common_options} ../../. # or cmake-gui ../.
${cmake_executable} ${clients} ${cmake_common_options} ../../. # or cmake-gui ../.
fi
check_exit_code "$?"

Expand Down
24 changes: 13 additions & 11 deletions toolchain-linux.cmake
Original file line number Diff line number Diff line change
@@ -1,17 +1,19 @@
#set(CMAKE_MAKE_PROGRAM "nmake.exe")
#set(CMAKE_GENERATOR "Ninja")
# Ninja doesn't support platform
#set(CMAKE_GENERATOR_PLATFORM x64)

if (DEFINED ENV{ROCM_PATH})
set(rocm_bin "$ENV{ROCM_PATH}/hip/bin")
set(rocm_bin "$ENV{ROCM_PATH}/bin")
else()
set(rocm_bin "/opt/rocm/hip/bin")
set(ROCM_PATH "/opt/rocm" CACHE PATH "Path to the ROCm installation.")
set(rocm_bin "/opt/rocm/bin")
endif()

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

# set(CMAKE_CXX_COMPILER "hipcc")
# set(CMAKE_C_COMPILER "hipcc")
set(CMAKE_CXX_COMPILER "${rocm_bin}/hipcc")
set(CMAKE_C_COMPILER "${rocm_bin}/hipcc")

if (NOT DEFINED ENV{CC})
set(CMAKE_C_COMPILER "${rocm_bin}/amdclang")
else()
set(CMAKE_C_COMPILER "$ENV{CC}")
endif()