Comments (2)
Solution should be
b: some_temp_type
if a > 0.
b = 1.
else:
b = 2.
from gt4py.
In the GTC backends this condition seems to have been relaxed. The following code snippet compiles and the generated code looks correct, so I'll close this. Let us know if you still have problems and we can re-open.
from gt4py import gtscript
import numpy as np
@gtscript.function
def abs_fn(a):
b = a
return b
@gtscript.stencil(backend="gtc:gt:cpu_ifirst")
def stencil(
input_field: gtscript.Field[gtscript.IJK, np.int32],
output_field: gtscript.Field[gtscript.IJK, np.int32],
q_max: np.int32,
):
with computation(PARALLEL), interval(...):
if input_field > q_max:
tmp = input_field
output_field = abs_fn(tmp)
else:
output_field = input_field
from gt4py.
Related Issues (20)
- Finalize error message formatting HOT 1
- next: regressions introduced with embedded field view
- Error: SymbolRef of Dimension not found in offset provider
- Cleanup typing: use NestedSequence protocol
- Cleanup duplication of flatten of sequences HOT 1
- ProgramWithBoundArgs: pos_or_kw_args need to go to kwargs sometimes
- next fieldview embedded: if domain is present, out fields don't have to have matching domains
- ITIR to SDFG: Fixed sized dimensiosn. HOT 4
- tuples of fields of different locations violate ITIR HOT 2
- Fix Field type annoations in gt4py.next
- Cleanup dtype hierarchy in _core.definitions
- Add missing `gamma` builtin function in embedded
- Test jupyter notebooks with pytest
- Fix Implicit Stencil Arguments HOT 1
- Detection of ROCM vs CUDA device on Clariden HOT 4
- [next]: Race condition in parallel compilation
- [next] FieldOffset variable name need to match string name
- [next+cartesian] Fix CSCS CI docker image to use cupy 13
- [cartesian] Read-only while conditional in `dace:X` backends HOT 1
- [next]: Test recorded shifts update in InlineLift pass
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gt4py.