diff --git a/INSTALL.md b/INSTALL.md index d7cbfe54a3..3606a2bd25 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -40,7 +40,7 @@ Both methods are supported. However, for most users we _strongly_ recommend to b - Boost.Container: header-only - Boost.Test: header-only or (optionally) as a compiled library, *only used for unit testing* - Boost.Range: header-only, *only used for unit testing* -- [BTAS](https://github.com/ValeevGroup/BTAS), tag db884b020b5c13c312c07df9d5c03cea2d65afb2 . If usable BTAS installation is not found, TiledArray will download and compile +- [BTAS](https://github.com/ValeevGroup/BTAS), tag 242871710dabd5ef337e5253000d3e38c1d977ba . If usable BTAS installation is not found, TiledArray will download and compile BTAS from source. *This is the recommended way to compile BTAS for all users*. - [MADNESS](https://github.com/m-a-d-n-e-s-s/madness), tag 997e8b458c4234fb6c8c2781a5df59cb14b7e700 . Only the MADworld runtime and BLAS/LAPACK C API component of MADNESS is used by TiledArray. diff --git a/external/versions.cmake b/external/versions.cmake index d5f90bb5cd..4ac855e249 100644 --- a/external/versions.cmake +++ b/external/versions.cmake @@ -24,8 +24,8 @@ set(TA_TRACKED_MADNESS_PREVIOUS_TAG fae8081179b9d074968b08e064a32e3ca07ab0f1) set(TA_TRACKED_MADNESS_VERSION 0.10.1) set(TA_TRACKED_MADNESS_PREVIOUS_VERSION 0.10.1) -set(TA_TRACKED_BTAS_TAG db884b020b5c13c312c07df9d5c03cea2d65afb2) -set(TA_TRACKED_BTAS_PREVIOUS_TAG 1dc111d3efd6d6a4ba6f3b8cbc239315d0392121) +set(TA_TRACKED_BTAS_TAG 242871710dabd5ef337e5253000d3e38c1d977ba) +set(TA_TRACKED_BTAS_PREVIOUS_TAG db884b020b5c13c312c07df9d5c03cea2d65afb2) set(TA_TRACKED_CUTT_TAG 0e8685bf82910bc7435835f846e88f1b39f47f09) set(TA_TRACKED_CUTT_PREVIOUS_TAG 592198b93c93b7ca79e7900b9a9f2e79f9dafec3) diff --git a/src/TiledArray/expressions/blk_tsr_expr.h b/src/TiledArray/expressions/blk_tsr_expr.h index 5604d71d63..00b19d453e 100644 --- a/src/TiledArray/expressions/blk_tsr_expr.h +++ b/src/TiledArray/expressions/blk_tsr_expr.h @@ -234,7 +234,7 @@ class BlkTsrExprBase : public Expr { BlkTsrExprBase(reference array, const std::string& annotation, const PairRange& bounds) : Expr_(), array_(array), annotation_(annotation) { - const auto rank = array.range().rank(); + const auto rank = array.tiles_range().rank(); lower_bound_.reserve(rank); upper_bound_.reserve(rank); int d = 0; diff --git a/src/TiledArray/util/annotation.h b/src/TiledArray/util/annotation.h index 49ca916aff..f4859b188b 100644 --- a/src/TiledArray/util/annotation.h +++ b/src/TiledArray/util/annotation.h @@ -25,10 +25,14 @@ #ifndef TILEDARRAY_ANNOTATION_H__INCLUDED #define TILEDARRAY_ANNOTATION_H__INCLUDED + +#include "TiledArray/error.h" + #include #include +#include #include -#include "TiledArray/error.h" +#include namespace TiledArray::detail { @@ -96,10 +100,12 @@ inline auto tokenize_index(const std::string& s, char delim) { /// TiledArray defines a string as being a valid index if each character is one /// of the following: /// -/// - Roman letters A through Z (uppercase and lowercase are allowed) -/// - Base 10 numbers 0 through 9 -/// - Whitespace -/// - underscore (`_`), prime ('), comma (`,`), or semicolon (`;`) +/// - Roman letters (`A..Z`, `a..z`) +/// - decimal digits (`0..9`) +/// - whitespace (` `) +/// - comma (`,`) +/// - semicolon (`;`) +/// - any of the following characters: `'`_~!@#$%^&*-+./?:|<>[]{}()` /// /// Additionally the string can not: /// @@ -124,7 +130,7 @@ inline bool is_valid_index(const std::string& idx) { "abcdefghijklmnopqrstuvwxyz" "ABCDEFGHIJKLMNOPQRSTUVWXYZ" "1234567890" - " _',;"; + ",; '`_~!@#$%^&*-+./?:|<>[]{}()"; // Are valid characters for (const auto& c : idx) if (valid_chars.find(c) == std::string::npos) return false; diff --git a/tests/annotation.cpp b/tests/annotation.cpp index c01e147cf5..f4ccd40a30 100644 --- a/tests/annotation.cpp +++ b/tests/annotation.cpp @@ -1,6 +1,6 @@ -#include "unit_test_config.h" #include #include +#include "unit_test_config.h" using namespace TiledArray::detail; namespace { @@ -14,10 +14,10 @@ corr_map j_idx{{"j", "j"}, {" j", "j"}, {"j ", "j"}}; corr_map k_idx{{"k", "k"}, {" k", "k"}, {"k ", "k"}}; auto combine_maps(const corr_map& lhs, const corr_map& rhs, - const std::string& joiner = ""){ + const std::string& joiner = "") { corr_map rv; - for(auto& [lidx, lcorr] : lhs){ - for(auto& [ridx, rcorr] : rhs){ + for (auto& [lidx, lcorr] : lhs) { + for (auto& [ridx, rcorr] : rhs) { rv[lidx + joiner + ridx] = lcorr + joiner + rcorr; } } @@ -31,7 +31,7 @@ auto i_j_idx = combine_maps(i_idx, j_idx, ","); auto vov_idx = combine_maps(i_idx, j_idx, ";"); auto vom_idx = combine_maps(k_idx, i_j_idx, ";"); auto mov_idx = combine_maps(i_j_idx, k_idx, ";"); -} // namespace +} // namespace /* We need to remove whitespace from all types of indices: single character, * multiple character, multiple mode, and tensor-of-tensor. This test suite @@ -48,42 +48,36 @@ auto mov_idx = combine_maps(i_j_idx, k_idx, ";"); */ BOOST_AUTO_TEST_SUITE(remove_whitespace_fxn) -BOOST_AUTO_TEST_CASE(single_character){ - for(auto& [idx, corr] : i_idx) - BOOST_CHECK(remove_whitespace(idx) == corr); +BOOST_AUTO_TEST_CASE(single_character) { + for (auto& [idx, corr] : i_idx) BOOST_CHECK(remove_whitespace(idx) == corr); } -BOOST_AUTO_TEST_CASE(multicharacter){ +BOOST_AUTO_TEST_CASE(multicharacter) { auto ij_idx = combine_maps(i_idx, j_idx); - for(auto& [idx, corr] : ij_idx) - BOOST_CHECK(remove_whitespace(idx) == corr); + for (auto& [idx, corr] : ij_idx) BOOST_CHECK(remove_whitespace(idx) == corr); } -BOOST_AUTO_TEST_CASE(matrix_index){ - for(auto& [idx, corr] : i_j_idx) - BOOST_CHECK(remove_whitespace(idx) == corr); +BOOST_AUTO_TEST_CASE(matrix_index) { + for (auto& [idx, corr] : i_j_idx) BOOST_CHECK(remove_whitespace(idx) == corr); } -BOOST_AUTO_TEST_CASE(tensor_index){ +BOOST_AUTO_TEST_CASE(tensor_index) { auto i_j_k_idx = combine_maps(i_j_idx, k_idx, ","); - for(auto& [idx, corr] : i_j_k_idx) + for (auto& [idx, corr] : i_j_k_idx) BOOST_CHECK(remove_whitespace(idx) == corr); } -BOOST_AUTO_TEST_CASE(vector_of_vector_index){ - for(auto& [idx, corr] : vov_idx) - BOOST_CHECK(remove_whitespace(idx) == corr); +BOOST_AUTO_TEST_CASE(vector_of_vector_index) { + for (auto& [idx, corr] : vov_idx) BOOST_CHECK(remove_whitespace(idx) == corr); } -BOOST_AUTO_TEST_CASE(vector_of_matrix){ - for(auto& [idx, corr] : vom_idx) - BOOST_CHECK(remove_whitespace(idx) == corr); +BOOST_AUTO_TEST_CASE(vector_of_matrix) { + for (auto& [idx, corr] : vom_idx) BOOST_CHECK(remove_whitespace(idx) == corr); } -BOOST_AUTO_TEST_CASE(matrix_of_vector){ - for(auto& [idx, corr] : mov_idx) - BOOST_CHECK(remove_whitespace(idx) == corr); +BOOST_AUTO_TEST_CASE(matrix_of_vector) { + for (auto& [idx, corr] : mov_idx) BOOST_CHECK(remove_whitespace(idx) == corr); } BOOST_AUTO_TEST_SUITE_END() @@ -95,7 +89,7 @@ BOOST_AUTO_TEST_SUITE_END() */ BOOST_AUTO_TEST_SUITE(tokenize_index_fxn) -BOOST_AUTO_TEST_CASE(split_on_comma){ +BOOST_AUTO_TEST_CASE(split_on_comma) { std::map input2corr{ {"", string_vector_t{""}}, {"hello world", string_vector_t{"hello world"}}, @@ -106,13 +100,12 @@ BOOST_AUTO_TEST_CASE(split_on_comma){ {"hello,world ", string_vector_t{"hello", "world "}}, {"hello world,", string_vector_t{"hello world", ""}}, {"hello world, ", string_vector_t{"hello world", " "}}, - {"1,2,3", string_vector_t{"1", "2", "3"}} - }; - for(auto& [str, corr] : input2corr) + {"1,2,3", string_vector_t{"1", "2", "3"}}}; + for (auto& [str, corr] : input2corr) BOOST_CHECK(tokenize_index(str, ',') == corr); } -BOOST_AUTO_TEST_CASE(split_on_semicolon){ +BOOST_AUTO_TEST_CASE(split_on_semicolon) { std::map input2corr{ {"", string_vector_t{""}}, {"hello world", string_vector_t{"hello world"}}, @@ -123,9 +116,8 @@ BOOST_AUTO_TEST_CASE(split_on_semicolon){ {"hello;world ", string_vector_t{"hello", "world "}}, {"hello world;", string_vector_t{"hello world", ""}}, {"hello world;", string_vector_t{"hello world", " "}}, - {"1;2;3", string_vector_t{"1", "2", "3"}} - }; - for(auto& [str, corr] : input2corr) + {"1;2;3", string_vector_t{"1", "2", "3"}}}; + for (auto& [str, corr] : input2corr) BOOST_CHECK(tokenize_index(str, ';') == corr); } @@ -139,29 +131,34 @@ BOOST_AUTO_TEST_SUITE_END() */ BOOST_AUTO_TEST_SUITE(is_valid_index_fxn) -BOOST_AUTO_TEST_CASE(valid_indices){ - for(auto idx_set : {i_idx, i_j_idx, vov_idx, vom_idx, mov_idx}){ - for(auto& [idx, corr] : idx_set) { +BOOST_AUTO_TEST_CASE(valid_indices) { + for (auto idx_set : {i_idx, i_j_idx, vov_idx, vom_idx, mov_idx}) { + for (auto& [idx, corr] : idx_set) { BOOST_CHECK(is_valid_index(idx)); } } + // all valid characters forming index name + BOOST_CHECK( + is_valid_index("abcdefghijklmnopqrstuvwxyz,ABCDEFGHIJKLMNOPQRSTUVWXYZ;'`_" + "~!@#$%^&*-+.,/?:|<>[]{}")); } -BOOST_AUTO_TEST_CASE(unallowed_character){ - BOOST_CHECK(is_valid_index("i,&,j") == false); +BOOST_AUTO_TEST_CASE(unallowed_character) { + BOOST_CHECK(is_valid_index("i,\",j") == false); + BOOST_CHECK(is_valid_index("i,\\,j") == false); } -BOOST_AUTO_TEST_CASE(multiple_semicolons){ +BOOST_AUTO_TEST_CASE(multiple_semicolons) { BOOST_CHECK(is_valid_index("i;j;k") == false); } -BOOST_AUTO_TEST_CASE(only_whitespace){ +BOOST_AUTO_TEST_CASE(only_whitespace) { BOOST_CHECK(is_valid_index("") == false); BOOST_CHECK(is_valid_index(" ") == false); BOOST_CHECK(is_valid_index(" ") == false); } -BOOST_AUTO_TEST_CASE(empty_index_name){ +BOOST_AUTO_TEST_CASE(empty_index_name) { BOOST_CHECK(is_valid_index("i,") == false); BOOST_CHECK(is_valid_index(",i") == false); BOOST_CHECK(is_valid_index("i,,j") == false); @@ -182,19 +179,17 @@ BOOST_AUTO_TEST_SUITE_END() */ BOOST_AUTO_TEST_SUITE(is_tot_index_fxn) -BOOST_AUTO_TEST_CASE(valid_but_not_tot){ - for(auto x : {i_idx, i_j_idx}) - for(auto idx : x) - BOOST_CHECK(is_tot_index(idx.first) == false); +BOOST_AUTO_TEST_CASE(valid_but_not_tot) { + for (auto x : {i_idx, i_j_idx}) + for (auto idx : x) BOOST_CHECK(is_tot_index(idx.first) == false); } -BOOST_AUTO_TEST_CASE(valid_tot_idx){ - for(auto x : {vov_idx, vom_idx, mov_idx}) - for(auto idx : x) - BOOST_CHECK(is_tot_index(idx.first)); +BOOST_AUTO_TEST_CASE(valid_tot_idx) { + for (auto x : {vov_idx, vom_idx, mov_idx}) + for (auto idx : x) BOOST_CHECK(is_tot_index(idx.first)); } -BOOST_AUTO_TEST_CASE(not_valid_idx){ +BOOST_AUTO_TEST_CASE(not_valid_idx) { BOOST_CHECK(is_tot_index("") == false); BOOST_CHECK(is_tot_index(";") == false); } @@ -208,32 +203,29 @@ BOOST_AUTO_TEST_SUITE_END() */ BOOST_AUTO_TEST_SUITE(split_index_fxn) -BOOST_AUTO_TEST_CASE(invalid_idx){ - if(TiledArray::get_default_world().nproc() == 1) +BOOST_AUTO_TEST_CASE(invalid_idx) { + if (TiledArray::get_default_world().nproc() == 1) BOOST_CHECK_THROW(split_index("i,"), TiledArray::Exception); } -BOOST_AUTO_TEST_CASE(non_tot){ +BOOST_AUTO_TEST_CASE(non_tot) { std::map> inputs{ {"i", {string_vector_t{"i"}, string_vector_t{}}}, - {"i,j", {string_vector_t{"i","j"}, string_vector_t{}}}, - {"i,j,k", {string_vector_t{"i", "j", "k"}, string_vector_t{}}} - }; + {"i,j", {string_vector_t{"i", "j"}, string_vector_t{}}}, + {"i,j,k", {string_vector_t{"i", "j", "k"}, string_vector_t{}}}}; - for(auto& [idx, corr] : inputs) { + for (auto& [idx, corr] : inputs) { BOOST_CHECK(split_index(idx) == corr); } } -BOOST_AUTO_TEST_CASE(tot){ +BOOST_AUTO_TEST_CASE(tot) { std::map> inputs{ {"i;j", {string_vector_t{"i"}, string_vector_t{"j"}}}, - {"i,j;k", {string_vector_t{"i","j"}, string_vector_t{"k"}}}, - {"i;j,k", {string_vector_t{"i"}, string_vector_t{"j", "k"}}} - }; + {"i,j;k", {string_vector_t{"i", "j"}, string_vector_t{"k"}}}, + {"i;j,k", {string_vector_t{"i"}, string_vector_t{"j", "k"}}}}; - for(auto& [idx, corr] : inputs) - BOOST_CHECK(split_index(idx) == corr); + for (auto& [idx, corr] : inputs) BOOST_CHECK(split_index(idx) == corr); } BOOST_AUTO_TEST_SUITE_END() diff --git a/tests/dist_array.cpp b/tests/dist_array.cpp index 7005ac60d0..d65bf73f86 100644 --- a/tests/dist_array.cpp +++ b/tests/dist_array.cpp @@ -36,8 +36,8 @@ ArrayFixture::ArrayFixture() : shape_tensor(tr.tiles_range(), 0.0), world(*GlobalFixture::world), a(world, tr) { - for (ArrayN::range_type::const_iterator it = a.range().begin(); - it != a.range().end(); ++it) + for (ArrayN::range_type::const_iterator it = a.tiles_range().begin(); + it != a.tiles_range().end(); ++it) if (a.is_local(*it)) a.set(*it, world.rank() + 1); // Fill the tile at *it (the index) @@ -46,8 +46,8 @@ ArrayFixture::ArrayFixture() } b = decltype(b)(world, tr, TiledArray::SparseShape(shape_tensor, tr)); - for (SpArrayN::range_type::const_iterator it = b.range().begin(); - it != b.range().end(); ++it) + for (SpArrayN::range_type::const_iterator it = b.tiles_range().begin(); + it != b.tiles_range().end(); ++it) if (!b.is_zero(*it) && b.is_local(*it)) b.set(*it, world.rank() + 1); // Fill the tile at *it (the index) @@ -305,8 +305,8 @@ BOOST_AUTO_TEST_CASE(owner) { std::default_delete()); ordinal_type o = 0; - for (ArrayN::range_type::const_iterator it = a.range().begin(); - it != a.range().end(); ++it, ++o) { + for (ArrayN::range_type::const_iterator it = a.tiles_range().begin(); + it != a.tiles_range().end(); ++it, ++o) { // Check that local ownership agrees const int owner = a.owner(*it); BOOST_CHECK_EQUAL(a.owner(o), owner); @@ -334,8 +334,8 @@ BOOST_AUTO_TEST_CASE(is_local) { // Test to make sure everyone agrees who owns which tiles. ordinal_type o = 0; - for (ArrayN::range_type::const_iterator it = a.range().begin(); - it != a.range().end(); ++it, ++o) { + for (ArrayN::range_type::const_iterator it = a.tiles_range().begin(); + it != a.tiles_range().end(); ++it, ++o) { // Check that local ownership agrees const bool local_tile = a.owner(o) == world.rank(); BOOST_CHECK_EQUAL(a.is_local(*it), local_tile); @@ -352,8 +352,8 @@ BOOST_AUTO_TEST_CASE(is_local) { } BOOST_AUTO_TEST_CASE(find_local) { - for (ArrayN::range_type::const_iterator it = a.range().begin(); - it != a.range().end(); ++it) { + for (ArrayN::range_type::const_iterator it = a.tiles_range().begin(); + it != a.tiles_range().end(); ++it) { if (a.is_local(*it)) { Future tile = a.find(*it); @@ -366,7 +366,7 @@ BOOST_AUTO_TEST_CASE(find_local) { } } - for (auto&& tile_idx : a.range()) { + for (auto&& tile_idx : a.tiles_range()) { if (a.is_local(tile_idx)) { const Future& const_tile_fut = a.find_local(tile_idx); Future& nonconst_tile_fut = a.find_local(tile_idx); @@ -393,8 +393,8 @@ BOOST_AUTO_TEST_CASE(find_local) { } BOOST_AUTO_TEST_CASE(find_remote) { - for (ArrayN::range_type::const_iterator it = a.range().begin(); - it != a.range().end(); ++it) { + for (ArrayN::range_type::const_iterator it = a.tiles_range().begin(); + it != a.tiles_range().end(); ++it) { if (!a.is_local(*it)) { Future tile = a.find(*it); @@ -409,8 +409,8 @@ BOOST_AUTO_TEST_CASE(find_remote) { BOOST_AUTO_TEST_CASE(fill_tiles) { ArrayN a(world, tr); - for (ArrayN::range_type::const_iterator it = a.range().begin(); - it != a.range().end(); ++it) { + for (ArrayN::range_type::const_iterator it = a.tiles_range().begin(); + it != a.tiles_range().end(); ++it) { if (a.is_local(*it)) { a.set(*it, 0); // Fill the tile at *it (the index) with 0 @@ -430,8 +430,8 @@ BOOST_AUTO_TEST_CASE(assign_tiles) { std::vector data; ArrayN a(world, tr); - for (ArrayN::range_type::const_iterator it = a.range().begin(); - it != a.range().end(); ++it) { + for (ArrayN::range_type::const_iterator it = a.tiles_range().begin(); + it != a.tiles_range().end(); ++it) { ArrayN::trange_type::range_type range = a.trange().make_tile_range(*it); if (a.is_local(*it)) { if (data.size() < range.volume()) data.resize(range.volume(), 1); @@ -500,8 +500,8 @@ BOOST_AUTO_TEST_CASE(truncate) { BOOST_CHECK_NO_THROW(b_trunc0.truncate()); auto b_trunc1 = b.clone(); BOOST_CHECK_NO_THROW( - b_trunc1.truncate(std::numeric_limits::max())); + b_trunc1.truncate(std::numeric_limits< + typename decltype(b)::shape_type::value_type>::max())); BOOST_CHECK(std::distance(b_trunc1.begin(), b_trunc1.end()) == 0); } @@ -623,12 +623,12 @@ BOOST_AUTO_TEST_CASE(parallel_serialization) { char archive_file_prefix_name[] = "tmp.XXXXXX"; mktemp(archive_file_prefix_name); madness::archive::ParallelOutputArchive<> oar(world, archive_file_prefix_name, - nio); + nio); oar& a; oar.close(); madness::archive::ParallelInputArchive<> iar(world, archive_file_prefix_name, - nio); + nio); decltype(a) aread; aread.load(world, iar); @@ -647,12 +647,12 @@ BOOST_AUTO_TEST_CASE(parallel_sparse_serialization) { char archive_file_prefix_name[] = "tmp.XXXXXX"; mktemp(archive_file_prefix_name); madness::archive::ParallelOutputArchive<> oar(world, archive_file_prefix_name, - nio); + nio); oar& b; oar.close(); madness::archive::ParallelInputArchive<> iar(world, archive_file_prefix_name, - nio); + nio); decltype(b) bread; bread.load(world, iar); diff --git a/tests/dist_eval_binary_eval.cpp b/tests/dist_eval_binary_eval.cpp index a79ac1ef31..5e8368fd81 100644 --- a/tests/dist_eval_binary_eval.cpp +++ b/tests/dist_eval_binary_eval.cpp @@ -215,7 +215,7 @@ BOOST_AUTO_TEST_CASE(perm_eval) { for (auto index : *dist_eval.pmap()) { // Get the original tiles const std::size_t arg_index = - left.range().ordinal(inv_perm * dist_eval.range().idx(index)); + left.tiles_range().ordinal(inv_perm * dist_eval.range().idx(index)); const TArrayI::value_type left_tile = left.find(arg_index); const TArrayI::value_type right_tile = right.find(arg_index); diff --git a/tests/dist_eval_contraction_eval.cpp b/tests/dist_eval_contraction_eval.cpp index 1c31328359..6e59e2f93b 100644 --- a/tests/dist_eval_contraction_eval.cpp +++ b/tests/dist_eval_contraction_eval.cpp @@ -115,9 +115,9 @@ struct ContractionEvalFixture : public SparseShapeFixture { const int middle) { // Compute the number of rows and columns in the matrix, and a new weight // that is bisected the row and column dimensions. - std::vector weight(array.range().rank(), 0ul); + std::vector weight(array.tiles_range().rank(), 0ul); std::size_t MN[2] = {1ul, 1ul}; - const int dim = array.range().rank(); + const int dim = array.tiles_range().rank(); int i = dim - 1; for (; i >= middle; --i) { weight[i] = MN[1]; diff --git a/tests/eigen.cpp b/tests/eigen.cpp index 6196591713..bfa4f1a0db 100644 --- a/tests/eigen.cpp +++ b/tests/eigen.cpp @@ -172,8 +172,8 @@ BOOST_AUTO_TEST_CASE(matrix_to_array) { (array = eigen_to_array(*GlobalFixture::world, trange, matrix))); // Check that the data in array is equal to that in matrix - for (Range::const_iterator it = array.range().begin(); - it != array.range().end(); ++it) { + for (Range::const_iterator it = array.tiles_range().begin(); + it != array.tiles_range().end(); ++it) { Future tile = array.find(*it); for (Range::const_iterator tile_it = tile.get().range().begin(); tile_it != tile.get().range().end(); ++tile_it) { @@ -193,8 +193,8 @@ BOOST_AUTO_TEST_CASE(vector_to_array) { trange1, vector))); // Check that the data in array matches the data in vector - for (Range::const_iterator it = array1.range().begin(); - it != array1.range().end(); ++it) { + for (Range::const_iterator it = array1.tiles_range().begin(); + it != array1.tiles_range().end(); ++it) { Future tile = array1.find(*it); for (Range::const_iterator tile_it = tile.get().range().begin(); tile_it != tile.get().range().end(); ++tile_it) { @@ -211,8 +211,8 @@ BOOST_AUTO_TEST_CASE(array_to_matrix) { if (GlobalFixture::world->size() == 1) { // Fill the array with random data GlobalFixture::world->srand(27); - for (Range::const_iterator it = array.range().begin(); - it != array.range().end(); ++it) { + for (Range::const_iterator it = array.tiles_range().begin(); + it != array.tiles_range().end(); ++it) { TArrayI::value_type tile(array.trange().make_tile_range(*it)); for (TArrayI::value_type::iterator tile_it = tile.begin(); tile_it != tile.end(); ++tile_it) { @@ -235,8 +235,8 @@ BOOST_AUTO_TEST_CASE(array_to_matrix) { array.trange().elements_range().extent(1)); // Check that the data in matrix matches the data in array - for (Range::const_iterator it = array.range().begin(); - it != array.range().end(); ++it) { + for (Range::const_iterator it = array.tiles_range().begin(); + it != array.tiles_range().end(); ++it) { Future tile = array.find(*it); for (Range::const_iterator tile_it = tile.get().range().begin(); tile_it != tile.get().range().end(); ++tile_it) { @@ -281,8 +281,8 @@ BOOST_AUTO_TEST_CASE(array_to_matrix) { array.trange().elements_range().extent(1)); // Check that the data in vector matches the data in array - for (Range::const_iterator it = array.range().begin(); - it != array.range().end(); ++it) { + for (Range::const_iterator it = array.tiles_range().begin(); + it != array.tiles_range().end(); ++it) { BOOST_CHECK(array.is_local(*it)); Future tile = array.find(*it); @@ -301,8 +301,8 @@ BOOST_AUTO_TEST_CASE(array_to_vector) { if (GlobalFixture::world->size() == 1) { // Fill the array with random data GlobalFixture::world->srand(27); - for (Range::const_iterator it = array1.range().begin(); - it != array1.range().end(); ++it) { + for (Range::const_iterator it = array1.tiles_range().begin(); + it != array1.tiles_range().end(); ++it) { TArrayI::value_type tile(array1.trange().make_tile_range(*it)); for (TArrayI::value_type::iterator tile_it = tile.begin(); tile_it != tile.end(); ++tile_it) { @@ -320,8 +320,8 @@ BOOST_AUTO_TEST_CASE(array_to_vector) { BOOST_CHECK_EQUAL(vector.cols(), 1); // Check that the data in vector matches the data in array - for (Range::const_iterator it = array1.range().begin(); - it != array1.range().end(); ++it) { + for (Range::const_iterator it = array1.tiles_range().begin(); + it != array1.tiles_range().end(); ++it) { Future tile = array1.find(*it); for (Range::const_iterator tile_it = tile.get().range().begin(); tile_it != tile.get().range().end(); ++tile_it) { @@ -359,8 +359,8 @@ BOOST_AUTO_TEST_CASE(array_to_vector) { BOOST_CHECK_EQUAL(vector.cols(), 1); // Check that the data in vector matches the data in array - for (Range::const_iterator it = array1.range().begin(); - it != array1.range().end(); ++it) { + for (Range::const_iterator it = array1.tiles_range().begin(); + it != array1.tiles_range().end(); ++it) { BOOST_CHECK(array1.is_local(*it)); Future tile = array1.find(*it); @@ -430,8 +430,8 @@ BOOST_AUTO_TEST_CASE(tensor_to_array) { *GlobalFixture::world, trangeN, tensor))); // Check that the data in array is equal to that in matrix - for (Range::const_iterator it = array.range().begin(); - it != array.range().end(); ++it) { + for (Range::const_iterator it = array.tiles_range().begin(); + it != array.tiles_range().end(); ++it) { Future tile = array.find(*it); for (Range::const_iterator tile_it = tile.get().range().begin(); tile_it != tile.get().range().end(); ++tile_it) { @@ -497,8 +497,8 @@ BOOST_AUTO_TEST_CASE(array_to_tensor) { arrayN.trange().elements_range().extent().end()); // Check that the data in vector matches the data in array - for (Range::const_iterator it = arrayN.range().begin(); - it != arrayN.range().end(); ++it) { + for (Range::const_iterator it = arrayN.tiles_range().begin(); + it != arrayN.tiles_range().end(); ++it) { BOOST_CHECK(arrayN.is_local(*it)); Future tile = arrayN.find(*it); diff --git a/tests/expressions_impl.h b/tests/expressions_impl.h index 0ffbf4754e..76bb75a06c 100644 --- a/tests/expressions_impl.h +++ b/tests/expressions_impl.h @@ -237,7 +237,8 @@ BOOST_FIXTURE_TEST_CASE_TEMPLATE(permute, F, Fixtures, F) { BOOST_REQUIRE_NO_THROW(a("a,b,c") = b("c,b,a")); for (std::size_t i = 0ul; i < b.size(); ++i) { - const std::size_t perm_index = a.range().ordinal(perm * b.range().idx(i)); + const std::size_t perm_index = + a.tiles_range().ordinal(perm * b.tiles_range().idx(i)); if (a.is_local(perm_index) && !a.is_zero(perm_index)) { auto a_tile = a.find(perm_index).get(); auto perm_b_tile = perm * b.find(i).get(); @@ -258,7 +259,8 @@ BOOST_FIXTURE_TEST_CASE_TEMPLATE(scale_permute, F, Fixtures, F) { BOOST_REQUIRE_NO_THROW(a("a,b,c") = 2 * b("c,b,a")); for (std::size_t i = 0ul; i < b.size(); ++i) { - const std::size_t perm_index = a.range().ordinal(perm * b.range().idx(i)); + const std::size_t perm_index = + a.tiles_range().ordinal(perm * b.tiles_range().idx(i)); if (a.is_local(perm_index) && !a.is_zero(perm_index)) { auto a_tile = a.find(perm_index).get(); auto perm_b_tile = perm * b.find(i).get(); @@ -501,7 +503,8 @@ BOOST_FIXTURE_TEST_CASE_TEMPLATE(permute_block, F, Fixtures, F) { BOOST_REQUIRE_NO_THROW(c("a,b,c") = a("c,b,a").block({3, 3, 3}, {5, 5, 5})); for (std::size_t index = 0ul; index < block_range.volume(); ++index) { - const size_t perm_index = c.range().ordinal(perm * c.range().idx(index)); + const size_t perm_index = + c.tiles_range().ordinal(perm * c.tiles_range().idx(index)); if (!a.is_zero(block_range.ordinal(perm_index))) { auto arg_tile = perm * a.find(block_range.ordinal(perm_index)).get(); @@ -520,7 +523,8 @@ BOOST_FIXTURE_TEST_CASE_TEMPLATE(permute_block, F, Fixtures, F) { 2 * a("c,b,a").block({3, 3, 3}, {5, 5, 5})); for (std::size_t index = 0ul; index < block_range.volume(); ++index) { - const size_t perm_index = c.range().ordinal(perm * c.range().idx(index)); + const size_t perm_index = + c.tiles_range().ordinal(perm * c.tiles_range().idx(index)); if (!a.is_zero(block_range.ordinal(perm_index))) { auto arg_tile = perm * a.find(block_range.ordinal(perm_index)).get(); @@ -540,7 +544,8 @@ BOOST_FIXTURE_TEST_CASE_TEMPLATE(permute_block, F, Fixtures, F) { 4 * b("a,b,c").block({3, 3, 3}, {5, 5, 5}))); for (std::size_t index = 0ul; index < block_range.volume(); ++index) { - const size_t perm_index = c.range().ordinal(perm * c.range().idx(index)); + const size_t perm_index = + c.tiles_range().ordinal(perm * c.tiles_range().idx(index)); if (!a.is_zero(block_range.ordinal(perm_index)) || !b.is_zero(block_range.ordinal(index))) { @@ -565,7 +570,8 @@ BOOST_FIXTURE_TEST_CASE_TEMPLATE(permute_block, F, Fixtures, F) { 4 * b("c,b,a").block({3, 3, 3}, {5, 5, 5}))); for (std::size_t index = 0ul; index < block_range.volume(); ++index) { - const size_t perm_index = c.range().ordinal(perm * c.range().idx(index)); + const size_t perm_index = + c.tiles_range().ordinal(perm * c.tiles_range().idx(index)); if (!a.is_zero(block_range.ordinal(perm_index)) || !b.is_zero(block_range.ordinal(perm_index))) { @@ -681,7 +687,7 @@ BOOST_FIXTURE_TEST_CASE_TEMPLATE(assign_subblock_permute_block, F, Fixtures, for (std::size_t index = 0ul; index < block_range.volume(); ++index) { // const size_t perm_index = block_range.ordinal(perm * - // c.range().idx(index)); + // c.tiles_range().idx(index)); auto perm_index = perm * block_range.idx(index); if (!a.is_zero(block_range.ordinal(perm_index))) { @@ -961,7 +967,8 @@ BOOST_FIXTURE_TEST_CASE_TEMPLATE(add_permute, F, Fixtures, F) { BOOST_REQUIRE_NO_THROW(c("a,b,c") = (2 * a("c,b,a")) + (3 * b("a,b,c"))); for (std::size_t i = 0ul; i < c.size(); ++i) { - const size_t perm_index = c.range().ordinal(perm * a.range().idx(i)); + const size_t perm_index = + c.tiles_range().ordinal(perm * a.tiles_range().idx(i)); if (!c.is_zero(i)) { auto c_tile = c.find(i).get(); auto a_tile = a.is_zero(perm_index) ? F::make_zero_tile(c_tile.range()) @@ -979,7 +986,8 @@ BOOST_FIXTURE_TEST_CASE_TEMPLATE(add_permute, F, Fixtures, F) { BOOST_REQUIRE_NO_THROW(c("a,b,c") = (2 * a("c,b,a")) + (3 * b("c,b,a"))); for (std::size_t i = 0ul; i < c.size(); ++i) { - const size_t perm_index = c.range().ordinal(perm * a.range().idx(i)); + const size_t perm_index = + c.tiles_range().ordinal(perm * a.tiles_range().idx(i)); if (!c.is_zero(i)) { auto c_tile = c.find(i).get(); auto a_tile = a.is_zero(perm_index) ? F::make_zero_tile(c_tile.range()) @@ -1098,7 +1106,8 @@ BOOST_FIXTURE_TEST_CASE_TEMPLATE(scale_add_permute, F, Fixtures, F) { BOOST_REQUIRE_NO_THROW(c("a,b,c") = 5 * (2 * a("c,b,a")) + (3 * b("a,b,c"))); for (std::size_t i = 0ul; i < c.size(); ++i) { - const size_t perm_index = c.range().ordinal(perm * a.range().idx(i)); + const size_t perm_index = + c.tiles_range().ordinal(perm * a.tiles_range().idx(i)); if (!c.is_zero(i)) { auto c_tile = c.find(i).get(); auto a_tile = a.is_zero(perm_index) ? F::make_zero_tile(c_tile.range()) @@ -1116,7 +1125,8 @@ BOOST_FIXTURE_TEST_CASE_TEMPLATE(scale_add_permute, F, Fixtures, F) { BOOST_REQUIRE_NO_THROW(c("a,b,c") = 5 * (2 * a("c,b,a")) + (3 * b("c,b,a"))); for (std::size_t i = 0ul; i < c.size(); ++i) { - const size_t perm_index = c.range().ordinal(perm * a.range().idx(i)); + const size_t perm_index = + c.tiles_range().ordinal(perm * a.tiles_range().idx(i)); if (!c.is_zero(i)) { auto c_tile = c.find(i).get(); auto a_tile = a.is_zero(perm_index) ? F::make_zero_tile(c_tile.range()) @@ -1258,7 +1268,8 @@ BOOST_FIXTURE_TEST_CASE_TEMPLATE(sub_permute, F, Fixtures, F) { BOOST_REQUIRE_NO_THROW(c("a,b,c") = (2 * a("c,b,a")) - (3 * b("a,b,c"))); for (std::size_t i = 0ul; i < c.size(); ++i) { - const size_t perm_index = c.range().ordinal(perm * a.range().idx(i)); + const size_t perm_index = + c.tiles_range().ordinal(perm * a.tiles_range().idx(i)); if (!c.is_zero(i)) { auto c_tile = c.find(i).get(); auto a_tile = a.is_zero(perm_index) ? F::make_zero_tile(c_tile.range()) @@ -1276,7 +1287,8 @@ BOOST_FIXTURE_TEST_CASE_TEMPLATE(sub_permute, F, Fixtures, F) { BOOST_REQUIRE_NO_THROW(c("a,b,c") = (2 * a("c,b,a")) - (3 * b("c,b,a"))); for (std::size_t i = 0ul; i < c.size(); ++i) { - const size_t perm_index = c.range().ordinal(perm * a.range().idx(i)); + const size_t perm_index = + c.tiles_range().ordinal(perm * a.tiles_range().idx(i)); if (!c.is_zero(i)) { auto c_tile = c.find(i).get(); auto a_tile = a.is_zero(perm_index) ? F::make_zero_tile(c_tile.range()) @@ -1377,7 +1389,8 @@ BOOST_FIXTURE_TEST_CASE_TEMPLATE(scale_sub_permute, F, Fixtures, F) { BOOST_REQUIRE_NO_THROW(c("a,b,c") = 5 * (2 * a("c,b,a")) - (3 * b("a,b,c"))); for (std::size_t i = 0ul; i < c.size(); ++i) { - const size_t perm_index = c.range().ordinal(perm * a.range().idx(i)); + const size_t perm_index = + c.tiles_range().ordinal(perm * a.tiles_range().idx(i)); if (!c.is_zero(i)) { auto c_tile = c.find(i).get(); auto a_tile = a.is_zero(perm_index) ? F::make_zero_tile(c_tile.range()) @@ -1395,7 +1408,8 @@ BOOST_FIXTURE_TEST_CASE_TEMPLATE(scale_sub_permute, F, Fixtures, F) { BOOST_REQUIRE_NO_THROW(c("a,b,c") = 5 * (2 * a("c,b,a")) - (3 * b("c,b,a"))); for (std::size_t i = 0ul; i < c.size(); ++i) { - const size_t perm_index = c.range().ordinal(perm * a.range().idx(i)); + const size_t perm_index = + c.tiles_range().ordinal(perm * a.tiles_range().idx(i)); if (!c.is_zero(i)) { auto c_tile = c.find(i).get(); auto a_tile = a.is_zero(perm_index) ? F::make_zero_tile(c_tile.range()) @@ -1495,7 +1509,8 @@ BOOST_FIXTURE_TEST_CASE_TEMPLATE(mult_permute, F, Fixtures, F) { BOOST_REQUIRE_NO_THROW(c("a,b,c") = (2 * a("c,b,a")) * (3 * b("a,b,c"))); for (std::size_t i = 0ul; i < c.size(); ++i) { - const size_t perm_index = c.range().ordinal(perm * a.range().idx(i)); + const size_t perm_index = + c.tiles_range().ordinal(perm * a.tiles_range().idx(i)); if (!c.is_zero(i)) { auto c_tile = c.find(i).get(); auto a_tile = a.is_zero(perm_index) ? F::make_zero_tile(c_tile.range()) @@ -1513,7 +1528,8 @@ BOOST_FIXTURE_TEST_CASE_TEMPLATE(mult_permute, F, Fixtures, F) { BOOST_REQUIRE_NO_THROW(c("a,b,c") = (2 * a("c,b,a")) * (3 * b("c,b,a"))); for (std::size_t i = 0ul; i < c.size(); ++i) { - const size_t perm_index = c.range().ordinal(perm * a.range().idx(i)); + const size_t perm_index = + c.tiles_range().ordinal(perm * a.tiles_range().idx(i)); if (!c.is_zero(i)) { auto c_tile = c.find(i).get(); auto a_tile = a.is_zero(perm_index) ? F::make_zero_tile(c_tile.range()) @@ -1656,7 +1672,8 @@ BOOST_FIXTURE_TEST_CASE_TEMPLATE(scale_mult_permute, F, Fixtures, F) { BOOST_REQUIRE_NO_THROW(c("a,b,c") = 5 * (2 * a("c,b,a")) * (3 * b("a,b,c"))); for (std::size_t i = 0ul; i < c.size(); ++i) { - const size_t perm_index = c.range().ordinal(perm * a.range().idx(i)); + const size_t perm_index = + c.tiles_range().ordinal(perm * a.tiles_range().idx(i)); if (!c.is_zero(i)) { auto c_tile = c.find(i).get(); auto a_tile = a.is_zero(perm_index) ? F::make_zero_tile(c_tile.range()) @@ -1674,7 +1691,8 @@ BOOST_FIXTURE_TEST_CASE_TEMPLATE(scale_mult_permute, F, Fixtures, F) { BOOST_REQUIRE_NO_THROW(c("a,b,c") = 5 * (2 * a("c,b,a")) * (3 * b("c,b,a"))); for (std::size_t i = 0ul; i < c.size(); ++i) { - const size_t perm_index = c.range().ordinal(perm * a.range().idx(i)); + const size_t perm_index = + c.tiles_range().ordinal(perm * a.tiles_range().idx(i)); if (!c.is_zero(i)) { auto c_tile = c.find(i).get(); auto a_tile = a.is_zero(perm_index) ? F::make_zero_tile(c_tile.range()) @@ -2794,7 +2812,8 @@ BOOST_FIXTURE_TEST_CASE_TEMPLATE(dot_permute, F, Fixtures, F) { // Compute the expected value for the dot function. typename F::element_type expected = 0; for (std::size_t i = 0ul; i < a.size(); ++i) { - const size_t perm_index = a.range().ordinal(perm * b.range().idx(i)); + const size_t perm_index = + a.tiles_range().ordinal(perm * b.tiles_range().idx(i)); if (!a.is_zero(i) && !b.is_zero(perm_index)) { auto a_tile = a.find(i).get(); auto b_tile = perm * b.find(perm_index).get(); @@ -2814,7 +2833,8 @@ BOOST_FIXTURE_TEST_CASE_TEMPLATE(dot_permute, F, Fixtures, F) { // Compute the expected value for the dot function. for (std::size_t i = 0ul; i < a.size(); ++i) { - const size_t perm_index = a.range().ordinal(perm * b.range().idx(i)); + const size_t perm_index = + a.tiles_range().ordinal(perm * b.tiles_range().idx(i)); if (!a.is_zero(i) || !b.is_zero(perm_index)) { auto a_tile = a.is_zero(i) ? F::make_zero_tile(a.trange().tile(i)) : a.find(i).get(); @@ -2836,7 +2856,8 @@ BOOST_FIXTURE_TEST_CASE_TEMPLATE(dot_permute, F, Fixtures, F) { // Compute the expected value for the dot function. for (std::size_t i = 0ul; i < a.size(); ++i) { - const size_t perm_index = a.range().ordinal(perm * b.range().idx(i)); + const size_t perm_index = + a.tiles_range().ordinal(perm * b.tiles_range().idx(i)); if (!a.is_zero(i) && !b.is_zero(perm_index)) { auto a_tile = a.find(i).get(); auto b_tile = perm * b.find(perm_index).get(); @@ -2857,7 +2878,8 @@ BOOST_FIXTURE_TEST_CASE_TEMPLATE(dot_permute, F, Fixtures, F) { // Compute the expected value for the dot function. for (std::size_t i = 0ul; i < a.size(); ++i) { - const size_t perm_index = a.range().ordinal(perm * b.range().idx(i)); + const size_t perm_index = + a.tiles_range().ordinal(perm * b.tiles_range().idx(i)); if (!a.is_zero(i) || !b.is_zero(perm_index)) { auto a_tile = a.is_zero(i) ? F::make_zero_tile(a.trange().tile(i)) : a.find(i).get(); diff --git a/tests/tot_array_fixture.h b/tests/tot_array_fixture.h index 45a0ae0f8e..9d46fadcc7 100644 --- a/tests/tot_array_fixture.h +++ b/tests/tot_array_fixture.h @@ -264,7 +264,7 @@ struct ToTArrayFixture { // Same components? Here we make all ranks check all tiles bool are_same = true; - for (auto idx : lhs.range()) { + for (auto idx : lhs.tiles_range()) { const auto& lhs_tot = lhs.find(idx).get(); const auto& rhs_tot = rhs.find(idx).get(); if (lhs_tot != rhs_tot) { diff --git a/tests/tot_dist_array_part2.cpp b/tests/tot_dist_array_part2.cpp index 9473a5ef6a..fa13819fee 100644 --- a/tests/tot_dist_array_part2.cpp +++ b/tests/tot_dist_array_part2.cpp @@ -259,13 +259,13 @@ BOOST_AUTO_TEST_CASE_TEMPLATE(range, TestParam, test_params) { { tensor_type t; if (m_world.nproc() == 1) - BOOST_CHECK_THROW(t.range(), TiledArray::Exception); + BOOST_CHECK_THROW(t.tiles_range(), TiledArray::Exception); } for (auto tr_t : run_all()) { auto& tr = std::get<0>(tr_t); auto& corr = std::get<2>(tr_t); - bool are_same = corr.range() == tr.tiles_range(); + bool are_same = corr.tiles_range() == tr.tiles_range(); BOOST_TEST(are_same); } } @@ -344,7 +344,7 @@ BOOST_AUTO_TEST_CASE_TEMPLATE(call_operator, TestParam, test_params) { for (auto tr_t : run_all()) { auto inner_rank = std::get<1>(tr_t); auto& t = std::get<2>(tr_t); - auto outer_rank = t.range().rank(); + auto outer_rank = t.tiles_range().rank(); std::string outer_idx = (outer_rank == 1 ? "i" : "i,j"); std::string inner_idx = (inner_rank == 1 ? "k" : "k,l"); @@ -367,7 +367,7 @@ BOOST_AUTO_TEST_CASE_TEMPLATE(const_call_operator, TestParam, test_params) { for (auto tr_t : run_all()) { auto inner_rank = std::get<1>(tr_t); const auto& t = std::get<2>(tr_t); - auto outer_rank = t.range().rank(); + auto outer_rank = t.tiles_range().rank(); std::string outer_idx = (outer_rank == 1 ? "i" : "i,j"); std::string inner_idx = (inner_rank == 1 ? "k" : "k,l"); @@ -433,8 +433,8 @@ BOOST_AUTO_TEST_CASE_TEMPLATE(owner, TestParam, test_params) { BOOST_CHECK_THROW(corr.owner(bad_idx), TiledArray::Exception); } - for (auto idx : corr.range()) { - const auto ordinal = corr.range().ordinal(idx); + for (auto idx : corr.tiles_range()) { + const auto ordinal = corr.tiles_range().ordinal(idx); BOOST_TEST(corr.owner(idx) == corr.pmap()->owner(ordinal)); BOOST_TEST(corr.owner(ordinal) == corr.pmap()->owner(ordinal)); } @@ -468,8 +468,8 @@ BOOST_AUTO_TEST_CASE_TEMPLATE(owner_init_list, TestParam, test_params) { BOOST_CHECK_THROW(corr.owner(il2), except_t); } - for (auto idx : corr.range()) { - const auto ordinal = corr.range().ordinal(idx); + for (auto idx : corr.tiles_range()) { + const auto ordinal = corr.tiles_range().ordinal(idx); const auto owner = corr.pmap()->owner(ordinal); if (rank == 1) { BOOST_TEST(corr.owner({idx[0]}) == owner); @@ -502,8 +502,8 @@ BOOST_AUTO_TEST_CASE_TEMPLATE(is_local, TestParam, test_params) { BOOST_CHECK_THROW(corr.is_local(bad_idx), TiledArray::Exception); } - for (auto idx : corr.range()) { - const auto ordinal = corr.range().ordinal(idx); + for (auto idx : corr.tiles_range()) { + const auto ordinal = corr.tiles_range().ordinal(idx); BOOST_TEST(corr.is_local(idx) == corr.pmap()->is_local(ordinal)); BOOST_TEST(corr.is_local(ordinal) == corr.pmap()->is_local(ordinal)); } @@ -537,8 +537,8 @@ BOOST_AUTO_TEST_CASE_TEMPLATE(is_local_init_list, TestParam, test_params) { BOOST_CHECK_THROW(corr.is_local(il2), except_t); } - for (auto idx : corr.range()) { - const auto ordinal = corr.range().ordinal(idx); + for (auto idx : corr.tiles_range()) { + const auto ordinal = corr.tiles_range().ordinal(idx); const auto is_local = corr.pmap()->is_local(ordinal); if (rank == 1) { BOOST_TEST(corr.is_local({idx[0]}) == is_local); @@ -571,8 +571,8 @@ BOOST_AUTO_TEST_CASE_TEMPLATE(is_zero, TestParam, test_params) { BOOST_CHECK_THROW(corr.is_zero(bad_idx), TiledArray::Exception); } - for (auto idx : corr.range()) { - const auto ordinal = corr.range().ordinal(idx); + for (auto idx : corr.tiles_range()) { + const auto ordinal = corr.tiles_range().ordinal(idx); BOOST_TEST(corr.is_zero(idx) == corr.shape().is_zero(ordinal)); BOOST_TEST(corr.owner(ordinal) == corr.pmap()->owner(ordinal)); } @@ -606,8 +606,8 @@ BOOST_AUTO_TEST_CASE_TEMPLATE(is_zero_init_list, TestParam, test_params) { BOOST_CHECK_THROW(corr.is_zero(il2), except_t); } - for (auto idx : corr.range()) { - const auto ordinal = corr.range().ordinal(idx); + for (auto idx : corr.tiles_range()) { + const auto ordinal = corr.tiles_range().ordinal(idx); const auto is_zero = corr.shape().is_zero(ordinal); if (rank == 1) { BOOST_TEST(corr.is_zero({idx[0]}) == is_zero); diff --git a/tests/tot_expressions.cpp b/tests/tot_expressions.cpp index 1c7feb11b7..c834810065 100644 --- a/tests/tot_expressions.cpp +++ b/tests/tot_expressions.cpp @@ -27,7 +27,7 @@ BOOST_AUTO_TEST_CASE_TEMPLATE(no_perm, TestParam, test_params) { auto& in_rank = std::get<1>(tr_t); auto& t = std::get<2>(tr_t); - std::string out_idx = t.range().rank() == 1 ? "i" : "i, j"; + std::string out_idx = t.tiles_range().rank() == 1 ? "i" : "i, j"; std::string in_idx = in_rank == 1 ? "k" : "k, l"; std::string idx = out_idx + ";" + in_idx; @@ -42,7 +42,7 @@ BOOST_AUTO_TEST_CASE_TEMPLATE(permute_outer, TestParam, test_params) { auto& in_rank = std::get<1>(tr_t); auto& t = std::get<2>(tr_t); - if (t.range().rank() == 1) continue; + if (t.tiles_range().rank() == 1) continue; std::string rhs_out_idx = "i, j"; std::string lhs_out_idx = "j, i"; @@ -52,7 +52,7 @@ BOOST_AUTO_TEST_CASE_TEMPLATE(permute_outer, TestParam, test_params) { tensor_type result; result(lhs_idx) = t(rhs_idx); - for (auto tile_idx : t.range()) { + for (auto tile_idx : t.tiles_range()) { auto rtile = t.find(tile_idx).get(); auto ltile = result.find({tile_idx[1], tile_idx[0]}).get(); for (auto outer_idx : ltile.range()) { @@ -79,13 +79,13 @@ BOOST_AUTO_TEST_CASE_TEMPLATE(permute_inner, TestParam, test_params) { std::string rhs_in_idx = "i, j"; std::string lhs_in_idx = "j, i"; - std::string out_idx = t.range().rank() == 1 ? "k" : "k, l"; + std::string out_idx = t.tiles_range().rank() == 1 ? "k" : "k, l"; std::string rhs_idx = out_idx + ";" + rhs_in_idx; std::string lhs_idx = out_idx + ";" + lhs_in_idx; tensor_type result; result(lhs_idx) = t(rhs_idx); - for (auto tile_idx : t.range()) { + for (auto tile_idx : t.tiles_range()) { auto rtile = t.find(tile_idx).get(); auto ltile = result.find(tile_idx).get(); bool same_outer_range = ltile.range() == rtile.range();