Skip to content

Commit 55bc03f

Browse files
Pietro Vertechigithub-actions[bot]
andauthored
Remove GPUArray test dep and bump Adapt (#133)
* CompatHelper: bump compat for "Adapt" to "2.0" * remove GPUArrays test dep * format * simpler adapt overload Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
1 parent 6474eaf commit 55bc03f

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

Project.toml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,16 @@ DataAPI = "9a962f9c-6df0-11e9-0e5d-c546b8b5ee8a"
88
Tables = "bd369af6-aec1-5ad0-b16a-f7cc5008161c"
99

1010
[compat]
11-
Adapt = "1"
11+
Adapt = "1, 2"
1212
DataAPI = "1"
1313
Tables = "1"
1414
julia = "1"
1515

1616
[extras]
17-
GPUArrays = "0c68f7d7-f131-5f86-a1c3-88cf8149b2d7"
1817
OffsetArrays = "6fe1bfb0-de20-5000-8ca7-80f57d26f881"
1918
PooledArrays = "2dfb63ee-cc39-5dd5-95bd-886bf059d720"
2019
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
2120
WeakRefStrings = "ea10d353-3f73-51f8-a26c-33c1cb351aa5"
2221

2322
[targets]
24-
test = ["Test", "GPUArrays", "OffsetArrays", "PooledArrays", "WeakRefStrings"]
23+
test = ["Test", "OffsetArrays", "PooledArrays", "WeakRefStrings"]

test/runtests.jl

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@ using StructArrays: staticschema, iscompatible, _promote_typejoin, append!!
33
using OffsetArrays: OffsetArray
44
import Tables, PooledArrays, WeakRefStrings
55
using DataAPI: refarray, refvalue
6-
using Adapt: adapt
7-
import GPUArrays
6+
using Adapt: adapt, Adapt
87
using Test
98

109
@testset "index" begin
@@ -702,9 +701,13 @@ end
702701
end
703702
end
704703

704+
struct ArrayConverter end
705+
706+
Adapt.adapt_storage(::ArrayConverter, xs::AbstractArray) = convert(Array, xs)
707+
705708
@testset "adapt" begin
706709
s = StructArray(a = 1:10, b = StructArray(c = 1:10, d = 1:10))
707-
t = adapt(Array, s)
710+
t = adapt(ArrayConverter(), s)
708711
@test propertynames(t) == (:a, :b)
709712
@test s == t
710713
@test t.a isa Array

0 commit comments

Comments
 (0)