Skip to content

Commit

Permalink
fix/update for building with kokkos 3.1, remove deprecated use of old…
Browse files Browse the repository at this point in the history
… Kokkos API
  • Loading branch information
pkestene committed May 27, 2020
1 parent 7bb7258 commit 45aba1b
Show file tree
Hide file tree
Showing 22 changed files with 132 additions and 122 deletions.
12 changes: 6 additions & 6 deletions src/mood/MoodBaseFunctor.h
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,9 @@ class MoodBaseFunctor : public PolynomialEvaluator<dim,degree>
*/
template<int dim_ = dim>
KOKKOS_INLINE_FUNCTION
void computePrimitives(const typename Kokkos::Impl::enable_if<dim_==2, HydroState>::type& u,
void computePrimitives(const typename std::enable_if<dim_==2, HydroState>::type& u,
real_t* c,
typename Kokkos::Impl::enable_if<dim_==2, HydroState>::type& q) const
typename std::enable_if<dim_==2, HydroState>::type& q) const
{
real_t gamma0 = params.settings.gamma0;
real_t smallr = params.settings.smallr;
Expand Down Expand Up @@ -117,9 +117,9 @@ class MoodBaseFunctor : public PolynomialEvaluator<dim,degree>
*/
template<int dim_ = dim>
KOKKOS_INLINE_FUNCTION
void computePrimitives(const typename Kokkos::Impl::enable_if<dim_==3, HydroState>::type& u,
void computePrimitives(const typename std::enable_if<dim_==3, HydroState>::type& u,
real_t* c,
typename Kokkos::Impl::enable_if<dim_==3, HydroState>::type& q) const
typename std::enable_if<dim_==3, HydroState>::type& q) const
{
real_t gamma0 = params.settings.gamma0;
real_t smallr = params.settings.smallr;
Expand Down Expand Up @@ -157,7 +157,7 @@ class MoodBaseFunctor : public PolynomialEvaluator<dim,degree>
*/
template<int dim_ = dim>
KOKKOS_INLINE_FUNCTION
int isValid(const typename Kokkos::Impl::enable_if<dim_==2, HydroState>::type& u) const
int isValid(const typename std::enable_if<dim_==2, HydroState>::type& u) const
{

int isValid_ = 1;
Expand Down Expand Up @@ -189,7 +189,7 @@ class MoodBaseFunctor : public PolynomialEvaluator<dim,degree>
*/
template<int dim_ = dim>
KOKKOS_INLINE_FUNCTION
int isValid(const typename Kokkos::Impl::enable_if<dim_==3, HydroState>::type& u) const
int isValid(const typename std::enable_if<dim_==3, HydroState>::type& u) const
{

int isValid_ = 1;
Expand Down
4 changes: 2 additions & 2 deletions src/mood/MoodDtFunctor.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ namespace mood {
// template<int dim_ = dim>
// KOKKOS_INLINE_FUNCTION
// void operator()(const typename
// Kokkos::Impl::enable_if<dim_==2, int>::type& index,
// std::enable_if<dim_==2, int>::type& index,
// real_t &invDt) const
// {
// const int isize = this->params.isize;
Expand Down Expand Up @@ -97,7 +97,7 @@ namespace mood {
// template<int dim_ = dim>
// KOKKOS_INLINE_FUNCTION
// void operator()(const typename
// Kokkos::Impl::enable_if<dim_==3, int>::type& index,
// std::enable_if<dim_==3, int>::type& index,
// real_t &invDt) const
// {
// const int isize = this->params.isize;
Expand Down
8 changes: 4 additions & 4 deletions src/mood/MoodFluxesFunctors.h
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ class ComputeFluxesFunctor : public MoodBaseFunctor<dim,degree>
//! functor for 2d
template<int dim_ = dim>
KOKKOS_INLINE_FUNCTION
void operator()(const typename Kokkos::Impl::enable_if<dim_==2, int>::type& index) const
void operator()(const typename std::enable_if<dim_==2, int>::type& index) const
{

const int isize = this->params.isize;
Expand Down Expand Up @@ -343,7 +343,7 @@ class ComputeFluxesFunctor : public MoodBaseFunctor<dim,degree>
/************* UNFINISHED - TODO ***************/
template<int dim_ = dim>
KOKKOS_INLINE_FUNCTION
void operator()(const typename Kokkos::Impl::enable_if<dim_==3, int>::type& index) const
void operator()(const typename std::enable_if<dim_==3, int>::type& index) const
{
const int isize = this->params.isize;
const int jsize = this->params.jsize;
Expand Down Expand Up @@ -789,7 +789,7 @@ class RecomputeFluxesFunctor : public MoodBaseFunctor<dim,degree>
//! functor for 2d
template<int dim_ = dim>
KOKKOS_INLINE_FUNCTION
void operator()(const typename Kokkos::Impl::enable_if<dim_==2, int>::type& index) const
void operator()(const typename std::enable_if<dim_==2, int>::type& index) const
{

const int isize = this->params.isize;
Expand Down Expand Up @@ -914,7 +914,7 @@ class RecomputeFluxesFunctor : public MoodBaseFunctor<dim,degree>
//! functor for 3d
template<int dim_ = dim>
KOKKOS_INLINE_FUNCTION
void operator()(const typename Kokkos::Impl::enable_if<dim_==3, int>::type& index) const
void operator()(const typename std::enable_if<dim_==3, int>::type& index) const
{

const int isize = this->params.isize;
Expand Down
24 changes: 12 additions & 12 deletions src/mood/MoodInitFunctors.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ class InitImplodeFunctor : public MoodBaseFunctor<dim,degree>
//! functor for 2d
template<int dim_ = dim>
KOKKOS_INLINE_FUNCTION
void operator()(const typename Kokkos::Impl::enable_if<dim_==2, int>::type& index) const
void operator()(const typename std::enable_if<dim_==2, int>::type& index) const
{

const int isize = this->params.isize;
Expand Down Expand Up @@ -92,7 +92,7 @@ class InitImplodeFunctor : public MoodBaseFunctor<dim,degree>
//! functor for 3d
template<int dim_ = dim>
KOKKOS_INLINE_FUNCTION
void operator()(const typename Kokkos::Impl::enable_if<dim_==3, int>::type& index) const
void operator()(const typename std::enable_if<dim_==3, int>::type& index) const
{

const int isize = this->params.isize;
Expand Down Expand Up @@ -167,7 +167,7 @@ class InitBlastFunctor : public MoodBaseFunctor<dim,degree>
//! functor for 2d
template<int dim_ = dim>
KOKKOS_INLINE_FUNCTION
void operator()(const typename Kokkos::Impl::enable_if<dim_==2, int>::type& index) const
void operator()(const typename std::enable_if<dim_==2, int>::type& index) const
{

const int isize = this->params.isize;
Expand Down Expand Up @@ -221,7 +221,7 @@ class InitBlastFunctor : public MoodBaseFunctor<dim,degree>
//! functor for 3d
template<int dim_ = dim>
KOKKOS_INLINE_FUNCTION
void operator()(const typename Kokkos::Impl::enable_if<dim_==3, int>::type& index) const
void operator()(const typename std::enable_if<dim_==3, int>::type& index) const
{

const int isize = this->params.isize;
Expand Down Expand Up @@ -320,7 +320,7 @@ class InitFourQuadrantFunctor : public MoodBaseFunctor<dim,degree>
//! functor for 2d
template<int dim_ = dim>
KOKKOS_INLINE_FUNCTION
void operator()(const typename Kokkos::Impl::enable_if<dim_==2, int>::type& index) const
void operator()(const typename std::enable_if<dim_==2, int>::type& index) const
{

const int isize = this->params.isize;
Expand Down Expand Up @@ -376,7 +376,7 @@ class InitFourQuadrantFunctor : public MoodBaseFunctor<dim,degree>
//! functor for 3d
template<int dim_ = dim>
KOKKOS_INLINE_FUNCTION
void operator()(const typename Kokkos::Impl::enable_if<dim_==3, int>::type& index) const
void operator()(const typename std::enable_if<dim_==3, int>::type& index) const
{

const int isize = this->params.isize;
Expand Down Expand Up @@ -476,7 +476,7 @@ class InitKelvinHelmholtzFunctor : public MoodBaseFunctor<dim,degree>
//! functor for 2d
template<int dim_ = dim>
KOKKOS_INLINE_FUNCTION
void operator()(const typename Kokkos::Impl::enable_if<dim_==2, int>::type& index) const
void operator()(const typename std::enable_if<dim_==2, int>::type& index) const
{

// get random number state
Expand Down Expand Up @@ -572,7 +572,7 @@ class InitKelvinHelmholtzFunctor : public MoodBaseFunctor<dim,degree>
//! functor for 3d
template<int dim_ = dim>
KOKKOS_INLINE_FUNCTION
void operator()(const typename Kokkos::Impl::enable_if<dim_==3, int>::type& index) const
void operator()(const typename std::enable_if<dim_==3, int>::type& index) const
{

// get random number generator state
Expand Down Expand Up @@ -720,7 +720,7 @@ class InitWedgeFunctor : public MoodBaseFunctor<dim,degree>
//! functor for 2d
template<int dim_ = dim>
KOKKOS_INLINE_FUNCTION
void operator()(const typename Kokkos::Impl::enable_if<dim_==2, int>::type& index) const
void operator()(const typename std::enable_if<dim_==2, int>::type& index) const
{

const int isize = this->params.isize;
Expand Down Expand Up @@ -767,7 +767,7 @@ class InitWedgeFunctor : public MoodBaseFunctor<dim,degree>
//! functor for 3d
template<int dim_ = dim>
KOKKOS_INLINE_FUNCTION
void operator()(const typename Kokkos::Impl::enable_if<dim_==3, int>::type& index) const
void operator()(const typename std::enable_if<dim_==3, int>::type& index) const
{

const int isize = this->params.isize;
Expand Down Expand Up @@ -1057,7 +1057,7 @@ class InitIsentropicVortexFunctor : public MoodBaseFunctor<dim,degree>
//! functor for 2d
template<int dim_ = dim>
KOKKOS_INLINE_FUNCTION
void operator()(const typename Kokkos::Impl::enable_if<dim_==2, int>::type& index) const
void operator()(const typename std::enable_if<dim_==2, int>::type& index) const
{

const int isize = this->params.isize;
Expand Down Expand Up @@ -1094,7 +1094,7 @@ class InitIsentropicVortexFunctor : public MoodBaseFunctor<dim,degree>
//! functor for 3d
template<int dim_ = dim>
KOKKOS_INLINE_FUNCTION
void operator()(const typename Kokkos::Impl::enable_if<dim_==3, int>::type& index) const
void operator()(const typename std::enable_if<dim_==3, int>::type& index) const
{

const int isize = this->params.isize;
Expand Down
12 changes: 6 additions & 6 deletions src/mood/MoodPolynomialReconstructionFunctors.h
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ class ComputeReconstructionPolynomialFunctor : public MoodBaseFunctor<dim,degree
//! functor for 2d
template<int dim_ = dim>
KOKKOS_INLINE_FUNCTION
void operator()(const typename Kokkos::Impl::enable_if<dim_==2, int>::type& index) const
void operator()(const typename std::enable_if<dim_==2, int>::type& index) const
{

const int isize = this->params.isize;
Expand Down Expand Up @@ -118,9 +118,9 @@ class ComputeReconstructionPolynomialFunctor : public MoodBaseFunctor<dim,degree
// retrieve reconstruction polynomial coefficients in current cell
coefs_t coefs_c;
coefs_c[0] = Udata(i,j,ivar);
for (int icoef=0; icoef<mat_pi.dimension_0(); ++icoef) {
for (int icoef=0; icoef<mat_pi.extent(0); ++icoef) {
real_t tmp = 0;
for (int ik=0; ik<mat_pi.dimension_1(); ++ik) {
for (int ik=0; ik<mat_pi.extent(1); ++ik) {
tmp += mat_pi(icoef,ik) * rhs[ik];
}
coefs_c[icoef+1] = tmp;
Expand All @@ -139,7 +139,7 @@ class ComputeReconstructionPolynomialFunctor : public MoodBaseFunctor<dim,degree
//! functor for 3d
template<int dim_ = dim>
KOKKOS_INLINE_FUNCTION
void operator()(const typename Kokkos::Impl::enable_if<dim_==3, int>::type& index) const
void operator()(const typename std::enable_if<dim_==3, int>::type& index) const
{
const int isize = this->params.isize;
const int jsize = this->params.jsize;
Expand Down Expand Up @@ -179,9 +179,9 @@ class ComputeReconstructionPolynomialFunctor : public MoodBaseFunctor<dim,degree
// retrieve reconstruction polynomial coefficients in current cell
coefs_t coefs_c;
coefs_c[0] = Udata(i,j,k,ivar);
for (int icoef=0; icoef<mat_pi.dimension_0(); ++icoef) {
for (int icoef=0; icoef<mat_pi.extent(0); ++icoef) {
real_t tmp = 0;
for (int ik=0; ik<mat_pi.dimension_1(); ++ik) {
for (int ik=0; ik<mat_pi.extent(1); ++ik) {
tmp += mat_pi(icoef,ik) * rhs[ik];
}
coefs_c[icoef+1] = tmp;
Expand Down
4 changes: 2 additions & 2 deletions src/mood/MoodTestReconstruction.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ class TestReconstructionFunctor : public MoodBaseFunctor<dim,degree>
//! functor for 2d
template<int dim_ = dim>
KOKKOS_INLINE_FUNCTION
void operator()(const typename Kokkos::Impl::enable_if<dim_==2, int>::type& index) const
void operator()(const typename std::enable_if<dim_==2, int>::type& index) const
{

const int isize = this->params.isize;
Expand Down Expand Up @@ -209,7 +209,7 @@ class TestReconstructionFunctor : public MoodBaseFunctor<dim,degree>
/************* UNFINISHED - TODO ***************/
template<int dim_ = dim>
KOKKOS_INLINE_FUNCTION
void operator()(const typename Kokkos::Impl::enable_if<dim_==3, int>::type& index) const
void operator()(const typename std::enable_if<dim_==3, int>::type& index) const
{

} // end functor 3d
Expand Down
16 changes: 8 additions & 8 deletions src/mood/MoodUpdateFunctors.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class UpdateFunctor
//! functor for 2d
template<int dim_ = dim>
KOKKOS_INLINE_FUNCTION
void operator()(const typename Kokkos::Impl::enable_if<dim_==2, int>::type& index) const
void operator()(const typename std::enable_if<dim_==2, int>::type& index) const
{
const int isize = params.isize;
const int jsize = params.jsize;
Expand Down Expand Up @@ -96,7 +96,7 @@ class UpdateFunctor
//! functor for 3d
template<int dim_ = dim>
KOKKOS_INLINE_FUNCTION
void operator()(const typename Kokkos::Impl::enable_if<dim_==3, int>::type& index) const
void operator()(const typename std::enable_if<dim_==3, int>::type& index) const
{
const int isize = params.isize;
const int jsize = params.jsize;
Expand Down Expand Up @@ -211,7 +211,7 @@ class UpdateFunctor_ssprk2
//! functor for 2d
template<int dim_ = dim>
KOKKOS_INLINE_FUNCTION
void operator()(const typename Kokkos::Impl::enable_if<dim_==2, int>::type& index) const
void operator()(const typename std::enable_if<dim_==2, int>::type& index) const
{
const int isize = params.isize;
const int jsize = params.jsize;
Expand Down Expand Up @@ -262,7 +262,7 @@ class UpdateFunctor_ssprk2
//! functor for 3d
template<int dim_ = dim>
KOKKOS_INLINE_FUNCTION
void operator()(const typename Kokkos::Impl::enable_if<dim_==3, int>::type& index) const
void operator()(const typename std::enable_if<dim_==3, int>::type& index) const
{
const int isize = params.isize;
const int jsize = params.jsize;
Expand Down Expand Up @@ -384,7 +384,7 @@ class UpdateFunctor_weight
//! functor for 2d
template<int dim_ = dim>
KOKKOS_INLINE_FUNCTION
void operator()(const typename Kokkos::Impl::enable_if<dim_==2, int>::type& index) const
void operator()(const typename std::enable_if<dim_==2, int>::type& index) const
{
const int isize = params.isize;
const int jsize = params.jsize;
Expand Down Expand Up @@ -436,7 +436,7 @@ class UpdateFunctor_weight
//! functor for 3d
template<int dim_ = dim>
KOKKOS_INLINE_FUNCTION
void operator()(const typename Kokkos::Impl::enable_if<dim_==3, int>::type& index) const
void operator()(const typename std::enable_if<dim_==3, int>::type& index) const
{
const int isize = params.isize;
const int jsize = params.jsize;
Expand Down Expand Up @@ -555,7 +555,7 @@ class ComputeMoodFlagsUpdateFunctor : public MoodBaseFunctor<dim,degree>
//! functor for 2d
template<int dim_ = dim>
KOKKOS_INLINE_FUNCTION
void operator()(const typename Kokkos::Impl::enable_if<dim_==2, int>::type& index) const
void operator()(const typename std::enable_if<dim_==2, int>::type& index) const
{
const int isize = this->params.isize;
const int jsize = this->params.jsize;
Expand Down Expand Up @@ -626,7 +626,7 @@ class ComputeMoodFlagsUpdateFunctor : public MoodBaseFunctor<dim,degree>
//! functor for 3d
template<int dim_ = dim>
KOKKOS_INLINE_FUNCTION
void operator()(const typename Kokkos::Impl::enable_if<dim_==3, int>::type& index) const
void operator()(const typename std::enable_if<dim_==3, int>::type& index) const
{

const int isize = this->params.isize;
Expand Down
Loading

0 comments on commit 45aba1b

Please sign in to comment.