Skip to content

Commit

Permalink
Fix compilation with openMP enabled
Browse files Browse the repository at this point in the history
  • Loading branch information
dirkvdb committed Apr 21, 2023
1 parent 29054a7 commit e581d1e
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions core/include/gdx/maskedraster.h
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ class MaskedRaster
MaskedRaster(const MaskedRaster<T>& other) = delete;
MaskedRaster(MaskedRaster<T>&&) = default;

MaskedRaster& operator=(MaskedRaster<T>&&) = default;
MaskedRaster& operator=(MaskedRaster<T>&&) = default;
MaskedRaster& operator=(const MaskedRaster<T>& other) = delete;

void resize_and_fill(int32_t rows, int32_t cols, value_type value)
Expand Down Expand Up @@ -905,10 +905,10 @@ class MaskedRaster
result.set_nodata(static_cast<double>(std::numeric_limits<uint8_t>::max()));
}

auto pred = BinaryPredicate<T>();
const auto size = result.size();
auto pred = BinaryPredicate<T>();
const int32_t size = static_cast<int32_t>(result.size());
#pragma omp parallel for
for (std::size_t i = 0; i < size; ++i) {
for (int32_t i = 0; i < size; ++i) {
result[i] = pred(_data(i), static_cast<T>(value));
}
return result;
Expand Down Expand Up @@ -937,10 +937,10 @@ class MaskedRaster
result.set_nodata(std::numeric_limits<uint8_t>::max());
}

auto pred = BinaryPredicate<WidestType>();
const auto size = result.size();
auto pred = BinaryPredicate<WidestType>();
const int32_t size = static_cast<int32_t>(result.size());
#pragma omp parallel for
for (std::size_t i = 0; i < size; ++i) {
for (int32_t i = 0; i < size; ++i) {
result[i] = pred(static_cast<WidestType>(_data(i)), static_cast<WidestType>(other[i]));
}
return result;
Expand Down

0 comments on commit e581d1e

Please sign in to comment.