-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use TiledIteration.jl? #21
Comments
Yes, I would be open for that. Does the I will read a bit more on your proposal for Tiled indexing and maybe comment later, but the idea sounds reasonable. Another field of tension would be the question if we support non-regular chunks. Currently the |
|
Issue #25: arbitrary offsets in TiledIteration.jl |
As far as non-regular tiling goes: theoretically, any tiling could be mapped to some N-dimensional indices indexing the tile and some M-dimensional indices indexing into each tile. We could have something like the following: struct TileIndex{N, TN}
tile::NTuple{N, Int}
index::NTuple{TN, Int}
end
abstract type TileStyle end # basically the equivalent of strategy in TiledIteration.jl
struct OffsetGridTiles <: TileStyle end # grid with offset
struct GridTiles <: TileStyle end # grid with no offset
struct RelaxedGridTiles <: TileStyle end # grid with relaxed grid size, so tiles will fit
# This trait can be used for arrays with IndexStyle = IndexTiled to determine the kind of tiling.
struct IndexTiled <: IndexStyle end # trait to dispatch on for all manner of operations We would have to reroute a few functions in base julia to dispatch on index style for all of this to work on any array type. In the meantime, it's possible to subtype |
DiskArrays.jl now actually handles way more of the edge cases than TiledIteration.jl does - like now |
For GridChunks, we could use TiledIteration.jl instead of implementing everything here. In general, I wonder if TiledIteration.jl couldn't become the interface module for all tiled array iteration (if it isn't already).
I have an implementation of iteration using TiledIteration.jl in HDF5Arrays.jl, so I could make a PR, if there's interest.
If we limit ourselves to tiles (
GridChunks
in DiskArrays.jl), we can also use tiled indexing to make a lot of the code implementing broadcasting, reduce operations, etc. cleaner. Further, the code could be moved to TiledIteration.jl, so non-DiskArrays can benefit from the tools here, too. See this proposal for tiled indexingThe text was updated successfully, but these errors were encountered: