Skip to content

Commit

Permalink
Minor fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
BrendanKKrueger committed Aug 28, 2024
1 parent cd5c492 commit 19ac3d4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
1 change: 1 addition & 0 deletions ports-of-call/array.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
#define _PORTS_OF_CALL_ARRAY_HPP_

#include "portability.hpp"
#include "portable_errors.hpp"

#include <cstddef>
#include <iterator>
Expand Down
8 changes: 4 additions & 4 deletions test/test_array.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@ TEST_CASE("array nominal element access (GPU)", "[array][GPU]") {
array<double, N> arr;

int count = 0;
auto func = PORTABLE_LAMBDA(const int i, int & count) {
auto func = PORTABLE_LAMBDA(const int i, int & count) mutable {
// Fill the array
arr[i] = i + 1;
// Can we read from it?
if (arr[i] = i + 1) {
++count;
}
};
PortsOfCall::parallelReduce("assign_and_check", 0, N, func, count);
portableReduce("assign_and_check", 0, N, func, count);
CHECK(count == N);
}

Expand Down Expand Up @@ -198,7 +198,7 @@ TEST_CASE("array sizes", "[array]") {
TEST_CASE("array fill (GPU)", "[array][GPU]") {
constexpr std::size_t N = 42;
std::size_t count = 0;
auto func = PORTABLE_LAMBDA(const int i, int & count) {
auto func = PORTABLE_LAMBDA(const int i, std::size_t & count) {
constexpr double value = 3.14;
array<double, N> arr;
arr.fill(value);
Expand All @@ -207,7 +207,7 @@ TEST_CASE("array fill (GPU)", "[array][GPU]") {
}
};
constexpr std::size_t M = 5;
PortsOfCall::parallelReduce("check", 0, M, func, count);
portableReduce("check", 0, M, func, count);
CHECK(count == N * M);
}

Expand Down

0 comments on commit 19ac3d4

Please sign in to comment.