diff --git a/Project.toml b/Project.toml index 28cb8eb..71501ad 100644 --- a/Project.toml +++ b/Project.toml @@ -1,6 +1,6 @@ name = "TensorOperations" uuid = "6aa20fa7-93e2-5fca-9bc0-fbd0db3c71a2" -version = "5.5.0" +version = "5.5.1" authors = ["Lukas Devos ", "Maarten Van Damme ", "Jutho Haegeman "] [deps] diff --git a/src/implementation/allocator.jl b/src/implementation/allocator.jl index b62ac40..cacd7b3 100644 --- a/src/implementation/allocator.jl +++ b/src/implementation/allocator.jl @@ -258,6 +258,7 @@ end # how many bytes should be reserved allocation_size(::Type{T}, structure::Base.Dims) where {T} = prod(structure) * sizeof(T) +allocation_size(::Type{T}, structure::Int) where {T} = structure * sizeof(T) function tensoralloc( ::Type{A}, structure, ::Val{istemp}, buffer::BufferAllocator diff --git a/test/allocator.jl b/test/allocator.jl index b92f4fa..20c9e9d 100644 --- a/test/allocator.jl +++ b/test/allocator.jl @@ -59,9 +59,9 @@ using LinearAlgebra @test cp0 == 0 # Allocate some tensors - t1 = tensoralloc(Array{UInt8, 2}, (10, 10), Val(true), buffer) # should fit - @test t1 isa Array{UInt8, 2} - @test size(t1) == (10, 10) + t1 = tensoralloc(Vector{UInt8}, 100, Val(true), buffer) # should fit + @test t1 isa Vector{UInt8} + @test size(t1) == (100,) cp1 = allocator_checkpoint!(buffer) @test cp1 > cp0 # Verify pointer backing from buffer