Skip to content

Commit 02257b9

Browse files
committed
restrict Adapt compat
1 parent 0542152 commit 02257b9

File tree

2 files changed

+1
-12
lines changed

2 files changed

+1
-12
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ StructArraysGPUArraysCoreExt = "GPUArraysCore"
2121
StructArraysStaticArraysExt = "StaticArrays"
2222

2323
[compat]
24-
Adapt = "2, 3"
24+
Adapt = "3.4"
2525
ConstructionBase = "1"
2626
DataAPI = "1"
2727
GPUArraysCore = "0.1.2"

ext/StructArraysAdaptExt.jl

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,5 @@
11
module StructArraysAdaptExt
22
# Use Adapt allows for automatic conversion of CPU to GPU StructArrays
33
using Adapt, StructArrays
4-
@static if !applicable(Adapt.adapt, Int)
5-
# Adapt.jl has no curried support, implement it ourself
6-
adpat(to) = Base.Fix1(Adapt.adapt, to)
7-
if VERSION < v"1.9.0-DEV.857"
8-
@eval function adapt(to::Type{T}) where {T}
9-
(@isdefined T) || return Base.Fix1(Adapt.adapt, to)
10-
AT = Base.Fix1{typeof(Adapt.adapt),Type{T}}
11-
return $(Expr(:new, :AT, :(Adapt.adapt), :to))
12-
end
13-
end
14-
end
154
Adapt.adapt_structure(to, s::StructArray) = replace_storage(adapt(to), s)
165
end

0 commit comments

Comments
 (0)