Skip to content

Commit 19f4154

Browse files
committed
change to at-turbo
1 parent bd2b297 commit 19f4154

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ And it can be used with some packages which modify broadcasting:
5757
```julia
5858
using Strided, LoopVectorization, LazyArrays
5959
@cast @strided E[φ,γ] = F[φ]^2 * exp(G[γ]) # multi-threaded
60-
@reduce @avx S[i] := sum(n) -P[i,n] * log(P[i,n]) # SIMD-enhanced
60+
@reduce @turbo S[i] := sum(n) -P[i,n] * log(P[i,n]) # SIMD-enhanced
6161
@reduce @lazy M[i,j] := sum(k) U[i,k] * V[j,k] # non-materialised
6262
```
6363

src/macro.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ Options specified at the end (if several, separated by `,`) are:
6060
6161
Some modifications to broadcasting are possible, after loading the corresponding package:
6262
* `@cast @strided Z[i,j] := ...` uses Strided.jl's macro, for multi-threaded broadcasting.
63-
* `@cast @avx Z[i,j] := ...` uses LoopVectorization.jl's macro, for SIMD acceleration.
63+
* `@cast @turbo Z[i,j] := ...` uses LoopVectorization.jl's macro, for SIMD acceleration.
6464
* `@cast @lazy Z[i,j] := ...` uses LazyArrays.jl's BroadcastArray type, although there is no such macro.
6565
6666
To create static slices `D[k]{i,j}` you should give all slice dimensions explicitly.
@@ -104,7 +104,7 @@ The option `@lazy` replaces the broadcast expression with a `BroadcastArray`,
104104
to avoid `materialize`ing the entire array before summing. In the example this is of size `N^3`.
105105
This needs `using LazyArrays` to work.
106106
107-
The options `@strided` and `@avx` will alter broadcasting operations,
107+
The options `@strided` and `@turbo` will alter broadcasting operations,
108108
and need `using Strided` or `using LoopVectorization` to work.
109109
110110
@reduce sum(i) A[i] * log(@reduce _[i] := sum(j) A[j] * exp(B[i,j]))
@@ -157,7 +157,7 @@ function _macro(exone, extwo=nothing, exthree=nothing; call::CallInfo=CallInfo()
157157

158158
if Meta.isexpr(exone, :macrocall)
159159
# New style @cast @avx A[i] := B[i]
160-
string(exone.args[1]) in ("@lazy", "@strided", "@avx", "@avxt") || throw(MacroError(
160+
string(exone.args[1]) in ("@lazy", "@strided", "@avx", "@avxt", "@turbo", "@tturbo") || throw(MacroError(
161161
"the macro $(exone.args[1]) isn't one of the ones this understands", call))
162162
push!(call.flags, Symbol(string(exone.args[1])[2:end]), :premacro)
163163
return _macro(exone.args[3:end]...; call=call, dict=dict)

test/two.jl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -249,6 +249,8 @@ end
249249

250250
A = rand(4,5)
251251
@test exp.(A) @cast @avx B[i,j] := exp(A[i,j])
252+
@test exp.(A) @cast @turbo B[i,j] := exp(A[i,j])
253+
@test exp.(A) @cast @tturbo B[i,j] := exp(A[i,j])
252254

253255
@test exp.(A') @cast @avx B[i,j] := exp(A[j,i])
254256
@test exp.(A.+1) @cast @avx B[i,j] := exp(A[i,j]+1)

0 commit comments

Comments
 (0)