Skip to content

Commit

Permalink
tpetra: workarounds for bad compiler when c++14 is used #8047
Browse files Browse the repository at this point in the history
  • Loading branch information
kddevin committed Sep 22, 2020
1 parent 4562cf8 commit 7dfe7fa
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 5 deletions.
5 changes: 4 additions & 1 deletion packages/tpetra/tsqr/src/Tsqr_FullTsqrTest.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -808,8 +808,11 @@ namespace TSQR {
const ordinal_type numCols =
testParams->get<ordinal_type>("numCols");
const int numTrials = testParams->get<int>("numTrials");
const bool contiguousCacheBlocks =
/* const */ bool contiguousCacheBlocks =
testParams->get<bool>("contiguousCacheBlocks");
// 9/2020 contiguousCacheBlocks should be const, but
// gcc7.2+cuda9 with std=c++14 fails when const is used;
// see https://github.com/trilinos/Trilinos/pull/8047
const bool testFactorExplicit =
testParams->get<bool>("testFactorExplicit");
const bool testRankRevealing =
Expand Down
15 changes: 11 additions & 4 deletions packages/tpetra/tsqr/test/Tsqr_TestNodeTsqr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -428,8 +428,12 @@ namespace TSQR {

bool success = true;

const int nrows = params.numRows;
const int ncols = params.numCols;
/* const */ int nrows = params.numRows;
/* const */ int ncols = params.numCols;
// 9/2020 nrows and ncols should be const, but
// gcc7.2+cuda9 with std=c++14 fails when const is used;
// see https://github.com/trilinos/Trilinos/pull/8047


Matrix<int, Scalar> A(nrows, ncols);
Matrix<int, Scalar> A_copy(nrows, ncols);
Expand Down Expand Up @@ -817,8 +821,11 @@ namespace TSQR {
<< endl;
}
}
const int nrows = params.numRows;
const int ncols = params.numCols;
/* const */ int nrows = params.numRows;
/* const */ int ncols = params.numCols;
// 9/2020 nrows and ncols should be const, but
// gcc7.2+cuda9 with std=c++14 fails when const is used;
// see https://github.com/trilinos/Trilinos/pull/8047

Matrix<int, Scalar> A(nrows, ncols);
Matrix<int, Scalar> A_copy(nrows, ncols);
Expand Down

0 comments on commit 7dfe7fa

Please sign in to comment.