Skip to content

Commit 9fe7d6c

Browse files
committed
Require ArrayInterface 3.1.4 to support CPUTuples
1 parent 5c7c9a7 commit 9fe7d6c

File tree

5 files changed

+10
-7
lines changed

5 files changed

+10
-7
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ UnPack = "3a884ed6-31ef-47d7-9d2a-63182c4928ed"
1818
VectorizationBase = "3d5dd08c-fd9d-11e8-17fa-ed2836048c2f"
1919

2020
[compat]
21-
ArrayInterface = "3"
21+
ArrayInterface = "3.1.4"
2222
CheapThreads = "0.1.2"
2323
DocStringExtensions = "0.8"
2424
IfElse = "0.1"

docs/make.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ makedocs(;
77
"Home" => "index.md",
88
"Getting Started" => "getting_started.md",
99
"Examples" => [
10+
"examples/multithreading.md",
1011
"examples/matrix_multiplication.md",
1112
"examples/array_interface.md",
1213
"examples/matrix_vector_ops.md",

docs/src/examples/matrix_multiplication.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@ One of the friendliest problems for vectorization is matrix multiplication. Give
55
LoopVectorization currently doesn't do any memory-modeling or memory-based optimizations, so it will still run into problems as the size of matrices increases. But at smaller sizes, it's capable of achieving a healthy percent of potential GFLOPS.
66
We can write a single function:
77
```julia
8-
function A_mul_B!(𝐂, 𝐀, 𝐁)
9-
@avx for m axes(𝐀,1), n axes(𝐁,2)
10-
𝐂mn = zero(eltype(𝐂))
11-
for k axes(𝐀,2)
12-
𝐂mn += 𝐀[m,k] * 𝐁[k,n]
8+
function A_mul_B!(C, A, B)
9+
@avx for n indices((C,B), 2), m indices((C,A), 1)
10+
Cmn = zero(eltype(C))
11+
for k indices((A,B), (2,1))
12+
Cmn += C[m,k] * B[k,n]
1313
end
14-
𝐂[m,n] = 𝐂mn
14+
C[m,n] = Cmn
1515
end
1616
end
1717
```

docs/src/index.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ Please file an issue if you run into any problems.
88
```@contents
99
Pages = [
1010
"getting_started.md",
11+
"examples/multithreading.md",
1112
"examples/matrix_multiplication.md",
1213
"examples/array_interface.md",
1314
"examples/matrix_vector_ops.md",

src/condense_loopset.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -395,6 +395,7 @@ function check_type(::Type{T}) where {T}
395395
false
396396
end
397397
@inline check_device(::ArrayInterface.CPUPointer) = true
398+
@inline check_device(::ArrayInterface.CPUTuple) = true
398399
function check_device(x)
399400
@info """`LoopVectorization.check_args` returned `false`, because `ArrayInterface.device(::$(typeof(x))) == $x`
400401
`LoopVectorization` normally requires `ArrayInterface.CPUPointer` (exceptions include ranges, `BitVector`s, and

0 commit comments

Comments
 (0)