Skip to content

Commit

Permalink
[pnnl#198] using shad::array::iterator; fix build errors on ci
Browse files Browse the repository at this point in the history
  • Loading branch information
NanmiaoWu committed Jun 11, 2021
2 parents 6e3c409 + a066e04 commit 3705490
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 11 deletions.
11 changes: 6 additions & 5 deletions examples/stl_algorithm/array.cc
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@
#include "shad/util/measure.h"

constexpr static size_t kArraySize = 1024;
using iterator = shad::impl::array<int, kArraySize>::array_iterator<int>;
using array_t = shad::impl::array<int, kArraySize>;
using iterator = array_t::iterator;

void shad_generate_algorithm(shad::array<int, kArraySize> &in) {
shad::generate(shad::distributed_parallel_tag{}, in.begin(), in.end(), [=]() {
Expand Down Expand Up @@ -65,9 +66,9 @@ void shad_for_each_algorithm(shad::array<int, kArraySize> &in) {

std::pair<iterator, iterator> shad_minmax_algorithm(
shad::array<int, kArraySize> &in) {
auto [min, max] = shad::minmax_element(shad::distributed_parallel_tag{},
in.begin(), in.end());
return {min, max};
auto res = shad::minmax_element(shad::distributed_parallel_tag{}, in.begin(),
in.end());
return res;
}

void shad_transform_algorithm(shad::array<int, kArraySize> &in) {
Expand Down Expand Up @@ -139,4 +140,4 @@ int main(int argc, char *argv[]) {
return 0;
}

} // namespace shad
} // namespace shad
6 changes: 3 additions & 3 deletions examples/stl_algorithm/unordered_map.cc
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@ using shad_buffered_inserter_t =

std::pair<iterator, iterator> shad_minmax_algorithm(
shad::unordered_map<int, int> &in) {
auto [min, max] = shad::minmax_element(shad::distributed_parallel_tag{},
in.begin(), in.end());
return {min, max};
auto res = shad::minmax_element(shad::distributed_parallel_tag{}, in.begin(),
in.end());
return res;
}

iterator shad_find_if_algorithm(shad::unordered_map<int, int> &in) {
Expand Down
6 changes: 3 additions & 3 deletions examples/stl_algorithm/unordered_set.cc
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@ using shad_buffered_inserter_t =

std::pair<iterator, iterator> shad_minmax_algorithm(
shad::unordered_set<int> &in) {
auto [min, max] = shad::minmax_element(shad::distributed_parallel_tag{},
in.begin(), in.end());
return {min, max};
auto res = shad::minmax_element(shad::distributed_parallel_tag{}, in.begin(),
in.end());
return res;
}

iterator shad_find_if_algorithm(shad::unordered_set<int> &in) {
Expand Down

0 comments on commit 3705490

Please sign in to comment.