First version of change fp type and MPFR support#1
Conversation
| from dace.sdfg import nodes, utils as sdfg_utils | ||
| from dace.sdfg.state import AbstractControlFlowRegion, SDFGState | ||
|
|
||
| _MAX_FIXPOINT_ITERS = 10 |
There was a problem hiding this comment.
I think you can write a pass that uses "FixePointIteration" to not need a hardcoded limit.
Check this: https://spcldace.readthedocs.io/en/latest/source/dace.transformation.html#dace.transformation.pass_pipeline.FixedPointPipeline
Maybe it makes sense to make this function into a pipeline/pass?
| change_and_propagate_fp_types, | ||
| ) | ||
|
|
||
| RULES = { |
There was a problem hiding this comment.
This wouldn't work with float8 or bfloat16, what about using an algorithmic approach to use ctypes to ge tnumber of bits/bytes and return the type with more bytes/bits?
| def change_and_propagate_fp_types( | ||
| sdfg: dace.SDFG, | ||
| initial_types: Dict[str, dace.dtypes.typeclass], | ||
| promotion_rules: Dict[FrozenSet[dace.dtypes.typeclass], dace.dtypes.typeclass], |
There was a problem hiding this comment.
I think default promotion rule of if 2 variants X and Y -> promote the bigger type.
Also how do you handle if tasklet has 3 inputs? e.g. d = merge(c,a,b), which implements if c then a else b.
Does the rule work with 3 arrays?
No description provided.