Skip to content

Commit

Permalink
avoid some Wshadow warnings. Delete some unused files
Browse files Browse the repository at this point in the history
  • Loading branch information
rrsettgast committed Oct 21, 2023
1 parent 96fae8d commit 46153d1
Show file tree
Hide file tree
Showing 8 changed files with 35 additions and 75 deletions.
4 changes: 2 additions & 2 deletions cmake/CMakeBasics.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ endif()

blt_append_custom_compiler_flag( FLAGS_VAR CMAKE_CXX_FLAGS DEFAULT "${OpenMP_CXX_FLAGS}")
blt_append_custom_compiler_flag( FLAGS_VAR CMAKE_CXX_FLAGS
GNU "-Wall -Wextra -Wpedantic -pedantic-errors -Wshadow -Wfloat-equal -Wcast-align -Wcast-qual"
CLANG "-Wall -Wextra -Wpedantic -pedantic-errors -Wshadow -Wfloat-equal -Wcast-align -Wcast-qual"
GNU "-Wpedantic -pedantic-errors -Wshadow -Wfloat-equal -Wcast-align -Wcast-qual"
CLANG "-Wpedantic -pedantic-errors -Wshadow -Wfloat-equal -Wcast-align -Wcast-qual"
)

blt_append_custom_compiler_flag( FLAGS_VAR CMAKE_CXX_FLAGS_DEBUG
Expand Down
28 changes: 0 additions & 28 deletions hostconfigs/LLNL/lassen-base.cmake

This file was deleted.

15 changes: 0 additions & 15 deletions hostconfigs/LLNL/quartz-icc-19.cmake

This file was deleted.

5 changes: 4 additions & 1 deletion src/common/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,10 @@ blt_add_library( NAME common
target_include_directories( common
INTERFACE
$<BUILD_INTERFACE:${CMAKE_BINARY_DIR}/include>
$<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}/src>
$<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}/src> )

target_include_directories( common
SYSTEM INTERFACE
$<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}/tpl/camp/include>
$<BUILD_INTERFACE:${CMAKE_BINARY_DIR}/tpl/camp/include> )

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,9 +119,9 @@ class LagrangeBasis : public SPACING_TYPE< REAL_TYPE, ORDER + 1 >
return executeSequence< numSupportPoints >( [&coord] ( auto const ... a ) constexpr
{
REAL_TYPE const values[ numSupportPoints ] = { valueProductTerm< BF_INDEX, decltype(a)::value >( coord )... };
auto func = [&values] ( auto a, auto ... b ) constexpr
auto func = [&values] ( auto aa, auto ... b ) constexpr
{
constexpr int aVal = decltype(a)::value;
constexpr int aVal = decltype(aa)::value;
return gradientOfValueTerm< BF_INDEX, aVal >() * ( valueProductFactor< decltype(b)::value, aVal >( values ) * ... );
};

Expand Down
8 changes: 4 additions & 4 deletions src/geometry/unitTests/testCube.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ void testConstructionAndSettersHelper()
{
constexpr double h = 3.14;
double * data = nullptr;
pmpl::genericKernelWrapper( 1, data, [] SHIVA_HOST_DEVICE ( double * const data )
pmpl::genericKernelWrapper( 1, data, [] SHIVA_HOST_DEVICE ( double * const kdata )
{
auto cell = makeCube( h );
data[0] = cell.getLength();
kdata[0] = cell.getLength();
} );
EXPECT_EQ( data[0], h );
pmpl::deallocateData( data );
Expand All @@ -45,12 +45,12 @@ void testJacobianFunctionModifyLvalueRefArgHelper()
{
constexpr double h = 3.14;
double * data = nullptr;
pmpl::genericKernelWrapper( 1, data, [] SHIVA_HOST_DEVICE ( double * const data )
pmpl::genericKernelWrapper( 1, data, [] SHIVA_HOST_DEVICE ( double * const kdata )
{
auto cell = makeCube( h );
typename Cube< double >::JacobianType::type J;
jacobian( cell, J );
data[0] = J;
kdata[0] = J;
} );
EXPECT_EQ( data[0], ( h / 2 ) );
pmpl::deallocateData( data );
Expand Down
44 changes: 22 additions & 22 deletions src/geometry/unitTests/testRectangularCuboid.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,13 @@ void testConstructionAndSettersHelper()
{
constexpr double h[3] = { 10, 20, 30 };
double * data = nullptr;
pmpl::genericKernelWrapper( 3, data, [=] SHIVA_HOST_DEVICE ( double * const data )
pmpl::genericKernelWrapper( 3, data, [=] SHIVA_HOST_DEVICE ( double * const kdata )
{
auto cell = makeRectangularCuboid( h );
auto const & constData = cell.getLengths();
data[0] = constData[0];
data[1] = constData[1];
data[2] = constData[2];
kdata[0] = constData[0];
kdata[1] = constData[1];
kdata[2] = constData[2];
} );
EXPECT_EQ( data[0], h[0] );
EXPECT_EQ( data[1], h[1] );
Expand All @@ -48,15 +48,15 @@ void testJacobianFunctionModifyLvalueRefArgHelper()
{
constexpr double h[3] = { 10, 20, 30 };
double * data = nullptr;
pmpl::genericKernelWrapper( 3, data, [=] SHIVA_HOST_DEVICE ( double * const data )
pmpl::genericKernelWrapper( 3, data, [=] SHIVA_HOST_DEVICE ( double * const kdata )
{
auto cell = makeRectangularCuboid( h );

typename std::remove_reference_t< decltype(cell) >::JacobianType::type J;
jacobian( cell, J );
data[0] = J[0];
data[1] = J[1];
data[2] = J[2];
kdata[0] = J[0];
kdata[1] = J[1];
kdata[2] = J[2];
} );
EXPECT_EQ( data[0], ( h[0] / 2 ) );
EXPECT_EQ( data[1], ( h[1] / 2 ) );
Expand All @@ -74,14 +74,14 @@ void testJacobianFunctionReturnByValueHelper()
{
constexpr double h[3] = { 10, 20, 30 };
double * data = nullptr;
pmpl::genericKernelWrapper( 3, data, [=] SHIVA_HOST_DEVICE ( double * const data )
pmpl::genericKernelWrapper( 3, data, [=] SHIVA_HOST_DEVICE ( double * const kdata )
{
auto cell = makeRectangularCuboid( h );

auto J = jacobian( cell );
data[0] = J[0];
data[1] = J[1];
data[2] = J[2];
kdata[0] = J[0];
kdata[1] = J[1];
kdata[2] = J[2];
} );
EXPECT_EQ( data[0], ( h[0] / 2 ) );
EXPECT_EQ( data[1], ( h[1] / 2 ) );
Expand All @@ -98,17 +98,17 @@ void testInvJacobianFunctionModifyLvalueRefArgHelper()
{
constexpr double h[3] = { 10, 20, 30 };
double * data = nullptr;
pmpl::genericKernelWrapper( 4, data, [=] SHIVA_HOST_DEVICE ( double * const data )
pmpl::genericKernelWrapper( 4, data, [=] SHIVA_HOST_DEVICE ( double * const kdata )
{
auto cell = makeRectangularCuboid( h );

typename std::remove_reference_t< decltype(cell) >::JacobianType::type invJ;
double detJ;
inverseJacobian( cell, invJ, detJ );
data[0] = detJ;
data[1] = invJ[0];
data[2] = invJ[1];
data[3] = invJ[2];
kdata[0] = detJ;
kdata[1] = invJ[0];
kdata[2] = invJ[1];
kdata[3] = invJ[2];
} );
EXPECT_EQ( data[0], 0.125 * h[0] * h[1] * h[2] );
EXPECT_EQ( data[1], ( 2 / h[0] ) );
Expand All @@ -126,15 +126,15 @@ void testInvJacobianFunctionReturnByValueHelper()
{
constexpr double h[3] = { 10, 20, 30 };
double * data = nullptr;
pmpl::genericKernelWrapper( 4, data, [=] SHIVA_HOST_DEVICE ( double * const data )
pmpl::genericKernelWrapper( 4, data, [=] SHIVA_HOST_DEVICE ( double * const kdata )
{
auto cell = makeRectangularCuboid( h );

auto [ detJ, invJ ] = inverseJacobian( cell );
data[0] = detJ;
data[1] = invJ[0];
data[2] = invJ[1];
data[3] = invJ[2];
kdata[0] = detJ;
kdata[1] = invJ[0];
kdata[2] = invJ[1];
kdata[3] = invJ[2];
} );
EXPECT_EQ( data[0], 0.125 * h[0] * h[1] * h[2] );
EXPECT_EQ( data[1], ( 2 / h[0] ) );
Expand Down
2 changes: 1 addition & 1 deletion tpl/camp

0 comments on commit 46153d1

Please sign in to comment.