Skip to content

Commit

Permalink
Merge branch 'release/rocm-rel-4.3' into xnack_on_hmm
Browse files Browse the repository at this point in the history
  • Loading branch information
stanleytsang-amd authored Jun 3, 2021
2 parents f82f00a + 84d8dcd commit 489c11a
Show file tree
Hide file tree
Showing 79 changed files with 1,882 additions and 6,308 deletions.
12 changes: 6 additions & 6 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ stages:

variables:
# Tested CMake versions
CMAKE_MINIMUM_VERSION: 3.5.2
CMAKE_MINIMUM_VERSION: 3.10.2
CMAKE_LATEST_VERSION: 3.17.0
# Cluster config

Expand All @@ -23,11 +23,11 @@ variables:
# Helper variables
DEPS_DIR: $CI_PROJECT_DIR/deps
BUILD_DIR: $CI_PROJECT_DIR/build
CMAKE_MINIMUM_URL: "https://cmake.org/files/v3.5/cmake-3.5.1-Linux-x86_64.tar.gz"
CMAKE_MINIMUM_PATH: "$CI_PROJECT_DIR/deps/cmake-3.5.2"
CMAKE_MINIMUM_URL: "https://cmake.org/files/v3.10/cmake-3.10.2-Linux-x86_64.tar.gz"
CMAKE_MINIMUM_PATH: "$CI_PROJECT_DIR/deps/cmake-3.10.2"
CMAKE_LATEST_URL: "https://cmake.org/files/v3.16/cmake-3.16.0-Linux-x86_64.tar.gz"
CMAKE_LATEST_PATH: "$CI_PROJECT_DIR/deps/cmake-3.17.0"
BUILD_MINIMUM_DIR: $CI_PROJECT_DIR/build/cmake-3.5.2
BUILD_MINIMUM_DIR: $CI_PROJECT_DIR/build/cmake-3.10.2
BUILD_LATEST_DIR: $CI_PROJECT_DIR/build/cmake-3.17.0
PACKAGE_DIR: $CI_PROJECT_DIR/build/package

Expand Down Expand Up @@ -189,8 +189,8 @@ deploy:deb:
-G "DEB;ZIP"
-B $PACKAGE_DIR
# Install rocPRIM and rocThrust
- $SUDO_CMD dpkg -i $PACKAGE_DIR/rocprim-*.deb
- $SUDO_CMD dpkg -i $PACKAGE_DIR/rocthrust-*.deb
- $SUDO_CMD dpkg -i $PACKAGE_DIR/rocprim*.deb
- $SUDO_CMD dpkg -i $PACKAGE_DIR/rocthrust*.deb
# Test install
- mkdir -p package_test
- cd package_test
Expand Down
6 changes: 4 additions & 2 deletions .jenkins/common.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ def runCompileCommand(platform, project, jobName, boolean debug=false, boolean s
String buildTypeArg = debug ? '-DCMAKE_BUILD_TYPE=Debug' : '-DCMAKE_BUILD_TYPE=Release'
String buildTypeDir = debug ? 'debug' : 'release'
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' : ''

def getRocPRIM = auxiliary.getLibrary('rocPRIM', platform.jenkinsLabel, 'develop', sameOrg)

Expand All @@ -16,14 +18,14 @@ def runCompileCommand(platform, project, jobName, boolean debug=false, boolean s
${getRocPRIM}
cd ${project.paths.project_build_prefix}
mkdir -p build/${buildTypeDir} && cd build/${buildTypeDir}
${cmake} -DCMAKE_CXX_COMPILER=/opt/rocm/bin/hipcc ${buildTypeArg} -DBUILD_TEST=ON -DBUILD_BENCHMARK=ON ../..
${auxiliary.gfxTargetParser()}
${cmake} -DCMAKE_CXX_COMPILER=/opt/rocm/bin/hipcc ${buildTypeArg} ${amdgpuTargets} -DBUILD_TEST=ON -DBUILD_BENCHMARK=ON ../..
make -j\$(nproc)
"""

platform.runCommand(this, command)
}


def runTestCommand (platform, project)
{
String sudo = auxiliary.sudo(platform.jenkinsLabel)
Expand Down
2 changes: 2 additions & 0 deletions .jenkins/precheckin.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ def runCI =

def prj = new rocProject('rocThrust', 'precheckin')

prj.timeout.compile = 420

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

Expand Down
68 changes: 68 additions & 0 deletions .jenkins/staticanalysis.groovy
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
#!/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 runCompileCommand(platform, project, jobName, boolean debug=false)
{
project.paths.construct_build_prefix()

def command = """#!/usr/bin/env bash
set -x
${project.paths.project_build_prefix}/docs/run_doc.sh
"""

try
{
platform.runCommand(this, command)
}
catch(e)
{
throw e
}

publishHTML([allowMissing: false,
alwaysLinkToLastBuild: false,
keepAll: false,
reportDir: "${project.paths.project_build_prefix}/docs/_build/html",
reportFiles: "index.html",
reportName: "Documentation",
reportTitles: "Documentation"])
}

def runCI =
{
nodeDetails, jobName->

def prj = new rocProject('rocThrust', 'StaticAnalysis')

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

boolean formatCheck = false
boolean staticAnalysis = true

def compileCommand =
{
platform, project->

runCompileCommand(platform, project, jobName, false)
}

buildProject(prj , formatCheck, nodes.dockerArray, compileCommand, null, null, staticAnalysis)
}

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

properties(auxiliary.addCommonProperties([pipelineTriggers([cron('0 1 * * 6')])]))
stage(urlJobName) {
runCI([ubuntu18:['any']], urlJobName)
}
}
2 changes: 2 additions & 0 deletions .jenkins/staticlibrary.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ def runCI =

def prj = new rocProject('rocThrust', 'Static Library PreCheckin')

prj.timeout.compile = 420

def nodes = new dockerNodes(nodeDetails, jobName, prj)

def commonGroovy
Expand Down
21 changes: 20 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,26 @@

Full documentation for rocThrust is available at [https://rocthrust.readthedocs.io/en/latest/](https://rocthrust.readthedocs.io/en/latest/)

## [Unreleased rocThrust-2.10.7 for ROCm 4.0.0]
## [rocThrust-2.11.0 for ROCm 4.3.0]
### Added
- Updated to match upstream Thrust 1.11
- gfx90a support added
- gfx803 support re-enabled

## [rocThrust-2.10.9 for ROCm 4.2.0]
### Added
- Updated to match upstream Thrust 1.10
### Changed
- Minimum cmake version required for building rocThrust is now 3.10.2
### Fixed
- Size zero inputs are now properly handled with newer ROCm builds that no longer allow zero-size kernel grid/block dimensions
- Warning of unused results fixed.

## [rocThrust-2.10.8 for ROCm 4.1.0]
### Added
- No new features

## [rocThrust-2.10.7 for ROCm 4.0.0]
### Added
- Updated to upstream Thrust 1.10.0
- Implemented runtime error for unsupported algorithms and disabled respective tests.
Expand Down
37 changes: 31 additions & 6 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Copyright 2019-2020 Advanced Micro Devices, Inc.
# ########################################################################

cmake_minimum_required(VERSION 3.5.1 FATAL_ERROR)
cmake_minimum_required(VERSION 3.10.2 FATAL_ERROR)

# Install prefix
if(WIN32)
Expand Down Expand Up @@ -32,7 +32,18 @@ endif()

set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE CACHE BOOL "Add paths to linker search and installed rpath")

# rocm-cmake contains common cmake code for rocm projects to help
# setup and install
find_package( ROCM CONFIG )
include( ROCMSetupVersion )
include( ROCMCreatePackage )
include( ROCMInstallTargets )
include( ROCMPackageConfigHelpers )
include( ROCMInstallSymlinks )
include( ROCMCheckTargetIds OPTIONAL )

# Detect compiler support for target ID
# This section is deprecated. Please use rocm_check_target_ids for future use.
if( CMAKE_CXX_COMPILER MATCHES ".*/hipcc$" )
execute_process(COMMAND ${CMAKE_CXX_COMPILER} "--help"
OUTPUT_VARIABLE CXX_OUTPUT
Expand All @@ -41,12 +52,20 @@ if( CMAKE_CXX_COMPILER MATCHES ".*/hipcc$" )
string(REGEX MATCH ".mcode\-object\-version" TARGET_ID_SUPPORT ${CXX_OUTPUT})
endif()

# Use target ID syntax if supported for AMDGPU_TARGETS
if(TARGET_ID_SUPPORT)
set(AMDGPU_TARGETS gfx900:xnack-;gfx906:xnack-;gfx908:xnack-;gfx908:xnack+ CACHE STRING "List of specific machine types for library to target")
#Set the AMDGPU_TARGETS with backward compatiblity
if(COMMAND rocm_check_target_ids)
rocm_check_target_ids(DEFAULT_AMDGPU_TARGETS
TARGETS "gfx803;gfx900:xnack-;gfx906:xnack-;gfx908:xnack-;gfx90a:xnack-;gfx90a:xnack+;gfx1030"
)
else()
set(AMDGPU_TARGETS gfx900;gfx906;gfx908 CACHE STRING "List of specific machine types for library to target")
# Use target ID syntax if supported for AMDGPU_TARGETS
if(TARGET_ID_SUPPORT)
set(DEFAULT_AMDGPU_TARGETS "gfx803;gfx900:xnack-;gfx906:xnack-;gfx908:xnack-;gfx1030")
else()
set(DEFAULT_AMDGPU_TARGETS "gfx803;gfx900;gfx906;gfx908")
endif()
endif()
set(AMDGPU_TARGETS "${DEFAULT_AMDGPU_TARGETS}" CACHE STRING "List of specific machine types for library to target")

# Verify that hcc or hipcc compiler is used on ROCM platform
include(cmake/VerifyCompiler.cmake)
Expand Down Expand Up @@ -80,11 +99,17 @@ set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)

if(DISABLE_WERROR)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra")
else()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Werror")
endif()

# Get dependencies
include(cmake/Dependencies.cmake)

# Setup VERSION
rocm_setup_version(VERSION "2.10.7")
rocm_setup_version(VERSION "2.10.9")

# Print configuration summary
include(cmake/Summary.cmake)
Expand Down
35 changes: 0 additions & 35 deletions cmake/Dependencies.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -60,38 +60,3 @@ if(BUILD_TEST)
)
find_package(GTest REQUIRED)
endif()

# Find or download/install rocm-cmake project
find_package(ROCM QUIET CONFIG PATHS /opt/rocm)
if(NOT ROCM_FOUND)
set(rocm_cmake_tag "master" CACHE STRING "rocm-cmake tag to download")
file(
DOWNLOAD https://github.com/RadeonOpenCompute/rocm-cmake/archive/${rocm_cmake_tag}.zip
${CMAKE_CURRENT_BINARY_DIR}/rocm-cmake-${rocm_cmake_tag}.zip
STATUS rocm_cmake_download_status LOG rocm_cmake_download_log
)
list(GET rocm_cmake_download_status 0 rocm_cmake_download_error_code)
if(rocm_cmake_download_error_code)
message(FATAL_ERROR "Error: downloading "
"https://github.com/RadeonOpenCompute/rocm-cmake/archive/${rocm_cmake_tag}.zip failed "
"error_code: ${rocm_cmake_download_error_code} "
"log: ${rocm_cmake_download_log} "
)
endif()

execute_process(
COMMAND ${CMAKE_COMMAND} -E tar xzf ${CMAKE_CURRENT_BINARY_DIR}/rocm-cmake-${rocm_cmake_tag}.zip
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
RESULT_VARIABLE rocm_cmake_unpack_error_code
)
if(rocm_cmake_unpack_error_code)
message(FATAL_ERROR "Error: unpacking ${CMAKE_CURRENT_BINARY_DIR}/rocm-cmake-${rocm_cmake_tag}.zip failed")
endif()
find_package(ROCM REQUIRED CONFIG PATHS ${CMAKE_CURRENT_BINARY_DIR}/rocm-cmake-${rocm_cmake_tag})
endif()

include(ROCMSetupVersion)
include(ROCMCreatePackage)
include(ROCMInstallTargets)
include(ROCMPackageConfigHelpers)
include(ROCMInstallSymlinks)
25 changes: 19 additions & 6 deletions docs/Doxyfile
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ DOXYFILE_ENCODING = UTF-8
# title of most generated pages and in a few other places.
# The default value is: My Project.

PROJECT_NAME = "RCCL"
PROJECT_NAME = thrust

# The PROJECT_NUMBER tag can be used to enter a project or revision number. This
# could be handy for archiving the generated documentation or if some version
Expand Down Expand Up @@ -162,7 +162,7 @@ FULL_PATH_NAMES = YES
# will be relative from the directory where doxygen is started.
# This tag requires that the tag FULL_PATH_NAMES is set to YES.

STRIP_FROM_PATH =
STRIP_FROM_PATH = ..

# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of the
# path mentioned in the documentation of a class, which tells the reader which
Expand Down Expand Up @@ -2029,7 +2029,7 @@ ENABLE_PREPROCESSING = YES
# The default value is: NO.
# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.

MACRO_EXPANSION = NO
MACRO_EXPANSION = YES

# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES then
# the macro expansion is limited to the macros specified with the PREDEFINED and
Expand All @@ -2044,7 +2044,7 @@ EXPAND_ONLY_PREDEF = NO
# The default value is: YES.
# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.

SEARCH_INCLUDES = YES
SEARCH_INCLUDES = NO

# The INCLUDE_PATH tag can be used to specify one or more directories that
# contain include files that are not input files but should be processed by the
Expand All @@ -2069,7 +2069,20 @@ INCLUDE_FILE_PATTERNS =
# recursively expanded use the := operator instead of the = operator.
# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.

PREDEFINED =
PREDEFINED = THRUST_NOEXCEPT=noexcept \
"THRUST_INLINE_CONSTANT=inline constexpr" \
"THRUST_DEFAULT={}" \
"THRUST_NODISCARD=[[nodiscard]]" \
"THRUST_MR_DEFAULT_ALIGNMENT=alignof(max_align_t)" \
"THRUST_FINAL=final" \
"THRUST_OVERRIDE=" \
"THRUST_BEGIN_NS=namespace thrust {" \
"THRUST_END_NS=}" \
"cuda_cub=system::cuda" \
THRUST_PREVENT_MACRO_SUBSTITUTION= \
__thrust_exec_check_disable__= \
DOXYGEN_DOCUMENTATION_BUILD= \
DOXYGEN_SHOULD_SKIP_THIS=

# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then this
# tag can be used to specify a list of macro names that should be expanded. The
Expand All @@ -2088,7 +2101,7 @@ EXPAND_AS_DEFINED =
# The default value is: YES.
# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.

SKIP_FUNCTION_MACROS = YES
SKIP_FUNCTION_MACROS = NO

#---------------------------------------------------------------------------
# Configuration options related to external references
Expand Down
6 changes: 5 additions & 1 deletion docs/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,13 @@ BUILDDIR = _build
help:
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

.PHONY: help Makefile
.PHONY: help Makefile clean

# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

clean:
rm -rf docBin/ api/
@$(SPHINXBUILD) -M clean "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
8 changes: 0 additions & 8 deletions docs/api.rst

This file was deleted.

Loading

0 comments on commit 489c11a

Please sign in to comment.