Skip to content

Commit f6ebba6

Browse files
authored
[NDTensors] Upgrade to GPUArraysCore v0.2 (#1641)
1 parent aa826fa commit f6ebba6

File tree

4 files changed

+10
-10
lines changed

4 files changed

+10
-10
lines changed

NDTensors/Project.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "NDTensors"
22
uuid = "23ae76d9-e61a-49c4-8f12-3f1a16adf9cf"
33
authors = ["Matthew Fishman <[email protected]>"]
4-
version = "0.4.5"
4+
version = "0.4.6"
55

66
[deps]
77
Accessors = "7d9f7c33-5ae7-4f3b-8dc6-eff91059b697"
@@ -69,7 +69,7 @@ EllipsisNotation = "1.8"
6969
FillArrays = "1"
7070
Folds = "0.2.8"
7171
Functors = "0.2, 0.3, 0.4, 0.5"
72-
GPUArraysCore = "0.1"
72+
GPUArraysCore = "0.1, 0.2"
7373
HDF5 = "0.14, 0.15, 0.16, 0.17"
7474
HalfIntegers = "1"
7575
InlineStrings = "1"
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[deps]
22
GPUArraysCore = "46192b85-c4d5-4398-a991-12ede77f4527"
3-
Metal = "dde4c033-4e86-420c-a63e-0dd931031962"
3+
JLArrays = "27aeb0d3-9eb9-45fb-866b-73c2ecf80fcb"
44
NDTensors = "23ae76d9-e61a-49c4-8f12-3f1a16adf9cf"
55
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

NDTensors/src/lib/Expose/test/runtests.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,12 +58,12 @@ using NDTensors.GPUArraysCoreExtensions: cpu
5858
expose(o)[] = 2
5959
@test expose(o)[] == 2
6060

61-
fill!(m, 0)
61+
fill!(m, zero(elt))
6262
@test any(!Base.isinf, expose(m))
6363

6464
mp = copy(Ea)
6565
@test mp == ma
66-
fill!(ma, 2.0)
66+
fill!(ma, elt(2))
6767
copyto!(expose(mp), expose(ma))
6868
@test mp == ma
6969

@@ -112,7 +112,7 @@ using NDTensors.GPUArraysCoreExtensions: cpu
112112
@test norm(m) sqrt(6^2 * 10)
113113

114114
m = reshape(m, (5, 2, 1))
115-
mt = fill!(similar(m), 3.0)
115+
mt = fill!(similar(m), elt(3))
116116
m = permutedims(expose(m), (2, 1, 3))
117117
@test size(m) == (2, 5, 1)
118118
permutedims!(expose(m), expose(mt), (2, 1, 3))
@@ -184,7 +184,7 @@ using NDTensors.GPUArraysCoreExtensions: cpu
184184
copyto!(expose(y), expose(x))
185185
@allowscalar begin
186186
@test y == x
187-
## temporarily use expose copy because this is broken in Metal 1.1
187+
## temporarily use expose copy because this is broken in Metal 1.1
188188
@test copy(expose(x)) == x
189189
end
190190

NDTensors/test/test_dense.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ NDTensors.dim(i::MyInd) = i.dim
3838

3939
Aview = A[2:3, 2:3]
4040
@test dims(Aview) == (2, 2)
41-
## Added for issue 1431 create a tensor from
41+
## Added for issue 1431 create a tensor from
4242
## a sliced view of another tensor
4343
Acopy = Tensor(NDTensors.storage(Aview), (1, 4))
4444
@test NDTensors.cpu(data(Acopy)) == NDTensors.cpu(data(Aview))
@@ -233,7 +233,7 @@ NDTensors.dim(i::MyInd) = i.dim
233233
@testset "Contraction with size 1 block and NaN" begin
234234
@testset "No permutation" begin
235235
R = dev(Tensor(complex(elt), (2, 2, 1)))
236-
fill!(R, NaN)
236+
fill!(R, elt(NaN))
237237
@test @allowscalar any(isnan, R)
238238
T1 = dev(randomTensor(elt, (2, 2, 1)))
239239
T2 = dev(randomTensor(complex(elt), (1, 1)))
@@ -244,7 +244,7 @@ NDTensors.dim(i::MyInd) = i.dim
244244

245245
@testset "Permutation" begin
246246
R = dev(Tensor(complex(elt), (2, 2, 1)))
247-
fill!(R, NaN)
247+
fill!(R, elt(NaN))
248248
@test @allowscalar any(isnan, R)
249249
T1 = dev(randomTensor(elt, (2, 2, 1)))
250250
T2 = dev(randomTensor(complex(elt), (1, 1)))

0 commit comments

Comments
 (0)