Skip to content

Commit

Permalink
Merge pull request #66 from ntrost57/master
Browse files Browse the repository at this point in the history
merged documentation into master
  • Loading branch information
ntrost57 authored Oct 15, 2018
2 parents 31c83f9 + 234d6b7 commit b48be2a
Show file tree
Hide file tree
Showing 29 changed files with 1,925 additions and 3,310 deletions.
8 changes: 8 additions & 0 deletions .githooks/install
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/usr/bin/env bash

cd $(git rev-parse --git-dir)
cd hooks

echo "Installing hooks..."
ln -s ../../.githooks/pre-commit pre-commit
echo "Done!"
43 changes: 43 additions & 0 deletions .githooks/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
#!/bin/sh
#
# This pre-commit hook checks if any versions of clang-format
# are installed, and if so, uses the installed version to format
# the staged changes.

base=clang-format-3.8
format=""

# Redirect output to stderr.
exec 1>&2

# check if clang-format is installed
type "$base" >/dev/null 2>&1 && format="$base"

# no versions of clang-format are installed
if [ -z "$format" ]
then
echo "$base is not installed. Pre-commit hook will not be executed."
exit 0
fi

# Do everything from top - level
cd $(git rev-parse --show-toplevel)

if git rev-parse --verify HEAD >/dev/null 2>&1
then
against=HEAD
else
# Initial commit: diff against an empty tree object
against=4b825dc642cb6eb9a060e54bf8d69288fbee4904
fi

# do the formatting
for file in $(git diff-index --cached --name-only $against | grep -E '\.h$|\.hpp$|\.cpp$|\.cl$|\.h\.in$|\.hpp\.in$|\.cpp\.in$')
do
if [ -e "$file" ]
then
echo "$format $file"
"$format" -i -style=file "$file"
fi
done

21 changes: 21 additions & 0 deletions .github/BUG_REPORT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
### What is the expected behavior
-

### What actually happens
-

### How to reproduce
-

### Environment
| Hardware | description |
|-----|-----|
| GPU | device string |
| CPU | device string |

| Software | version |
|-----|-----|
| ROCK | v0.0 |
| ROCR | v0.0 |
| HCC | v0.0 |
| Library | v0.0 |
85 changes: 85 additions & 0 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@

## Contribution License Agreement
1. The code I am contributing is mine, and I have the right to license it.

2. By submitting a pull request for this project I am granting you a license to distribute said code under the MIT License for the project.

## How to contribute

Our code contriubtion guidelines closely follows the model of [GitHub pull-requests](https://help.github.com/articles/using-pull-requests/). This repository follows the [git flow](http://nvie.com/posts/a-successful-git-branching-model/) workflow, which dictates a /master branch where releases are cut, and a /develop branch which serves as an integration branch for new code.
* A [git extention](https://github.com/nvie/gitflow) has been developed to ease the use of the 'git flow' methodology, but requires manual installation by the user. Refer to the projects wiki

## Pull-request guidelines
* target the **develop** branch for integration
* ensure code builds successfully.
* do not break existing test cases
* new functionality will only be merged with new unit tests
* new unit tests should integrate within the existing [googletest framework](https://github.com/google/googletest/blob/master/googletest/docs/primer.md)
* tests must have good code coverage
* code must also have benchmark tests, and performance must approach the compute bound limit or memory bound limit.

## StyleGuide
This project follows the [CPP Core guidelines](https://github.com/isocpp/CppCoreGuidelines/blob/master/CppCoreGuidelines.md), with few modifications or additions noted below. All pull-requests should in good faith attempt to follow the guidelines stated therein, but we recognize that the content is lengthy. Below we list our primary concerns when reviewing pull-requests.

### Interface
- All public APIs are C89 compatible; all other library code should use c++14
- Our minimum supported compiler is clang 3.6
- Avoid CamelCase
- This rule applies specifically to publicly visible APIs, but is also encouraged (not mandated) for internal code

### Philosophy
- [P.2](https://github.com/isocpp/CppCoreGuidelines/blob/master/CppCoreGuidelines.md#Rp-Cplusplus): Write in ISO Standard C++ (especially to support windows, linux and macos plaforms )
- [P.5](https://github.com/isocpp/CppCoreGuidelines/blob/master/CppCoreGuidelines.md#Rp-compile-time): Prefer compile-time checking to run-time checking

### Implementation
- [SF.1](https://github.com/isocpp/CppCoreGuidelines/blob/master/CppCoreGuidelines.md#Rs-file-suffix): Use a .cpp suffix for code files and .h for interface files if your project doesn't already follow another convention
- We modify this rule:
- .h: C header files
- .hpp: C++ header files
- [SF.5](https://github.com/isocpp/CppCoreGuidelines/blob/master/CppCoreGuidelines.md#Rs-consistency): A .cpp file must include the .h file(s) that defines its interface
- [SF.7](https://github.com/isocpp/CppCoreGuidelines/blob/master/CppCoreGuidelines.md#Rs-using-directive): Don't put a using-directive in a header file
- [SF.8](https://github.com/isocpp/CppCoreGuidelines/blob/master/CppCoreGuidelines.md#Rs-guards): Use #include guards for all .h files
- [SF.21](https://github.com/isocpp/CppCoreGuidelines/blob/master/CppCoreGuidelines.md#Rs-unnamed): Don't use an unnamed (anonymous) namespace in a header
- [SL.10](https://github.com/isocpp/CppCoreGuidelines/blob/master/CppCoreGuidelines.md#Rsl-arrays): Prefer using STL array or vector instead of a C array
- [C.9](https://github.com/isocpp/CppCoreGuidelines/blob/master/CppCoreGuidelines.md#Rc-private): minimize exposure of members
- [F.3](https://github.com/isocpp/CppCoreGuidelines/blob/master/CppCoreGuidelines.md#Rf-single): Keep functions short and simple
- [F.21](https://github.com/isocpp/CppCoreGuidelines/blob/master/CppCoreGuidelines.md#Rf-out-multi): To return multiple 'out' values, prefer returning a tuple
- [R.1](https://github.com/isocpp/CppCoreGuidelines/blob/master/CppCoreGuidelines.md#Rr-raii): Manage resources automatically using RAII (this includes unique_ptr & shared_ptr)
- [ES.11](https://github.com/isocpp/CppCoreGuidelines/blob/master/CppCoreGuidelines.md#Res-auto): use auto to avoid redundant repetition of type names
- [ES.20](https://github.com/isocpp/CppCoreGuidelines/blob/master/CppCoreGuidelines.md#Res-always): Always initialize an object
- [ES.23](https://github.com/isocpp/CppCoreGuidelines/blob/master/CppCoreGuidelines.md#Res-list): Prefer the {} initializer syntax
- [ES.49](https://github.com/isocpp/CppCoreGuidelines/blob/master/CppCoreGuidelines.md#Res-casts-named): If you must use a cast, use a named cast
- [CP.1](https://github.com/isocpp/CppCoreGuidelines/blob/master/CppCoreGuidelines.md#S-concurrency): Assume that your code will run as part of a multi-threaded program
- [I.2](https://github.com/isocpp/CppCoreGuidelines/blob/master/CppCoreGuidelines.md#Ri-global): Avoid global variables

## Format
C and C++ code is formatted using clang-format. To format a file, use

```
clang-format-3.8 -style=file -i <path-to-source-file>
```

To format all files, run the following script in rocSPARSE directory:

```
#!/bin/bash
find . -iname '*.h' \
-o -iname '*.hpp' \
-o -iname '*.cpp' \
-o -iname '*.h.in' \
-o -iname '*.hpp.in' \
-o -iname '*.cpp.in' \
-o -iname '*.cl' \
| grep -v 'build' \
| xargs -n 1 -P 8 -I{} clang-format-3.8 -style=file -i {}
```


Also, githooks can be installed to format the code per-commit:

```
./.githooks/install
```


6 changes: 6 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
resolves #___

Summary of proposed changes:
-
-
-
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,7 @@ tags

# build-in-source directory
build

# doc directory
docBin
_build
7 changes: 5 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,7 @@ list(APPEND CMAKE_MODULE_PATH
include(cmake/SetToolchain.cmake)

# rocSPARSE project
project(rocsparse VERSION 0.1.3.1 LANGUAGES CXX)
set(rocsparse_SOVERSION 0)
project(rocsparse LANGUAGES CXX)

# Set a default build type if none was specified
if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
Expand Down Expand Up @@ -72,6 +71,10 @@ option(BUILD_VERBOSE "Output additional build information" OFF)
# Dependencies
include(cmake/Dependencies.cmake)

# Setup version
rocm_setup_version(VERSION 0.1.3.2 NO_GIT_TAG_VERSION)
set(rocsparse_SOVERSION 0)

# AMD targets
set(AMDGPU_TARGETS gfx803;gfx900;gfx906 CACHE STRING "List of specific machine types for library to target")

Expand Down
2 changes: 1 addition & 1 deletion Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -470,7 +470,7 @@ def build_pipeline( compiler_data compiler_args, docker_data docker_args, projec
//},
rocm_ubuntu:
{
node( 'docker && rocm && dkms')
node( 'docker && rocm19 && dkms')
{
def hcc_docker_args = new docker_data(
from_image:'rocm/dev-ubuntu-16.04:1.9.0',
Expand Down
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# rocSPARSE
rocSPARSE exposes a common interface that provides Basic Linear Algebra Subroutines for sparse computation implemented on top of AMD's Radeon Open Compute [ROCm][] runtime and toolchains. rocSPARSE is created using the [HIP][] programming language and optimized for AMD's latest discrete GPUs.

## Documentation
The latest rocSPARSE documentation and API description can be found [here][].

## Requirements
* Git
* CMake (3.5 or later)
Expand Down Expand Up @@ -92,3 +95,4 @@ The [license file][] can be found in the main repository.
[Boost]: https://www.boost.org/
[the issue tracker]: https://github.com/ROCmSoftwarePlatform/rocSPARSE/issues
[license file]: https://github.com/ROCmSoftwarePlatform/rocSPARSE
[here]: https://rocsparse.readthedocs.io/en/develop/library.html
2 changes: 1 addition & 1 deletion clients/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ if(NOT TARGET rocsparse)
endif()

# Hip headers required of all clients; clients use hip to allocate device memory
find_package(hip REQUIRED CONFIG PATHS /opt/rocm)
find_package(HIP REQUIRED CONFIG PATHS /opt/rocm)

if(BUILD_CLIENTS_SAMPLES)
add_subdirectory(samples)
Expand Down
2 changes: 1 addition & 1 deletion cmake/Dependencies.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ if(HIP_PLATFORM STREQUAL "hcc")
# Ignore hcc warning: argument unused during compilation: '-isystem /opt/rocm/hip/include'
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wno-unused-command-line-argument")
find_package(hcc REQUIRED CONFIG PATHS /opt/rocm)
find_package(hip REQUIRED CONFIG PATHS /opt/rocm)
find_package(HIP REQUIRED CONFIG PATHS /opt/rocm)
elseif(HIP_PLATFORM STREQUAL "nvcc")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Xcompiler -Wall")
set(CMAKE_C_COMPILE_OPTIONS_PIC "-Xcompiler ${CMAKE_C_COMPILE_OPTIONS_PIC}" )
Expand Down
2 changes: 1 addition & 1 deletion cmake/Verbose.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
#
# ########################################################################

message(STATUS "rocsparse_VERSION : ${rocsparse_VERSION}")
message(STATUS "rocsparse_VERSION : ${rocsparse_VERSION}")
message(STATUS "\t==>CMAKE_BUILD_TYPE : ${CMAKE_BUILD_TYPE}")
message(STATUS "\t==>BUILD_SHARED_LIBS : ${BUILD_SHARED_LIBS}")
message(STATUS "\t==>CMAKE_INSTALL_PREFIX link : ${CMAKE_INSTALL_PREFIX}")
Expand Down
2 changes: 1 addition & 1 deletion docs/Doxyfile
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ TAB_SIZE = 4
# "Side Effects:". You can put \n's in the value part of an alias to insert
# newlines.

ALIASES =
ALIASES =

# This tag can be used to specify a number of word-keyword mappings (TCL only).
# A mapping has the form "name=value". For example adding "class=itcl::class"
Expand Down
9 changes: 0 additions & 9 deletions docs/source/allapi.rst

This file was deleted.

Loading

0 comments on commit b48be2a

Please sign in to comment.