You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* implement `@trace` for
* Apply suggestions from code review
Co-authored-by: Sergio Sánchez Ramírez <[email protected]>
* Allow using induction variable
* floating point ranges
* lightspeed
* import LinearAlgebra
* generate 0 to N loop
* ir test
* clean iter
* Revert "Apply suggestions from code review"
This reverts commit 079ed4a.
* remove precompilation warning
* format and fix
* loop ranges as traced numbers
* fmt and add non unit step test
* fmt2
* integers
---------
Co-authored-by: Sergio Sánchez Ramírez <[email protected]>
Copy file name to clipboardExpand all lines: lib/ReactantCore/src/ReactantCore.jl
+97-7Lines changed: 97 additions & 7 deletions
Original file line number
Diff line number
Diff line change
@@ -31,6 +31,7 @@ if no traced value is found inside the expression, then there is no overhead.
31
31
- `if` conditions (with `elseif` and other niceties) (`@trace if ...`)
32
32
- `if` statements with a preceeding assignment (`@trace a = if ...`) (note the positioning
33
33
of the macro needs to be before the assignment and not before the `if`)
34
+
- `for` statements with a single induction variable iterating over a syntactic `StepRange` of integers.
34
35
35
36
## Special Considerations
36
37
@@ -81,6 +82,15 @@ end
81
82
This will not compile since `y` is a `Float32` in one branch and a `Float64` in the other.
82
83
You need to ensure that all branches have the same type.
83
84
85
+
Another example is the following for loop which changes the type of `x` between iterations.
86
+
87
+
```julia
88
+
x = ... # ConcreteRArray{Int64, 1}
89
+
for i in 1f0:0.5f0:10f0
90
+
x = x .+ i # ConcreteRArray{Float32, 1}
91
+
end
92
+
```
93
+
84
94
### Certain Symbols are Reserved
85
95
86
96
Symbols like $(SPECIAL_SYMBOLS) are not allowed as variables in `@trace` expressions. While certain cases might work but these are not guaranteed to work. For
0 commit comments