Skip to content
This repository has been archived by the owner on Mar 12, 2021. It is now read-only.

Commit

Permalink
Error on unsupported types.
Browse files Browse the repository at this point in the history
Fixes #365
  • Loading branch information
maleadt committed Jan 6, 2020
1 parent 6bd1799 commit 4d78ed6
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/array.jl
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,8 @@ CuVecOrMat{T} = Union{CuVector{T},CuMatrix{T}}

# type and dimensionality specified, accepting dims as tuples of Ints
function CuArray{T,N}(::UndefInitializer, dims::Dims{N}) where {T,N}
Base.isbitsunion(T) && error("CuArray does not yet support union bits types")
Base.isbitstype(T) || error("CuArray only supports bits types") # allocatedinline on 1.3+
ptr = alloc(prod(dims) * sizeof(T))
CuArray{T,N}(convert(CuPtr{T}, ptr), dims)
end
Expand Down

0 comments on commit 4d78ed6

Please sign in to comment.