Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name = "TensorOperations"
uuid = "6aa20fa7-93e2-5fca-9bc0-fbd0db3c71a2"
version = "5.5.0"
version = "5.5.1"
authors = ["Lukas Devos <lukas.devos@ugent.be>", "Maarten Van Damme <maartenvd1994@gmail.com>", "Jutho Haegeman <jutho.haegeman@ugent.be>"]

[deps]
Expand Down
1 change: 1 addition & 0 deletions src/implementation/allocator.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions test/allocator.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading