Skip to content

reinterpret doesn't handle singleton types #1669

@maleadt

Description

@maleadt
julia> a = CuArray{Nothing}(undef, 1)
1-element CuArray{Nothing, 1, CUDA.Mem.DeviceBuffer}:
 nothing

julia> reinterpret(Missing, a)
ERROR: DivideError: integer division error
Stacktrace:
 [1] div
   @ ./int.jl:288 [inlined]
 [2] _derived_array
   @ ~/Julia/pkg/CUDA/src/array.jl:779 [inlined]
 [3] reinterpret(#unused#::Type{Missing}, a::CuArray{Nothing, 1, CUDA.Mem.DeviceBuffer})
   @ CUDA ~/Julia/pkg/CUDA/src/array.jl:803
 [4] top-level scope
   @ REPL[6]:1
 [5] top-level scope
   @ ~/Julia/pkg/CUDA/src/initialization.jl:155

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions