Skip to content

Commit

Permalink
MSVC: Fix int/size_t mismatches
Browse files Browse the repository at this point in the history
Refs: gh-119
Signed-off-by: Matthias Kretz <kretz@kde.org>
  • Loading branch information
mattkretz committed Sep 20, 2016
1 parent ee3b22d commit 03c1b19
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion examples/linear_find/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ inline std::array<Iterator, V::size()> find_parallel(Iterator first, Iterator la
const auto mask = *first == value && !found;
if (any_of(mask)) {
found |= mask;
for (int i : where(mask)) {
for (std::size_t i : where(mask)) {
matches[i] = first;
}
if (all_of(found)) {
Expand Down
4 changes: 2 additions & 2 deletions examples/matrix/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ inline Matrix<T, N> operator*(const Matrix<T, N> &a, const Matrix<T, N> &b)
// The iteration over the column index of b and c uses a stride of V::size(). This
// enables row-vector loads (from b) and stores (to c). The matrix storage is
// padded accordingly, ensuring correct bounds and alignment.
for (int j = 0; j < NN; j += V::size()) {
for (int j = 0; j < NN; j += int(V::size())) {
// This temporary variables are used to accumulate the results of the products
// producing the new values for the c matrix. This variable is necessary
// because we need a V object for data-parallel accumulation. Storing to c
Expand All @@ -133,7 +133,7 @@ inline Matrix<T, N> operator*(const Matrix<T, N> &a, const Matrix<T, N> &b)
}
}
// This final loop treats the remaining NN - N0 rows.
for (int j = 0; j < NN; j += V::size()) {
for (int j = 0; j < NN; j += int(V::size())) {
V c_ij[UnrollOuterloop];
for (int n = N0; n < NN; ++n) {
c_ij[n - N0] = a[n][0] * V(&b[0][j], Vc::Aligned);
Expand Down

0 comments on commit 03c1b19

Please sign in to comment.