Skip to content

replace_storage ignores type parameters #248

@cuihantao

Description

@cuihantao

Hi,

I have the MWE below to replace the storage with CuArray data types. It looks like replace_storage recognizes CuArray out of CuArray{Float32} but ignores the Float32 part. Did I miss something? Thanks for your help!

using CUDA
using StructArrays

foo = StructArray(a=[1.0 for i = 1:10])

bar1 = replace_storage(CuArray, foo)  # defaults to CuArray{Float64}

@show typeof(bar1)

bar2 = replace_storage(CuArray{Float32}, foo) # still yields CuArray{Float64}

bar3 = convert(CuArray{Float32}, foo.a)  # works fine

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions