Skip to content

Commit

Permalink
Add some description for helper scripts.
Browse files Browse the repository at this point in the history
  • Loading branch information
pratikvn committed May 29, 2020
1 parent ecfe099 commit 0b0444b
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ We are glad that you are interested in contributing to Ginkgo. Please have a loo
* [Include statement grouping](#include-statement-grouping)
* [Other Code Formatting not handled by ClangFormat](#other-code-formatting-not-handled-by-clangformat)
* [CMake coding style](#cmake-coding-style)

[Helper Scripts](#helper-scripts)
* [Create a new algorithm](#create-a-new-algorithm)


[Writing Tests](#writing-tests)
* [Testing know-how](#testing-know-how)
Expand Down Expand Up @@ -323,6 +327,24 @@ Macros in CMake do not have a scope. This means that any variable set in this ma
All Ginkgo specific variables should be prefixed with a `GINKGO_` and all functions by `ginkgo_`.


## Helper scripts

To facilitate easy development within Ginkgo and to encourage coders and scientists who do not want get bogged down by the details of the Ginkgo library, but rather focus on writing the algorithms and the kernels, Ginkgo provides the developers with a few helper scripts.

### Create a new algorithm

A `create_new_algorithm.sh` script is available for developers to facilitate easy addition of new algorithms. The options it provides can be queried with

```sh
./create_new_algorithm.sh --help
```
The main objective of this script is to add files and boiler plate code for the new algorithm using a model and an instance of that model. For example, models can be any one of`factorization`,`matrix`,`preconditioner` or `solver`. For example to create a new solver named `my_solver` similar to `gmres`, you would set the `ModelType` to `solver` and set the `ModelName` to `gmres`. This would duplicate the core algorithm and kernels of the `gmres` algorithm and replace the naming to `my_solver`. Additionally, marks all the kernels of the new `my_solver` to `GKO_NOT_IMPLEMENTED`.

### Converting CUDA code to HIP code.

This script calls the `hipify` script provided by HIP converting the CUDA syntax to HIP syntax. Additionally, it also automatically replaces the instances of CUDA with HIP as appropriate. Hence this script can be called on a Ginkgo CUDA file.


## Writing Tests

Ginkgo uses the [GTest framework](https://github.com/google/googletest) for the unit test framework within Ginkgo. Writing good tests are extremely important to verify the functionality of the new code and to make sure that none of the existing code has been broken.
Expand Down

0 comments on commit 0b0444b

Please sign in to comment.