Skip to content

Commit

Permalink
Merge pull request #46 from ROCmSoftwarePlatform/develop
Browse files Browse the repository at this point in the history
Develop to Master for rocm 2.6 release
  • Loading branch information
ex-rzr authored Jun 20, 2019
2 parents 340757c + ab10770 commit 201ddde
Show file tree
Hide file tree
Showing 38 changed files with 5,618 additions and 280 deletions.
120 changes: 120 additions & 0 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
# Style file for MLSE Libraries based on the modified rocBLAS style

# Common settings
BasedOnStyle: WebKit
TabWidth: 4
IndentWidth: 4
UseTab: Never
ColumnLimit: 100

# Other languages JavaScript, Proto

---
Language: Cpp

# http://releases.llvm.org/6.0.1/tools/clang/docs/ClangFormatStyleOptions.html#disabling-formatting-on-a-piece-of-code
# int formatted_code;
# // clang-format off
# void unformatted_code ;
# // clang-format on
# void formatted_code_again;

DisableFormat: false
Standard: Cpp11

AccessModifierOffset: -4
AlignAfterOpenBracket: true
AlignConsecutiveAssignments: true
AlignConsecutiveDeclarations: true
AlignEscapedNewlinesLeft: true
AlignOperands: true
AlignTrailingComments: false
AllowAllParametersOfDeclarationOnNextLine: true
AllowShortBlocksOnASingleLine: false
AllowShortCaseLabelsOnASingleLine: false
AllowShortFunctionsOnASingleLine: Empty
AllowShortIfStatementsOnASingleLine: false
AllowShortLoopsOnASingleLine: false
AlwaysBreakAfterDefinitionReturnType: false
AlwaysBreakAfterReturnType: None
AlwaysBreakBeforeMultilineStrings: false
AlwaysBreakTemplateDeclarations: true
BinPackArguments: false
BinPackParameters: false

# Configure each individual brace in BraceWrapping
BreakBeforeBraces: Custom
# Control of individual brace wrapping cases
BraceWrapping: {
AfterClass: 'true'
AfterControlStatement: 'true'
AfterEnum : 'true'
AfterFunction : 'true'
AfterNamespace : 'true'
AfterStruct : 'true'
AfterUnion : 'true'
BeforeCatch : 'true'
BeforeElse : 'true'
IndentBraces : 'false'
# AfterExternBlock : 'true'
}

#BreakAfterJavaFieldAnnotations: true
#BreakBeforeInheritanceComma: false
#BreakBeforeBinaryOperators: None
#BreakBeforeTernaryOperators: true
#BreakConstructorInitializersBeforeComma: true
#BreakStringLiterals: true

CommentPragmas: '^ IWYU pragma:'
#CompactNamespaces: false
ConstructorInitializerAllOnOneLineOrOnePerLine: false
ConstructorInitializerIndentWidth: 4
ContinuationIndentWidth: 4
Cpp11BracedListStyle: true
#SpaceBeforeCpp11BracedList: false
DerivePointerAlignment: false
ExperimentalAutoDetectBinPacking: false
ForEachMacros: [ foreach, Q_FOREACH, BOOST_FOREACH ]
IndentCaseLabels: false
#FixNamespaceComments: true
IndentWrappedFunctionNames: false
KeepEmptyLinesAtTheStartOfBlocks: true
MacroBlockBegin: ''
MacroBlockEnd: ''
#JavaScriptQuotes: Double
MaxEmptyLinesToKeep: 1
NamespaceIndentation: Inner
ObjCBlockIndentWidth: 4
#ObjCSpaceAfterProperty: true
#ObjCSpaceBeforeProtocolList: true
PenaltyBreakBeforeFirstCallParameter: 19
PenaltyBreakComment: 300
PenaltyBreakFirstLessLess: 120
PenaltyBreakString: 1000

PenaltyExcessCharacter: 1000000
PenaltyReturnTypeOnItsOwnLine: 60
PointerAlignment: Left
SpaceAfterCStyleCast: false
SpaceBeforeAssignmentOperators: true
SpaceBeforeParens: Never
SpaceInEmptyParentheses: false
SpacesBeforeTrailingComments: 1
SpacesInAngles: false
SpacesInContainerLiterals: true
SpacesInCStyleCastParentheses: false
SpacesInParentheses: false
SpacesInSquareBrackets: false
#SpaceAfterTemplateKeyword: true
#SpaceBeforeInheritanceColon: true

#SortUsingDeclarations: true
SortIncludes: true

# Comments are for developers, they should arrange them
ReflowComments: false

#IncludeBlocks: Preserve
#IndentPPDirectives: AfterHash
---
2 changes: 1 addition & 1 deletion .gitlab-ci-gputest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ test:vega20:
test:s9300:
extends: .test
before_script:
# - echo 'deb [arch=amd64] http://repo.radeon.com/rocm/apt/.apt_2.2/ xenial main' | $SUDO_CMD tee /etc/apt/sources.list.d/rocm.list
- echo 'deb [arch=amd64] http://repo.radeon.com/rocm/apt/.apt_2.5/ xenial main' | $SUDO_CMD tee /etc/apt/sources.list.d/rocm.list
- $SUDO_CMD apt-get update -qq
- $SUDO_CMD apt-get upgrade -qq
dependencies:
Expand Down
28 changes: 15 additions & 13 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,20 +55,21 @@ build:rocm:
script:
- mkdir build
- cd build
# CXX=hcc cmake -DBUILD_TEST=ON -DBUILD_EXAMPLE=ON -DBUILD_BENCHMARK=ON ../.
- CXX=hcc cmake -DBUILD_TEST=ON ../.
- make -j16
- make -j $(nproc)
- make package
artifacts:
paths:
- build/library/
- build/test/test_*
- build/test/CTestTestfile.cmake
- build/gtest/
- build/CMakeCache.txt
- build/CTestTestfile.cmake
- build/rocthrust*.deb
- build/rocthrust*.zip
- build/thrust/
- build/test/test_*
- build/test/CTestTestfile.cmake
- build/testing/test_thrust_*
- build/testing/CTestTestfile.cmake
- build/gtest/
- build/CMakeCache.txt
- build/CTestTestfile.cmake
- build/rocthrust*.deb
- build/rocthrust*.zip
expire_in: 2 weeks

.test:
Expand All @@ -79,7 +80,7 @@ build:rocm:
- build:rocm
script:
- cd build
- $SUDO_CMD ctest --output-on-failure --repeat-until-fail 2
- $SUDO_CMD ctest --output-on-failure --repeat-until-fail 1

include: '.gitlab-ci-gputest.yml'

Expand Down Expand Up @@ -109,7 +110,7 @@ test:rocm_package:
- mkdir ../package_test && cd ../package_test
- CXX=hcc cmake ../extra/. -Drocprim_DIR="/opt/rocm/rocprim"
- make VERBOSE=1
- $SUDO_CMD ctest --output-on-failure --repeat-until-fail 2
- $SUDO_CMD ctest --output-on-failure --repeat-until-fail 1
- $SUDO_CMD dpkg -r rocthrust
- $SUDO_CMD dpkg -r rocprim

Expand All @@ -119,6 +120,7 @@ test:rocm_install:
- rocm
variables:
SUDO_CMD: "sudo -E"
dependencies: []
script:
- mkdir build_only_install
- cd build_only_install
Expand All @@ -127,4 +129,4 @@ test:rocm_install:
- mkdir ../install_test && cd ../install_test
- CXX=hcc cmake ../extra/.
- make VERBOSE=1
- $SUDO_CMD ctest --output-on-failure --repeat-until-fail 2
- $SUDO_CMD ctest --output-on-failure --repeat-until-fail 1
24 changes: 24 additions & 0 deletions .readthedocs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# .readthedocs.yml
# Read the Docs configuration file
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details

# Required
version: 2

# Build documentation in the docs/ directory with Sphinx
sphinx:
configuration: docs/conf.py

# Build documentation with MkDocs
#mkdocs:
# configuration: mkdocs.yml

# Optionally build your docs in additional formats such as PDF and ePub
formats: all

# Optionally set the version of Python and requirements required to build your docs
python:
version: 3.7
install:
- requirements: docs/requirements.txt

20 changes: 17 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ else()
endif()

# Thrust project
project(thrust VERSION 2.5.0.0 LANGUAGES CXX)
project(rocthrust LANGUAGES CXX)

# CMake modules
list(APPEND CMAKE_MODULE_PATH
Expand Down Expand Up @@ -65,6 +65,17 @@ include(cmake/Dependencies.cmake)
# AMD targets
set(AMDGPU_TARGETS gfx803;gfx900;gfx906 CACHE STRING "List of specific machine types for library to target")

# Setup VERSION
set ( VERSION_STRING "2.6.0." )

# Check if BUILD_NUMBER is defined in a Jenkins envirnment
if ($ENV{BUILD_NUMBER} )
string(CONCAT BUILD_VERSION ${VERSION_STRING} $ENV{BUILD_NUMBER})
else ()
string(CONCAT BUILD_VERSION ${VERSION_STRING} "0")
endif ()
rocm_setup_version( VERSION ${BUILD_VERSION} NO_GIT_TAG_VERSION )

# Print configuration summary
include(cmake/Summary.cmake)
print_configuration_summary()
Expand All @@ -81,11 +92,14 @@ endif()

# Package
set(CPACK_DEBIAN_ARCHIVE_TYPE "gnutar")
set(CPACK_DEBIAN_PACKAGE_DEPENDS "hip_hcc (>= 1.5.18263), rocprim (>= 1.0)") # 1.5.18263 is HIP version in ROCm 1.8.2

set(CPACK_DEBIAN_PACKAGE_DEPENDS "hip_hcc (>= 1.5.18263), rocprim (>= 2.5)") # 1.5.18263 is HIP version in ROCm 1.8.2
set(CPACK_DEBIAN_PACKAGE_CONFLICTS "hip-thrust, thrust")
set(CPACK_RPM_PACKAGE_CONFLICTS "hip-thrust, thrust")
set(CPACK_RPM_PACKAGE_REQUIRES "hip_hcc >= 1.5.18263, rocprim >= 1.0")
set(CPACK_RPM_PACKAGE_REQUIRES "hip_hcc >= 1.5.18263, rocprim >= 2.5")

set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/LICENSE")

if(NOT CPACK_PACKAGING_INSTALL_PREFIX)
set(CPACK_PACKAGING_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}")
endif()
Expand Down
73 changes: 53 additions & 20 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@ rocThrustCI:

def rocthrust = new rocProject('rocthrust')
// customize for project
rocthrust.paths.build_command = 'cmake -D CMAKE_CXX_COMPILER="/opt/rocm/hcc/bin/hcc" CMakeLists.txt -Bbuild && cd build'
rocthrust.paths.build_command = './install -c'

// Define test architectures, optional rocm version argument is available
def nodes = new dockerNodes(['gfx900', 'gfx906'], rocthrust)
def nodes = new dockerNodes(['gfx900 && centos7', 'gfx906'], rocthrust)

boolean formatCheck = false

Expand All @@ -56,12 +56,26 @@ rocThrustCI:
{
platform, project->

def command = """#!/usr/bin/env bash
set -x
cd ${project.paths.project_build_prefix}/build
make -j4
ctest --output-on-failure
"""
def command

if(platform.jenkinsLabel.contains('centos'))
{
command = """#!/usr/bin/env bash
set -x
cd ${project.paths.project_build_prefix}/build/release
make -j4
sudo ctest --output-on-failure
"""
}
else
{
command = """#!/usr/bin/env bash
set -x
cd ${project.paths.project_build_prefix}/build/release
make -j4
ctest --output-on-failure
"""
}

platform.runCommand(this, command)
}
Expand All @@ -70,19 +84,38 @@ rocThrustCI:
{
platform, project->

def command = """
set -x
cd ${project.paths.project_build_prefix}/build
make package
rm -rf package && mkdir -p package
mv *.deb package/
dpkg -c package/*.deb
"""

platform.runCommand(this, command)
platform.archiveArtifacts(this, """${project.paths.project_build_prefix}/build/package/*.deb""")
def command

if(platform.jenkinsLabel.contains('centos'))
{
command = """
set -x
cd ${project.paths.project_build_prefix}/build/release
make package
rm -rf package && mkdir -p package
mv *.rpm package/
rpm -qlp package/*.rpm
"""

platform.runCommand(this, command)
platform.archiveArtifacts(this, """${project.paths.project_build_prefix}/build/release/package/*.rpm""")
}
else
{
command = """
set -x
cd ${project.paths.project_build_prefix}/build/release
make package
rm -rf package && mkdir -p package
mv *.deb package/
dpkg -c package/*.deb
"""

platform.runCommand(this, command)
platform.archiveArtifacts(this, """${project.paths.project_build_prefix}/build/release/package/*.deb""")
}
}

buildProject(rocthrust, formatCheck, nodes.dockerArray, compileCommand, testCommand, packageCommand)

}
}
15 changes: 3 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ https://github.com/RadeonOpenCompute/ROCm/blob/master/README.md#supported-cpus

## Build And Install

```
```sh
git clone https://github.com/ROCmSoftwarePlatform/rocThrust

# Go to rocThrust directory, create and go to the build directory.
Expand Down Expand Up @@ -79,7 +79,7 @@ target_link_libraries(<your_target> rocthrust)

## Running Unit Tests

```
```sh
# Go to rocThrust build directory
cd rocThrust; cd build

Expand All @@ -92,16 +92,7 @@ ctest

## Documentation

```
# go to rocThrust doc directory
cd rocThrust
# run doxygen
doxygen doc/thrust.dox
# open html/index.html
```
Documentation is available [here](https://rocthrust.readthedocs.io/en/latest/).

## Support

Expand Down
Loading

0 comments on commit 201ddde

Please sign in to comment.