2828
2929@inline eltype (:: Type{Padded{L, P}} ) where {L, P} = eltype (L)
3030@inline size (:: Type{Padded{L, P}} , logical_size:: NamedTuple ) where {L, P} = size (L, pad_logical_coord (Padded{L, P}, logical_size))
31- @inline load (:: Type{Padded{L, P}} , workspace, tile:: Tile , logical_size :: NamedTuple ) where {L, P} = load (L, workspace, tile)
32- @inline store! (:: Type{Padded{L, P}} , workspace, value, tile:: Tile ) where {L, P} = store! (L, workspace, value, tile:: Tile )
31+ @inline load (:: Type{Padded{L, P}} , workspace, tile:: Tile , workspace_size :: NamedTuple ) where {L, P} = load (L, workspace, tile, pad_logical_coord (Padded{L, P}, workspace_size) )
32+ @inline store! (:: Type{Padded{L, P}} , workspace, value, tile:: Tile , workspace_size :: NamedTuple ) where {L, P} = store! (L, workspace, value, tile:: Tile , pad_logical_coord (Padded{L, P}, workspace_size) )
3333
3434# ---------------
3535# AlignedColMajor
3838struct AlignedColMajor{T} <: LayoutBase{T} end
3939
4040# TODO : cleanup vectorisation
41- @inline function load (:: Type{AlignedColMajor{T}} , workspace, tile:: Tile{size} ) where {T, size}
41+ @inline function load (:: Type{AlignedColMajor{T}} , workspace, tile:: Tile{size} , workspace_size :: NamedTuple ) where {T, size}
4242 vec_len = 16 ÷ sizeof (T)
4343 N = (sizeof (T) * vec_len) ÷ sizeof (Float32)
4444 res = MArray {Tuple{size[1] ÷ vec_len, size[2]}, NTuple{N, VecElement{Float32}}} (undef)
@@ -47,8 +47,8 @@ struct AlignedColMajor{T} <: LayoutBase{T} end
4747 @unroll for i = 1 : vec_len : size[1 ]
4848 t = translate (tile, (i - 1 , j - 1 ))
4949
50- linear_base = linearise (t. base, Base . size (workspace) )
51- linear_offset = linearise (t. offset, Base . size (workspace) )
50+ linear_base = linearise (t. base, workspace_size )
51+ linear_offset = linearise (t. offset, workspace_size )
5252
5353 @inbounds res[i, j] = vloada (Vec{vec_len, T}, pointer (workspace, linear_base), linear_offset)
5454 end
@@ -57,15 +57,15 @@ struct AlignedColMajor{T} <: LayoutBase{T} end
5757 return res
5858end
5959
60- @inline function store! (:: Type{AlignedColMajor{T}} , workspace, value, tile:: Tile{size} ) where {T, size}
60+ @inline function store! (:: Type{AlignedColMajor{T}} , workspace, value, tile:: Tile{size} , workspace_size :: NamedTuple ) where {T, size}
6161 vec_len = 16 ÷ sizeof (T)
6262
6363 @unroll for j = 1 : size[2 ]
6464 @unroll for i = 1 : vec_len : size[1 ]
6565 t = translate (tile, (i - 1 , j - 1 ))
6666
67- linear_base = linearise (t. base, Base . size (workspace) )
68- linear_offset = linearise (t. offset, Base . size (workspace) )
67+ linear_base = linearise (t. base, workspace_size )
68+ linear_offset = linearise (t. offset, workspace_size )
6969
7070 vstorea! (Vec{vec_len, T}, pointer (workspace, linear_base), value[i, j], linear_offset)
7171 end
0 commit comments