Skip to content

Commit

Permalink
Merge branch 'gh87'
Browse files Browse the repository at this point in the history
  • Loading branch information
kordejong committed Sep 18, 2023
2 parents cfb1c58 + 77ea8dc commit cc21871
Show file tree
Hide file tree
Showing 6 changed files with 75 additions and 42 deletions.
17 changes: 13 additions & 4 deletions .github/workflows/linux.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
name: Linux CI

on: [push]
on:
push:
branches-ignore:
- "ghxyz"
paths:
- ".github/workflows/linux.yml"
- "environment/cmake/**"
- "source/**"

jobs:
build:
Expand All @@ -9,8 +16,10 @@ jobs:
matrix:
os: ["ubuntu-22.04"]
compiler:
- {version: 11, cc: gcc-11, cxx: g++-11}
- {version: 12, cc: clang-12, cxx: clang++-12}
- {version: 9, cc: gcc-9, cxx: g++-9}
- {version: 12, cc: gcc-12, cxx: g++-12}
- {version: 11, cc: clang-11, cxx: clang++-11}
- {version: 14, cc: clang-14, cxx: clang++-14}
fail-fast: false

runs-on: ${{ matrix.os }}
Expand All @@ -20,7 +29,7 @@ jobs:
steps:

- name: checkout fern
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
submodules: recursive

Expand Down
11 changes: 9 additions & 2 deletions .github/workflows/macos.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
name: macOS CI

on: [push]
on:
push:
branches-ignore:
- "ghxyz"
paths:
- ".github/workflows/macos.yml"
- "environment/cmake/**"
- "source/**"

jobs:
build:
Expand All @@ -17,7 +24,7 @@ jobs:
steps:

- name: checkout fern
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
submodules: recursive

Expand Down
23 changes: 20 additions & 3 deletions .github/workflows/windows.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
name: Windows CI

on: [push]
on:
push:
branches-ignore:
- "ghxyz"
paths:
- ".github/workflows/windows.yml"
- "environment/cmake/**"
- "source/**"

jobs:
build:
Expand All @@ -17,14 +24,24 @@ jobs:
steps:

- name: checkout fern
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
submodules: recursive

# TODO Install Boost
- name: Install boost
uses: MarkusJx/[email protected]
id: install-boost
with:
# https://github.com/MarkusJx/prebuilt-boost/blob/main/versions-manifest.json
boost_version: 1.78.0
platform_version: 2022
toolset: msvc
link: shared

- name: configure fern
shell: bash -l {0}
env:
Boost_ROOT: ${{ steps.install-boost.outputs.BOOST_ROOT }}
run: |
mkdir build
cmake \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ struct within_range<

inline static constexpr bool calculate(
Value const& value,
Result const& result)
[[maybe_unused]] Result const& result)
{
// Calculate the result as if the argument was a floating point and
// compare the results.
Expand Down
60 changes: 30 additions & 30 deletions source/fern/algorithm/convolution/detail/convolve.h
Original file line number Diff line number Diff line change
Expand Up @@ -127,8 +127,8 @@ struct ConvolveNorthWestCorner
size_t first_col_kernel;
size_t nr_rows_kernel{radius_ + 1};
size_t nr_cols_kernel;
size_t nr_rows_outside_of_image{radius_};
size_t nr_cols_outside_of_image;
// size_t nr_rows_outside_of_image{radius_};
// size_t nr_cols_outside_of_image;

using V = value_type<SourceImage>;
using SV = accumulate_type<V>;
Expand All @@ -155,7 +155,7 @@ struct ConvolveNorthWestCorner

first_col_kernel = radius_;
nr_cols_kernel = radius_ + 1;
nr_cols_outside_of_image = radius_;
// nr_cols_outside_of_image = radius_;

index_ = index(source, row_source, 0);

Expand Down Expand Up @@ -273,13 +273,13 @@ struct ConvolveNorthWestCorner

--first_col_kernel;
++nr_cols_kernel;
--nr_cols_outside_of_image;
// --nr_cols_outside_of_image;
++index_;
}

--first_row_kernel;
++nr_rows_kernel;
--nr_rows_outside_of_image;
// --nr_rows_outside_of_image;
}
}

Expand Down Expand Up @@ -315,8 +315,8 @@ struct ConvolveNorthEastCorner
size_t const first_col_kernel{0};
size_t nr_rows_kernel{radius_ + 1};
size_t nr_cols_kernel;
size_t nr_rows_outside_of_image{radius_};
size_t nr_cols_outside_of_image;
// size_t nr_rows_outside_of_image{radius_};
// size_t nr_cols_outside_of_image;

using V = value_type<SourceImage>;
using SV = accumulate_type<V>;
Expand All @@ -343,7 +343,7 @@ struct ConvolveNorthEastCorner

first_col_source = nr_cols_source - radius_ - radius_;
nr_cols_kernel = radius_ + radius_;
nr_cols_outside_of_image = 1;
// nr_cols_outside_of_image = 1;

index_ = index(source, row_source, nr_cols_source - radius_);

Expand Down Expand Up @@ -452,13 +452,13 @@ struct ConvolveNorthEastCorner

++first_col_source;
--nr_cols_kernel;
++nr_cols_outside_of_image;
// ++nr_cols_outside_of_image;
++index_;
}

--first_row_kernel;
++nr_rows_kernel;
--nr_rows_outside_of_image;
// --nr_rows_outside_of_image;
}
}

Expand Down Expand Up @@ -494,8 +494,8 @@ struct ConvolveSouthWestCorner
size_t first_col_kernel;
size_t nr_rows_kernel = radius_ + radius_;
size_t nr_cols_kernel;
size_t nr_rows_outside_of_image{0};
size_t nr_cols_outside_of_image;
// size_t nr_rows_outside_of_image{0};
// size_t nr_cols_outside_of_image;

using V = value_type<SourceImage>;
using SV = accumulate_type<V>;
Expand Down Expand Up @@ -523,7 +523,7 @@ struct ConvolveSouthWestCorner

first_col_kernel = radius_;
nr_cols_kernel = radius_ + 1;
nr_cols_outside_of_image = radius_;
// nr_cols_outside_of_image = radius_;

index_ = index(source, row_source, 0);

Expand Down Expand Up @@ -632,13 +632,13 @@ struct ConvolveSouthWestCorner

--first_col_kernel;
++nr_cols_kernel;
--nr_cols_outside_of_image;
// --nr_cols_outside_of_image;
++index_;
}

++first_row_source;
--nr_rows_kernel;
++nr_rows_outside_of_image;
// ++nr_rows_outside_of_image;
}
}

Expand Down Expand Up @@ -675,8 +675,8 @@ struct ConvolveSouthEastCorner
size_t const first_col_kernel{0};
size_t nr_rows_kernel = radius_ + radius_;
size_t nr_cols_kernel;
size_t nr_rows_outside_of_image{0};
size_t nr_cols_outside_of_image;
// size_t nr_rows_outside_of_image{0};
// size_t nr_cols_outside_of_image;

using V = value_type<SourceImage>;
using SV = accumulate_type<V>;
Expand Down Expand Up @@ -704,7 +704,7 @@ struct ConvolveSouthEastCorner

first_col_source = nr_cols_source - radius_ - radius_;
nr_cols_kernel = radius_ + radius_;
nr_cols_outside_of_image = 1;
// nr_cols_outside_of_image = 1;

index_ = index(source, row_source, nr_cols_source - radius_);

Expand Down Expand Up @@ -814,13 +814,13 @@ struct ConvolveSouthEastCorner

++first_col_source;
--nr_cols_kernel;
++nr_cols_outside_of_image;
// ++nr_cols_outside_of_image;
++index_;
}

++first_row_source;
--nr_rows_kernel;
++nr_rows_outside_of_image;
// ++nr_rows_outside_of_image;
}
}

Expand Down Expand Up @@ -856,7 +856,7 @@ struct ConvolveNorthSide
size_t const first_col_kernel{0};
size_t nr_rows_kernel{radius_ + 1};
size_t const nr_cols_kernel{width(kernel)};
size_t nr_rows_outside_of_image{radius_};
// size_t nr_rows_outside_of_image{radius_};

using V = value_type<SourceImage>;
using SV = accumulate_type<V>;
Expand Down Expand Up @@ -997,7 +997,7 @@ struct ConvolveNorthSide

--first_row_kernel;
++nr_rows_kernel;
--nr_rows_outside_of_image;
// --nr_rows_outside_of_image;
}
}

Expand Down Expand Up @@ -1033,7 +1033,7 @@ struct ConvolveWestSide
size_t first_col_kernel;
size_t const nr_rows_kernel{height(kernel)};
size_t nr_cols_kernel;
size_t nr_cols_outside_of_image;
// size_t nr_cols_outside_of_image;

using V = value_type<SourceImage>;
using SV = accumulate_type<V>;
Expand Down Expand Up @@ -1061,7 +1061,7 @@ struct ConvolveWestSide

first_col_kernel = radius_;
nr_cols_kernel = radius_ + 1;
nr_cols_outside_of_image = radius_;
// nr_cols_outside_of_image = radius_;

index_ = index(source, row_source, 0);

Expand Down Expand Up @@ -1172,7 +1172,7 @@ struct ConvolveWestSide

--first_col_kernel;
++nr_cols_kernel;
--nr_cols_outside_of_image;
// --nr_cols_outside_of_image;
++index_;
}

Expand Down Expand Up @@ -1213,7 +1213,7 @@ struct ConvolveEastSide
size_t const first_col_kernel{0};
size_t const nr_rows_kernel{height(kernel)};
size_t nr_cols_kernel;
size_t nr_cols_outside_of_image;
// size_t nr_cols_outside_of_image;

using V = value_type<SourceImage>;
using SV = accumulate_type<V>;
Expand Down Expand Up @@ -1241,7 +1241,7 @@ struct ConvolveEastSide

first_col_source = nr_cols_source - radius_ - radius_;
nr_cols_kernel = radius_ + radius_;
nr_cols_outside_of_image = 1;
// nr_cols_outside_of_image = 1;

index_ = index(source, row_source, nr_cols_source - radius_);

Expand Down Expand Up @@ -1354,7 +1354,7 @@ struct ConvolveEastSide

++first_col_source;
--nr_cols_kernel;
++nr_cols_outside_of_image;
// ++nr_cols_outside_of_image;
++index_;
}

Expand Down Expand Up @@ -1395,7 +1395,7 @@ struct ConvolveSouthSide
size_t const first_col_kernel{0};
size_t nr_rows_kernel{radius_ + radius_};
size_t const nr_cols_kernel{width(kernel)};
size_t nr_rows_outside_of_image{1};
// size_t nr_rows_outside_of_image{1};

using V = value_type<SourceImage>;
using SV = accumulate_type<V>;
Expand Down Expand Up @@ -1538,7 +1538,7 @@ struct ConvolveSouthSide
// --first_row_kernel;
++first_row_source;
--nr_rows_kernel;
++nr_rows_outside_of_image;
// ++nr_rows_outside_of_image;
}
}

Expand Down
4 changes: 2 additions & 2 deletions source/fern/core/data_customization_point/scalar.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,15 @@ namespace fern {
#define CONSTANT_CUSTOMIZATION_POINT( \
T) \
template<> \
inline typename DataTypeTraits<T>::const_reference get( \
inline typename DataTypeTraits<T>::const_reference get<T>( \
typename DataTypeTraits<T>::value_type const& constant) \
{ \
return constant; \
} \
\
\
template<> \
inline typename DataTypeTraits<T>::reference get( \
inline typename DataTypeTraits<T>::reference get<T>( \
typename DataTypeTraits<T>::value_type& constant) \
{ \
return constant; \
Expand Down

0 comments on commit cc21871

Please sign in to comment.