-
Notifications
You must be signed in to change notification settings - Fork 34
Add warning as error to release build Gitlab CI jobs #1918
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
bmhan12
wants to merge
8
commits into
develop
Choose a base branch
from
feature/han12/more_werror
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
74103ec
Enable -Werror for all dane jobs
bmhan12 bce1294
Changes for release -Werror
bmhan12 ab72f19
Cleanup comments
bmhan12 a677368
Reducing changes
bmhan12 5995d70
Merge branch 'develop' into feature/han12/more_werror
bmhan12 d9e1f3e
Make debug build explicit
bmhan12 2e1e1a3
Merge branch 'develop' into feature/han12/more_werror
bmhan12 9db0d5b
Merge branch 'develop' into feature/han12/more_werror
bmhan12 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -33,6 +33,11 @@ namespace mint | |
| { | ||
| namespace internal | ||
| { | ||
| constexpr int STRUCTURED_CELL_NODES_1D = 2; | ||
| constexpr int STRUCTURED_CELL_NODES_2D = 4; | ||
| constexpr int STRUCTURED_CELL_NODES_3D = 8; | ||
| constexpr int STRUCTURED_MAX_CELL_NODES = STRUCTURED_CELL_NODES_3D; | ||
|
|
||
| //------------------------------------------------------------------------------ | ||
| template <typename ExecPolicy, typename KernelType> | ||
| inline void for_all_cells_impl(xargs::index, const Mesh& m, KernelType&& kernel) | ||
|
|
@@ -122,16 +127,15 @@ inline void for_all_cells_impl(xargs::nodeids, const StructuredMesh& m, KernelTy | |
| const IndexType nodeKp = m.nodeKp(); | ||
| const StackArray<IndexType, 8>& offsets = m.getCellNodeOffsetsArray(); | ||
|
|
||
| // Note: gcc@10.3.1 emits a '-Warray-bounds' warning in callers of this function | ||
| // about the sizes of nodeIds and coords not matching due to the runtime switch on dimension | ||
|
|
||
| if(dimension == 1) | ||
| { | ||
| for_all_cells_impl<ExecPolicy>( | ||
| xargs::index(), | ||
| m, | ||
| AXOM_LAMBDA(IndexType cellID) { | ||
| IndexType cell_connectivity[2] = {cellID, cellID + 1}; | ||
| IndexType cell_connectivity[STRUCTURED_MAX_CELL_NODES] = {0}; | ||
| cell_connectivity[0] = cellID; | ||
| cell_connectivity[1] = cellID + 1; | ||
| kernel(cellID, cell_connectivity, 2); | ||
| }); | ||
| } | ||
|
|
@@ -142,7 +146,7 @@ inline void for_all_cells_impl(xargs::nodeids, const StructuredMesh& m, KernelTy | |
| m, | ||
| AXOM_LAMBDA(IndexType cellID, IndexType i, IndexType j) { | ||
| const IndexType n0 = i + j * nodeJp; | ||
| IndexType cell_connectivity[4]; | ||
| IndexType cell_connectivity[STRUCTURED_MAX_CELL_NODES] = {0}; | ||
|
|
||
| for(int ii = 0; ii < 4; ++ii) | ||
| { | ||
|
|
@@ -161,7 +165,7 @@ inline void for_all_cells_impl(xargs::nodeids, const StructuredMesh& m, KernelTy | |
| m, | ||
| AXOM_LAMBDA(IndexType cellID, IndexType i, IndexType j, IndexType k) { | ||
| const IndexType n0 = i + j * nodeJp + k * nodeKp; | ||
| IndexType cell_connectivity[8]; | ||
| IndexType cell_connectivity[STRUCTURED_MAX_CELL_NODES] = {0}; | ||
|
|
||
| for(int ii = 0; ii < 8; ++ii) | ||
| { | ||
|
|
@@ -421,17 +425,18 @@ inline void for_all_cells_impl(xargs::coords, const UniformMesh& m, KernelType&& | |
| const double z0 = origin[2]; | ||
| const double dz = spacing[2]; | ||
|
|
||
| // Note: gcc@10.3.1 emits a '-Warray-bounds' warning in callers of this function | ||
| // about the sizes of nodeIds and coords not matching due to the runtime switch on dimension | ||
|
Comment on lines
-424
to
-425
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is the primary issue these |
||
|
|
||
| if(dimension == 1) | ||
| { | ||
| for_all_cells_impl<ExecPolicy>( | ||
| xargs::index(), | ||
| m, | ||
| AXOM_LAMBDA(IndexType cellID) { | ||
| const IndexType nodeIDs[2] = {cellID, cellID + 1}; | ||
| double coords[2] = {x0 + nodeIDs[0] * dx, x0 + nodeIDs[1] * dx}; | ||
| IndexType nodeIDs[STRUCTURED_MAX_CELL_NODES] = {0}; | ||
| nodeIDs[0] = cellID; | ||
| nodeIDs[1] = cellID + 1; | ||
| double coords[3 * STRUCTURED_MAX_CELL_NODES] = {0.}; | ||
| coords[0] = x0 + nodeIDs[0] * dx; | ||
| coords[1] = x0 + nodeIDs[1] * dx; | ||
|
|
||
| numerics::Matrix<double> coordsMatrix(dimension, 2, coords, NO_COPY); | ||
| kernel(cellID, coordsMatrix, nodeIDs); | ||
|
|
@@ -444,16 +449,21 @@ inline void for_all_cells_impl(xargs::coords, const UniformMesh& m, KernelType&& | |
| m, | ||
| AXOM_LAMBDA(IndexType cellID, IndexType i, IndexType j) { | ||
| const IndexType n0 = i + j * nodeJp; | ||
| const IndexType nodeIDs[4] = {n0, n0 + 1, n0 + 1 + nodeJp, n0 + nodeJp}; | ||
|
|
||
| double coords[8] = {x0 + i * dx, | ||
| y0 + j * dy, | ||
| x0 + (i + 1) * dx, | ||
| y0 + j * dy, | ||
| x0 + (i + 1) * dx, | ||
| y0 + (j + 1) * dy, | ||
| x0 + i * dx, | ||
| y0 + (j + 1) * dy}; | ||
| IndexType nodeIDs[STRUCTURED_MAX_CELL_NODES] = {0}; | ||
| nodeIDs[0] = n0; | ||
| nodeIDs[1] = n0 + 1; | ||
| nodeIDs[2] = n0 + 1 + nodeJp; | ||
| nodeIDs[3] = n0 + nodeJp; | ||
|
|
||
| double coords[3 * STRUCTURED_MAX_CELL_NODES] = {0.}; | ||
| coords[0] = x0 + i * dx; | ||
| coords[1] = y0 + j * dy; | ||
| coords[2] = x0 + (i + 1) * dx; | ||
| coords[3] = y0 + j * dy; | ||
| coords[4] = x0 + (i + 1) * dx; | ||
| coords[5] = y0 + (j + 1) * dy; | ||
| coords[6] = x0 + i * dx; | ||
| coords[7] = y0 + (j + 1) * dy; | ||
|
|
||
| numerics::Matrix<double> coordsMatrix(dimension, 4, coords, NO_COPY); | ||
| kernel(cellID, coordsMatrix, nodeIDs); | ||
|
|
@@ -467,16 +477,17 @@ inline void for_all_cells_impl(xargs::coords, const UniformMesh& m, KernelType&& | |
| m, | ||
| AXOM_LAMBDA(IndexType cellID, IndexType i, IndexType j, IndexType k) { | ||
| const IndexType n0 = i + j * nodeJp + k * nodeKp; | ||
| const IndexType nodeIDs[8] = {n0, | ||
| n0 + 1, | ||
| n0 + 1 + nodeJp, | ||
| n0 + nodeJp, | ||
| n0 + nodeKp, | ||
| n0 + 1 + nodeKp, | ||
| n0 + 1 + nodeJp + nodeKp, | ||
| n0 + nodeJp + nodeKp}; | ||
|
|
||
| double coords[24] = { | ||
| IndexType nodeIDs[STRUCTURED_MAX_CELL_NODES] = {0}; | ||
| nodeIDs[0] = n0; | ||
| nodeIDs[1] = n0 + 1; | ||
| nodeIDs[2] = n0 + 1 + nodeJp; | ||
| nodeIDs[3] = n0 + nodeJp; | ||
| nodeIDs[4] = n0 + nodeKp; | ||
| nodeIDs[5] = n0 + 1 + nodeKp; | ||
| nodeIDs[6] = n0 + 1 + nodeJp + nodeKp; | ||
| nodeIDs[7] = n0 + nodeJp + nodeKp; | ||
|
|
||
| double coords[3 * STRUCTURED_MAX_CELL_NODES] = { | ||
| x0 + i * dx, y0 + j * dy, z0 + k * dz, x0 + (i + 1) * dx, | ||
| y0 + j * dy, z0 + k * dz, x0 + (i + 1) * dx, y0 + (j + 1) * dy, | ||
| z0 + k * dz, x0 + i * dx, y0 + (j + 1) * dy, z0 + k * dz, | ||
|
|
@@ -518,8 +529,12 @@ inline void for_all_cells_impl(xargs::coords, const RectilinearMesh& m, KernelTy | |
| xargs::index(), | ||
| m, | ||
| AXOM_LAMBDA(IndexType cellID) { | ||
| const IndexType nodeIDs[2] = {cellID, cellID + 1}; | ||
| double coords[2] = {x_vals_view[nodeIDs[0]], x_vals_view[nodeIDs[1]]}; | ||
| IndexType nodeIDs[STRUCTURED_MAX_CELL_NODES] = {0}; | ||
| nodeIDs[0] = cellID; | ||
| nodeIDs[1] = cellID + 1; | ||
| double coords[3 * STRUCTURED_MAX_CELL_NODES] = {0.}; | ||
| coords[0] = x_vals_view[nodeIDs[0]]; | ||
| coords[1] = x_vals_view[nodeIDs[1]]; | ||
|
|
||
| numerics::Matrix<double> coordsMatrix(dimension, 2, coords, NO_COPY); | ||
| kernel(cellID, coordsMatrix, nodeIDs); | ||
|
|
@@ -541,16 +556,21 @@ inline void for_all_cells_impl(xargs::coords, const RectilinearMesh& m, KernelTy | |
| m, | ||
| AXOM_LAMBDA(IndexType cellID, IndexType i, IndexType j) { | ||
| const IndexType n0 = i + j * nodeJp; | ||
| const IndexType nodeIDs[4] = {n0, n0 + 1, n0 + 1 + nodeJp, n0 + nodeJp}; | ||
|
|
||
| double coords[8] = {x_vals_view[i], | ||
| y_vals_view[j], | ||
| x_vals_view[i + 1], | ||
| y_vals_view[j], | ||
| x_vals_view[i + 1], | ||
| y_vals_view[j + 1], | ||
| x_vals_view[i], | ||
| y_vals_view[j + 1]}; | ||
| IndexType nodeIDs[STRUCTURED_MAX_CELL_NODES] = {0}; | ||
| nodeIDs[0] = n0; | ||
| nodeIDs[1] = n0 + 1; | ||
| nodeIDs[2] = n0 + 1 + nodeJp; | ||
| nodeIDs[3] = n0 + nodeJp; | ||
|
|
||
| double coords[3 * STRUCTURED_MAX_CELL_NODES] = {0.}; | ||
| coords[0] = x_vals_view[i]; | ||
| coords[1] = y_vals_view[j]; | ||
| coords[2] = x_vals_view[i + 1]; | ||
| coords[3] = y_vals_view[j]; | ||
| coords[4] = x_vals_view[i + 1]; | ||
| coords[5] = y_vals_view[j + 1]; | ||
| coords[6] = x_vals_view[i]; | ||
| coords[7] = y_vals_view[j + 1]; | ||
|
|
||
| numerics::Matrix<double> coordsMatrix(dimension, 4, coords, NO_COPY); | ||
| kernel(cellID, coordsMatrix, nodeIDs); | ||
|
|
@@ -580,16 +600,17 @@ inline void for_all_cells_impl(xargs::coords, const RectilinearMesh& m, KernelTy | |
| m, | ||
| AXOM_LAMBDA(IndexType cellID, IndexType i, IndexType j, IndexType k) { | ||
| const IndexType n0 = i + j * nodeJp + k * nodeKp; | ||
| const IndexType nodeIDs[8] = {n0, | ||
| n0 + 1, | ||
| n0 + 1 + nodeJp, | ||
| n0 + nodeJp, | ||
| n0 + nodeKp, | ||
| n0 + 1 + nodeKp, | ||
| n0 + 1 + nodeJp + nodeKp, | ||
| n0 + nodeJp + nodeKp}; | ||
|
|
||
| double coords[24] = { | ||
| IndexType nodeIDs[STRUCTURED_MAX_CELL_NODES] = {0}; | ||
| nodeIDs[0] = n0; | ||
| nodeIDs[1] = n0 + 1; | ||
| nodeIDs[2] = n0 + 1 + nodeJp; | ||
| nodeIDs[3] = n0 + nodeJp; | ||
| nodeIDs[4] = n0 + nodeKp; | ||
| nodeIDs[5] = n0 + 1 + nodeKp; | ||
| nodeIDs[6] = n0 + 1 + nodeJp + nodeKp; | ||
| nodeIDs[7] = n0 + nodeJp + nodeKp; | ||
|
|
||
| double coords[3 * STRUCTURED_MAX_CELL_NODES] = { | ||
| x_vals_view[i], y_vals_view[j], z_vals_view[k], x_vals_view[i + 1], | ||
| y_vals_view[j], z_vals_view[k], x_vals_view[i + 1], y_vals_view[j + 1], | ||
| z_vals_view[k], x_vals_view[i], y_vals_view[j + 1], z_vals_view[k], | ||
|
|
@@ -625,21 +646,24 @@ inline void for_all_cells_impl(xargs::coords, const CurvilinearMesh& m, KernelTy | |
| const int dimension = m.getDimension(); | ||
| if(dimension == 1) | ||
| { | ||
| for_all_coords<ExecPolicy, 1, 2>(for_all_cell_nodes_functor(), | ||
| m, | ||
| std::forward<KernelType>(kernel)); | ||
| for_all_coords<ExecPolicy, 1, STRUCTURED_CELL_NODES_1D, STRUCTURED_MAX_CELL_NODES>( | ||
| for_all_cell_nodes_functor(), | ||
| m, | ||
| std::forward<KernelType>(kernel)); | ||
| } | ||
| else if(dimension == 2) | ||
| { | ||
| for_all_coords<ExecPolicy, 2, 4>(for_all_cell_nodes_functor(), | ||
| m, | ||
| std::forward<KernelType>(kernel)); | ||
| for_all_coords<ExecPolicy, 2, STRUCTURED_CELL_NODES_2D, STRUCTURED_MAX_CELL_NODES>( | ||
| for_all_cell_nodes_functor(), | ||
| m, | ||
| std::forward<KernelType>(kernel)); | ||
| } | ||
| else | ||
| { | ||
| for_all_coords<ExecPolicy, 3, 8>(for_all_cell_nodes_functor(), | ||
| m, | ||
| std::forward<KernelType>(kernel)); | ||
| for_all_coords<ExecPolicy, 3, STRUCTURED_CELL_NODES_3D, STRUCTURED_MAX_CELL_NODES>( | ||
| for_all_cell_nodes_functor(), | ||
| m, | ||
| std::forward<KernelType>(kernel)); | ||
| } | ||
| } | ||
|
|
||
|
|
@@ -669,7 +693,9 @@ inline void for_all_cells_impl(xargs::coords, const UnstructuredMesh<TOPO>& m, K | |
| xargs::nodeids(), | ||
| m, | ||
| AXOM_LAMBDA(IndexType cellID, const IndexType* nodeIDs, IndexType AXOM_UNUSED_PARAM(numNodes)) { | ||
| double coords[2] = {x_vals_view[nodeIDs[0]], x_vals_view[nodeIDs[1]]}; | ||
| double coords[3 * MAX_CELL_NODES] = {0.}; | ||
| coords[0] = x_vals_view[nodeIDs[0]]; | ||
| coords[1] = x_vals_view[nodeIDs[1]]; | ||
|
|
||
| numerics::Matrix<double> coordsMatrix(dimension, 2, coords, NO_COPY); | ||
| kernel(cellID, coordsMatrix, nodeIDs); | ||
|
|
@@ -690,7 +716,7 @@ inline void for_all_cells_impl(xargs::coords, const UnstructuredMesh<TOPO>& m, K | |
| xargs::nodeids(), | ||
| m, | ||
| AXOM_LAMBDA(IndexType cellID, const IndexType* nodeIDs, IndexType numNodes) { | ||
| double coords[2 * MAX_CELL_NODES]; | ||
| double coords[3 * MAX_CELL_NODES] = {0.}; | ||
| for(int i = 0; i < numNodes; ++i) | ||
| { | ||
| const IndexType nodeID = nodeIDs[i]; | ||
|
|
@@ -725,7 +751,7 @@ inline void for_all_cells_impl(xargs::coords, const UnstructuredMesh<TOPO>& m, K | |
| xargs::nodeids(), | ||
| m, | ||
| AXOM_LAMBDA(IndexType cellID, const IndexType* nodeIDs, IndexType numNodes) { | ||
| double coords[3 * MAX_CELL_NODES]; | ||
| double coords[3 * MAX_CELL_NODES] = {0.}; | ||
| for(int i = 0; i < numNodes; ++i) | ||
| { | ||
| const IndexType nodeID = nodeIDs[i]; | ||
|
|
||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.