@@ -73,7 +73,7 @@ namespace xt
7373 using shape_type = typename iterable_base::inner_shape_type;
7474
7575 template <class S >
76- xchunk_store_manager (S&& shape, S&& chunk_shape, const std::string& directory, std::size_t pool_size);
76+ xchunk_store_manager (S&& shape, S&& chunk_shape, const std::string& directory, std::size_t pool_size, layout_type chunk_memory_layout = XTENSOR_DEFAULT_LAYOUT );
7777 ~xchunk_store_manager () = default ;
7878
7979 xchunk_store_manager (const xchunk_store_manager&) = default ;
@@ -138,42 +138,42 @@ namespace xt
138138 IP m_index_path;
139139 };
140140
141- template <class T , class IOH , class IP = xindex_path, class EXT = empty_extension, class S >
142- xchunked_array<xchunk_store_manager<xfile_array<T, IOH>, IP>, EXT>
143- chunked_file_array (S&& shape, S&& chunk_shape, const std::string& path, std::size_t pool_size = 1 );
141+ template <class T , class IOH , layout_type L = XTENSOR_DEFAULT_LAYOUT, class IP = xindex_path, class EXT = empty_extension, class S >
142+ xchunked_array<xchunk_store_manager<xfile_array<T, IOH, L >, IP>, EXT>
143+ chunked_file_array (S&& shape, S&& chunk_shape, const std::string& path, std::size_t pool_size = 1 , layout_type chunk_memory_layout = XTENSOR_DEFAULT_LAYOUT );
144144
145- template <class IOH , class IP = xindex_path, class EXT = empty_extension, class E , class S >
146- xchunked_array<xchunk_store_manager<xfile_array<typename E::value_type, IOH>, IP>, EXT>
147- chunked_file_array (const xexpression<E>& e, S&& chunk_shape, const std::string& path, std::size_t pool_size = 1 );
145+ template <class IOH , layout_type L = XTENSOR_DEFAULT_LAYOUT, class IP = xindex_path, class EXT = empty_extension, class E , class S >
146+ xchunked_array<xchunk_store_manager<xfile_array<typename E::value_type, IOH, L >, IP>, EXT>
147+ chunked_file_array (const xexpression<E>& e, S&& chunk_shape, const std::string& path, std::size_t pool_size = 1 , layout_type chunk_memory_layout = XTENSOR_DEFAULT_LAYOUT );
148148
149- template <class IOH , class IP = xindex_path, class EXT = empty_extension, class E >
150- xchunked_array<xchunk_store_manager<xfile_array<typename E::value_type, IOH>, IP>, EXT>
151- chunked_file_array (const xexpression<E>& e, const std::string& path, std::size_t pool_size = 1 );
149+ template <class IOH , layout_type L = XTENSOR_DEFAULT_LAYOUT, class IP = xindex_path, class EXT = empty_extension, class E >
150+ xchunked_array<xchunk_store_manager<xfile_array<typename E::value_type, IOH, L >, IP>, EXT>
151+ chunked_file_array (const xexpression<E>& e, const std::string& path, std::size_t pool_size = 1 , layout_type chunk_memory_layout = XTENSOR_DEFAULT_LAYOUT );
152152
153- template <class T , class IOH , class IP , class EXT , class S >
154- inline xchunked_array<xchunk_store_manager<xfile_array<T, IOH>, IP>, EXT>
155- chunked_file_array (S&& shape, S&& chunk_shape, const std::string& path, std::size_t pool_size)
153+ template <class T , class IOH , layout_type L, class IP , class EXT , class S >
154+ inline xchunked_array<xchunk_store_manager<xfile_array<T, IOH, L >, IP>, EXT>
155+ chunked_file_array (S&& shape, S&& chunk_shape, const std::string& path, std::size_t pool_size, layout_type chunk_memory_layout )
156156 {
157- using chunk_storage = xchunk_store_manager<xfile_array<T, IOH>, IP>;
158- chunk_storage chunks (shape, chunk_shape, path, pool_size);
157+ using chunk_storage = xchunk_store_manager<xfile_array<T, IOH, L >, IP>;
158+ chunk_storage chunks (shape, chunk_shape, path, pool_size, chunk_memory_layout );
159159 return xchunked_array<chunk_storage, EXT>(std::move (chunks), std::forward<S>(shape), std::forward<S>(chunk_shape));
160160 }
161161
162- template <class IOH , class IP , class EXT , class E , class S >
163- inline xchunked_array<xchunk_store_manager<xfile_array<typename E::value_type, IOH>, IP>, EXT>
164- chunked_file_array (const xexpression<E>& e, S&& chunk_shape, const std::string& path, std::size_t pool_size)
162+ template <class IOH , layout_type L, class IP , class EXT , class E , class S >
163+ inline xchunked_array<xchunk_store_manager<xfile_array<typename E::value_type, IOH, L >, IP>, EXT>
164+ chunked_file_array (const xexpression<E>& e, S&& chunk_shape, const std::string& path, std::size_t pool_size, char chunk_memory_layout )
165165 {
166- using chunk_storage = xchunk_store_manager<xfile_array<typename E::value_type, IOH>, IP>;
167- chunk_storage chunks (e.derived_cast ().shape (), chunk_shape, path, pool_size);
166+ using chunk_storage = xchunk_store_manager<xfile_array<typename E::value_type, IOH, L >, IP>;
167+ chunk_storage chunks (e.derived_cast ().shape (), chunk_shape, path, pool_size, chunk_memory_layout );
168168 return xchunked_array<chunk_storage, EXT>(e, chunk_storage (), std::forward<S>(chunk_shape));
169169 }
170170
171- template <class IOH , class IP , class EXT , class E >
172- inline xchunked_array<xchunk_store_manager<xfile_array<typename E::value_type, IOH>, IP>, EXT>
173- chunked_file_array (const xexpression<E>& e, const std::string& path, std::size_t pool_size)
171+ template <class IOH , layout_type L, class IP , class EXT , class E >
172+ inline xchunked_array<xchunk_store_manager<xfile_array<typename E::value_type, IOH, L >, IP>, EXT>
173+ chunked_file_array (const xexpression<E>& e, const std::string& path, std::size_t pool_size, char chunk_memory_layout )
174174 {
175- using chunk_storage = xchunk_store_manager<xfile_array<typename E::value_type, IOH>, IP>;
176- chunk_storage chunks (e.derived_cast ().shape (), detail::chunk_helper<E>::chunk_shape (e), path, pool_size);
175+ using chunk_storage = xchunk_store_manager<xfile_array<typename E::value_type, IOH, L >, IP>;
176+ chunk_storage chunks (e.derived_cast ().shape (), detail::chunk_helper<E>::chunk_shape (e), path, pool_size, chunk_memory_layout );
177177 return xchunked_array<chunk_storage, EXT>(e, chunk_storage ());
178178 }
179179
@@ -214,7 +214,8 @@ namespace xt
214214 inline xchunk_store_manager<EC, IP>::xchunk_store_manager(S&& shape,
215215 S&& chunk_shape,
216216 const std::string& directory,
217- std::size_t pool_size)
217+ std::size_t pool_size,
218+ layout_type chunk_memory_layout)
218219 : m_shape(shape)
219220 , m_unload_index(0u )
220221 {
@@ -228,7 +229,7 @@ namespace xt
228229 // resize the pool chunks
229230 for (auto & chunk: m_chunk_pool)
230231 {
231- chunk.resize (chunk_shape);
232+ chunk.resize (chunk_shape, chunk_memory_layout );
232233 chunk.ignore_empty_path (true );
233234 }
234235 m_index_path.set_directory (directory);
0 commit comments