Skip to content

Commit

Permalink
Use Adapt for converting CPU to GPU StructArrays
Browse files Browse the repository at this point in the history
  • Loading branch information
lcw committed Sep 26, 2019
1 parent 1bc3dbe commit 2aee4cc
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/StructArrays.jl
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@ include("sort.jl")
include("groupjoin.jl")
include("lazy.jl")

# Use Adapt allows for automatic conversion of CPU to GPU StructArrays
import Adapt
Adapt.adapt_storage(to, s::StructArray) =
replace_storage(x->Adapt.adapt_storage(to, x), s)

function __init__()
Requires.@require Tables="bd369af6-aec1-5ad0-b16a-f7cc5008161c" include("tables.jl")
Requires.@require WeakRefStrings="ea10d353-3f73-51f8-a26c-33c1cb351aa5" begin
Expand Down

0 comments on commit 2aee4cc

Please sign in to comment.