Skip to content

Conversation

@gronerl
Copy link
Owner

@gronerl gronerl commented Aug 25, 2020

tmp, to get full diff of 2 joint PRs

DropD and others added 17 commits August 12, 2020 17:39
* Split stencil building into concerns.

* Add CachingStrategy interface and classes
 - handle the fingerprinting concerns
 - handle constructing names and file paths that
   might depend on fingerprints
 - handle cache storage and consistency checks
 - add tests for caching strategies

* Add StencilBuilder class
 - orchestrate backend and caching instances
   to generate and optionally compile a stencil
 - add unit tests for stencil builder
 - add regression test for stencil property caching

* Change Backend and it's subclasses
 - change class methods to methods
 - abstract methods are now enforced
 - move methods that deal with caching to CachingStrategy
 - add constructor with StencilBuilder instance

* Typing: add some protocols for stencil definition functions
 - requires the typing-extensions distribution for python < 3.8

* Compliance:
 - remove backend/dawn_backends.py and backend/gt_backends.py
   from pre-commit exclude lists
 - flake8: ignore N803, allow capital letters in method
   names (needed for visitors)
 - flake8: ignore W503, allow line break before binary operator
   (needed due to black formatter)

Co-authors: Enrique G. Paredes <18477+egparedes@users.noreply.github.com>
Added the -Wno-sign-compare flag in C++ test reference. This warning caused problems with vscode.
…kends (GridTools#125)

List of changes:

- Add function names to list of gtscript builtins and update frontend
- Modified IR definition to support the list of functions (NativeFunction node)
- Modify CallInliner to keep calls to builtin functions
- Add implementations of NativeFunction to all backends
- Add tests

Co-authors: @eddie-c-davis @twicki
An option to generate code silencing "division by zero" (and similar warnings) with the NumPy backend, since most of the time the results of these warnings appear inside conditionals and they are not actually used. Motivating example:

```
@GTScript.stencil(rebuild=True, backend="numpy")
def copy_stencil(in_storage: gtscript.Field[float], out_storage: gtscript.Field[float]):
    with computation(PARALLEL), interval(...):
        out_storage = 0
        if in_storage[0,0,0] > 0:
            out_storage = 1 / in_storage
```

Related issue: GridTools#133.

Changes:
- Add "ignore_np_errstate" option 
- Add warning tests for debug and numpy backends
@egparedes egparedes deleted the backend_refactoring_fixes branch February 1, 2022 10:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants