Skip to content

promote_type on GPU arrays of Float32 and ComplexF32 promotes to UnionAll #543

Open
@nHackel

Description

@nHackel

Hello,

I stumbled over this difference between CPU and GPU arrays:

julia> using JLArrays

julia> using CUDA

julia> a = rand(Float32, 1); b = rand(ComplexF32, 1);

julia> promote_type(typeof(a), typeof(b))
Vector{ComplexF32} (alias for Array{Complex{Float32}, 1})

julia> promote_type(typeof(JLArray(a)), typeof(JLArray(b)))
JLArray{T, 1} where T

julia> promote_type(typeof(CuArray(a)), typeof(CuArray(b)))
CuArray{T, 1, CUDA.DeviceMemory} where T

I've noticed this behaviour originally on CuArrays, but noticed it is also present for JLArrays, so I hope this is the correct repository. I have not been able to test it out on other GPU arrays (yet)

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