Skip to content

Commit

Permalink
Merge pull request #244 from daineAMD/master
Browse files Browse the repository at this point in the history
Merge develop into master for ROCm 3.8 feature complete
  • Loading branch information
daineAMD authored Aug 5, 2020
2 parents abd7261 + 92766ef commit 5299dc5
Show file tree
Hide file tree
Showing 10 changed files with 114 additions and 20 deletions.
4 changes: 2 additions & 2 deletions .jenkins/common.groovy
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// This file is for internal AMD use.
// If you are interested in running your own Jenkins, please raise a github issue for assistance.

def runCompileCommand(platform, project, jobName)
def runCompileCommand(platform, project, jobName, boolean sameOrg=false)
{
project.paths.construct_build_prefix()

Expand All @@ -10,7 +10,7 @@ def runCompileCommand(platform, project, jobName)
{
project.libraryDependencies.each
{ libraryName ->
getDependenciesCommand += auxiliary.getLibrary(libraryName, platform.jenkinsLabel, 'develop')
getDependenciesCommand += auxiliary.getLibrary(libraryName, platform.jenkinsLabel, 'develop', sameOrg)
}
}

Expand Down
6 changes: 2 additions & 4 deletions .jenkins/precheckin.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,11 @@ def runCI =
ci: {
String urlJobName = auxiliary.getTopJobName(env.BUILD_URL)

def propertyList = ["compute-rocm-dkms-no-npi":[pipelineTriggers([cron('0 1 * * 0')])],
"compute-rocm-dkms-no-npi-hipclang":[pipelineTriggers([cron('0 1 * * 0')])],
def propertyList = ["compute-rocm-dkms-no-npi-hipclang":[pipelineTriggers([cron('0 1 * * 0')])],
"rocm-docker":[]]
propertyList = auxiliary.appendPropertyList(propertyList)

def jobNameList = ["compute-rocm-dkms-no-npi":([ubuntu16:['gfx900'],centos7:['gfx906'],sles15sp1:['gfx906']]),
"compute-rocm-dkms-no-npi-hipclang":([ubuntu16:['gfx900'],centos7:['gfx906'],sles15sp1:['gfx906']]),
def jobNameList = ["compute-rocm-dkms-no-npi-hipclang":([ubuntu18:['gfx900'],centos7:['gfx906'],sles15sp1:['gfx908']]),
"rocm-docker":([ubuntu16:['gfx900'],ubuntu18:['gfx900'],centos7:['gfx906'],sles15sp1:['gfx906']])]
jobNameList = auxiliary.appendJobNameList(jobNameList)

Expand Down
85 changes: 85 additions & 0 deletions .jenkins/staticlibrary.groovy
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
#!/usr/bin/env groovy
// This shared library is available at https://github.com/ROCmSoftwarePlatform/rocJENKINS/
@Library('rocJenkins@pong') _

// This is file for internal AMD use.
// If you are interested in running your own Jenkins, please raise a github issue for assistance.

import com.amd.project.*
import com.amd.docker.*
import java.nio.file.Path

def runCI =
{
nodeDetails, jobName->

def prj = new rocProject('hipBLAS', 'StaticLibrary')
prj.paths.build_command = './install.sh -cd --static -p /opt/rocm/lib/cmake'
prj.libraryDependencies = ['rocBLAS-internal', 'rocSOLVER']

// Define test architectures, optional rocm version argument is available
def nodes = new dockerNodes(nodeDetails, jobName, prj)

boolean formatCheck = true

def commonGroovy

def compileCommand =
{
platform, project->

commonGroovy = load "${project.paths.project_src_prefix}/.jenkins/common.groovy"
commonGroovy.runCompileCommand(platform, project, jobName, true)
}

def testCommand =
{
platform, project->

commonGroovy.runTestCommand(platform, project)
}

def packageCommand =
{
platform, project->

commonGroovy.runPackageCommand(platform, project)
}

buildProject(prj, formatCheck, nodes.dockerArray, compileCommand, testCommand, packageCommand)
}

ci: {
String urlJobName = auxiliary.getTopJobName(env.BUILD_URL)

def propertyList = ["compute-rocm-dkms-no-npi-hipclang":[pipelineTriggers([cron('0 1 * * 0')])]]
propertyList = auxiliary.appendPropertyList(propertyList)

def jobNameList = ["compute-rocm-dkms-no-npi-hipclang":([ubuntu18:['gfx900']])]
jobNameList = auxiliary.appendJobNameList(jobNameList)

propertyList.each
{
jobName, property->
if (urlJobName == jobName)
properties(auxiliary.addCommonProperties(property))
}

jobNameList.each
{
jobName, nodeDetails->
if (urlJobName == jobName)
stage(jobName) {
runCI(nodeDetails, jobName)
}
}

// For url job names that are not listed by the jobNameList i.e. compute-rocm-dkms-no-npi-1901
if(!jobNameList.keySet().contains(urlJobName))
{
properties(auxiliary.addCommonProperties([pipelineTriggers([cron('0 1 * * *')])]))
stage(urlJobName) {
runCI([ubuntu16:['gfx900']], urlJobName)
}
}
}
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -45,15 +45,15 @@ include( ROCMInstallTargets )
include( ROCMPackageConfigHelpers )
include( ROCMInstallSymlinks )

set ( VERSION_STRING "0.32.0" )
set ( VERSION_STRING "0.34.0" )
rocm_setup_version( VERSION ${VERSION_STRING} )

# Append our library helper cmake path and the cmake path for hip (for convenience)
# Users may override HIP path by specifying their own in CMAKE_MODULE_PATH
list( APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake )

# NOTE: workaround until hcc & hip cmake modules fixes symlink logic in their config files; remove when fixed
list( APPEND CMAKE_PREFIX_PATH /opt/rocm /opt/rocm/hcc /opt/rocm/hip )
list( APPEND CMAKE_PREFIX_PATH /opt/rocm /opt/rocm/llvm /opt/rocm/hcc /opt/rocm/hip )

option( BUILD_VERBOSE "Output additional build information" OFF )

Expand Down
4 changes: 2 additions & 2 deletions bump_develop_version.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# - run this script in master branch
# - after running this script merge master into develop

OLD_HIPBLAS_VERSION="0.32.0"
NEW_HIPBLAS_VERSION="0.33.0"
OLD_HIPBLAS_VERSION="0.34.0"
NEW_HIPBLAS_VERSION="0.35.0"

sed -i "s/${OLD_HIPBLAS_VERSION}/${NEW_HIPBLAS_VERSION}/g" CMakeLists.txt
4 changes: 2 additions & 2 deletions bump_master_version.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
# - after running this script and merging develop into master, run bump_develop_version.sh in master and
# merge master into develop

OLD_HIPBLAS_VERSION="0.31.0"
NEW_HIPBLAS_VERSION="0.32.0"
OLD_HIPBLAS_VERSION="0.33.0"
NEW_HIPBLAS_VERSION="0.34.0"

sed -i "s/${OLD_HIPBLAS_VERSION}/${NEW_HIPBLAS_VERSION}/g" CMakeLists.txt
3 changes: 1 addition & 2 deletions clients/gtest/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -154,8 +154,7 @@ if( NOT CUDA_FOUND )
if ( LIBAMDHIP64_LIBRARY )
target_link_libraries( hipblas-test PRIVATE hip::amdhip64 hip::host )
else ( )
get_target_property( HIP_HCC_LOCATION hip::hip_hcc IMPORTED_LOCATION_RELEASE )
target_link_libraries( hipblas-test PRIVATE ${HIP_HCC_LOCATION} )
target_link_libraries( hipblas-test PRIVATE hip::host )
endif ( )
endif( )

Expand Down
3 changes: 1 addition & 2 deletions clients/samples/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,7 @@ foreach( exe example-sscal;example-sgemm;example-sgemm-strided-batched;example-c
if( LIBAMDHIP64_LIBRARY )
target_link_libraries( ${exe} PRIVATE hip::amdhip64 hip::host )
else( )
get_target_property( HIP_HCC_LOCATION hip::hip_hcc IMPORTED_LOCATION_RELEASE )
target_link_libraries( ${exe} PRIVATE ${HIP_HCC_LOCATION} )
target_link_libraries( ${exe} PRIVATE hip::host )
endif( )
endif( )

Expand Down
18 changes: 16 additions & 2 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ function display_help()
echo " [-v|--rocm-dev] Set specific rocm-dev version"
echo " [-b|--rocblas] Set specific rocblas version"
echo " [--rocblas-path] Set specific path to custom built rocblas"
echo " [--static] Create static library instead of shared library"
}

# This function is helpful for dockerfiles that do not have sudo installed, but the default user is root
Expand Down Expand Up @@ -283,6 +284,7 @@ build_relocatable=false
cmake_prefix_path=/opt/rocm
rocm_path=/opt/rocm
compiler=g++
build_static=false

# #################################################
# Parameter parsing
Expand All @@ -291,7 +293,7 @@ compiler=g++
# check if we have a modern version of getopt that can handle whitespace and long parameters
getopt -T
if [[ $? -eq 4 ]]; then
GETOPT_PARSE=$(getopt --name "${0}" --longoptions help,install,clients,no-solver,dependencies,debug,hip-clang,compiler:,cuda,cmakepp,relocatable:,rocm-dev:,rocblas:,rocblas-path:,custom-target: --options rhicndgp:v:b: -- "$@")
GETOPT_PARSE=$(getopt --name "${0}" --longoptions help,install,clients,no-solver,dependencies,debug,hip-clang,compiler:,cuda,static,cmakepp,relocatable:,rocm-dev:,rocblas:,rocblas-path:,custom-target: --options rhicndgp:v:b: -- "$@")
else
echo "Need a new version of getopt"
exit 1
Expand Down Expand Up @@ -337,6 +339,9 @@ while true; do
--cuda)
build_cuda=true
shift ;;
--static)
build_static=true
shift ;;
-p|--cmakepp)
cmake_prefix_path=${2}
shift 2 ;;
Expand Down Expand Up @@ -415,14 +420,23 @@ if [[ "${install_dependencies}" == true ]]; then
# We append customary rocm path; if user provides custom rocm path in ${path}, our
# hard-coded path has lesser priority
# export PATH=${PATH}:/opt/rocm/bin

pushd .
# #################################################
# configure & build
# #################################################
cmake_common_options=""
cmake_client_options=""

if [[ "${build_static}" == true ]]; then
if [[ "${build_cuda}" == true ]]; then
printf "Static library not supported for CUDA backend.\n"
exit 1
fi
cmake_common_options="${cmake_common_options} -DBUILD_SHARED_LIBS=OFF"
compiler="${rocm_path}/bin/hipcc" #force hipcc for static libs, g++ doesn't work
printf "Forcing compiler to hipcc for static library.\n"
fi

# build type
if [[ "${build_release}" == true ]]; then
mkdir -p ${build_dir}/release/clients && cd ${build_dir}/release
Expand Down
3 changes: 1 addition & 2 deletions library/src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,7 @@ if( NOT CUDA_FOUND )
if ( LIBAMDHIP64_LIBRARY )
target_link_libraries( hipblas PRIVATE hip::amdhip64 )
else ( )
get_target_property( HIP_HCC_LOCATION hip::hip_hcc IMPORTED_LOCATION_RELEASE )
target_link_libraries( hipblas PRIVATE ${HIP_HCC_LOCATION} )
target_link_libraries( hipblas PRIVATE hip::host )
endif ( )
endif( )

Expand Down

0 comments on commit 5299dc5

Please sign in to comment.