From 2aee4cc39860c03a61e14aea1593f2e14c83ca7e Mon Sep 17 00:00:00 2001 From: Lucas C Wilcox Date: Thu, 26 Sep 2019 12:05:14 -0700 Subject: [PATCH] Use Adapt for converting CPU to GPU StructArrays --- src/StructArrays.jl | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/StructArrays.jl b/src/StructArrays.jl index 2c0f1f3a..b514da30 100644 --- a/src/StructArrays.jl +++ b/src/StructArrays.jl @@ -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