43#ifndef PANZER_COMMON_ARRAY_FACTORIES_IMPL_HPP
44#define PANZER_COMMON_ARRAY_FACTORIES_IMPL_HPP
46#include "Teuchos_RCP.hpp"
47#include "Phalanx_DataLayout_MDALayout.hpp"
48#include "Phalanx_KokkosViewFactory.hpp"
53template <
typename Scalar,
typename T0>
55buildArray(
const std::string & str,
int d0)
const
57 static_assert(std::is_same<Scalar,double>::value,
"ERROR: CommonArryFactory for DynRankView only supports double scalar type!");
58 return Kokkos::DynRankView<Scalar,PHX::Device>(str,d0);
61template <
typename Scalar,
typename T0,
typename T1>
63buildArray(
const std::string & str,
int d0,
int d1)
const
65 static_assert(std::is_same<Scalar,double>::value,
"ERROR: CommonArryFactory for DynRankView only supports double scalar type!");
66 return Kokkos::DynRankView<Scalar,PHX::Device>(str,d0,d1);
69template <
typename Scalar,
typename T0,
typename T1,
typename T2>
71buildArray(
const std::string & str,
int d0,
int d1,
int d2)
const
73 static_assert(std::is_same<Scalar,double>::value,
"ERROR: CommonArryFactory for DynRankView only supports double scalar type!");
74 return Kokkos::DynRankView<Scalar,PHX::Device>(str,d0,d1,d2);
77template <
typename Scalar,
typename T0,
typename T1,
typename T2,
typename T3>
79buildArray(
const std::string & str,
int d0,
int d1,
int d2,
int d3)
const
81 static_assert(std::is_same<Scalar,double>::value,
"ERROR: CommonArryFactory for DynRankView only supports double scalar type!");
82 return Kokkos::DynRankView<Scalar,PHX::Device>(str,d0,d1,d2,d3);
85template <
typename Scalar,
typename T0,
typename T1,
typename T2,
typename T3,
typename T4>
87buildArray(
const std::string & str,
int d0,
int d1,
int d2,
int d3,
int d4)
const
89 static_assert(std::is_same<Scalar,double>::value,
"ERROR: CommonArryFactory for DynRankView only supports double scalar type!");
90 return Kokkos::DynRankView<Scalar,PHX::Device>(str,d0,d1,d2,d3,d4);
94template <
typename Scalar,
typename T0>
96buildArray(
const std::string & str,
int d0)
const
98 typedef PHX::KokkosViewFactory<Scalar,typename PHX::DevLayout<Scalar>::type,PHX::Device> ViewFactory;
100 PHX::MDField<Scalar>
field = PHX::MDField<Scalar>(
prefix_+str,Teuchos::rcp(
new PHX::MDALayout<T0>(d0)));
108template <
typename Scalar,
typename T0,
typename T1>
110buildArray(
const std::string & str,
int d0,
int d1)
const
112 typedef PHX::KokkosViewFactory<Scalar,typename PHX::DevLayout<Scalar>::type,PHX::Device> ViewFactory;
114 PHX::MDField<Scalar>
field = PHX::MDField<Scalar>(
prefix_+str,Teuchos::rcp(
new PHX::MDALayout<T0,T1 >(d0,d1)));
122template <
typename Scalar,
typename T0,
typename T1,
typename T2>
124buildArray(
const std::string & str,
int d0,
int d1,
int d2)
const
126 typedef PHX::KokkosViewFactory<Scalar,typename PHX::DevLayout<Scalar>::type,PHX::Device> ViewFactory;
128 PHX::MDField<Scalar>
field = PHX::MDField<Scalar>(
prefix_+str,Teuchos::rcp(
new PHX::MDALayout<T0,T1,T2>(d0,d1,d2)));
136template <
typename Scalar,
typename T0,
typename T1,
typename T2,
typename T3>
138buildArray(
const std::string & str,
int d0,
int d1,
int d2,
int d3)
const
140 typedef PHX::KokkosViewFactory<Scalar,typename PHX::DevLayout<Scalar>::type,PHX::Device> ViewFactory;
142 PHX::MDField<Scalar>
field = PHX::MDField<Scalar>(
prefix_+str,Teuchos::rcp(
new PHX::MDALayout<T0,T1,T2,T3>(d0,d1,d2,d3)));
150template <
typename Scalar,
typename T0,
typename T1,
typename T2,
typename T3,
typename T4>
152buildArray(
const std::string & str,
int d0,
int d1,
int d2,
int d3,
int d4)
const
154 typedef PHX::KokkosViewFactory<Scalar,typename PHX::DevLayout<Scalar>::type,PHX::Device> ViewFactory;
156 PHX::MDField<Scalar>
field = PHX::MDField<Scalar>(
prefix_+str,Teuchos::rcp(
new PHX::MDALayout<T0,T1,T2,T3,T4>(d0,d1,d2,d3,d4)));
165template <
typename Scalar,
typename T0>
169 typedef PHX::KokkosViewFactory<Scalar,typename PHX::DevLayout<Scalar>::type,PHX::Device> ViewFactory;
171 PHX::MDField<Scalar,T0>
field = PHX::MDField<Scalar,T0>(
prefix_+str,Teuchos::rcp(
new PHX::MDALayout<T0>(d0)));
179template <
typename Scalar,
typename T0,
typename T1>
183 typedef PHX::KokkosViewFactory<Scalar,typename PHX::DevLayout<Scalar>::type,PHX::Device> ViewFactory;
185 PHX::MDField<Scalar,T0,T1>
field = PHX::MDField<Scalar,T0,T1>(
prefix_+str,Teuchos::rcp(
new PHX::MDALayout<T0,T1>(d0,d1)));
193template <
typename Scalar,
typename T0,
typename T1,
typename T2>
197 typedef PHX::KokkosViewFactory<Scalar,typename PHX::DevLayout<Scalar>::type,PHX::Device> ViewFactory;
199 PHX::MDField<Scalar,T0,T1,T2>
field = PHX::MDField<Scalar,T0,T1,T2>(
prefix_+str,Teuchos::rcp(
new PHX::MDALayout<T0,T1,T2>(d0,d1,d2)));
207template <
typename Scalar,
typename T0,
typename T1,
typename T2,
typename T3>
211 typedef PHX::KokkosViewFactory<Scalar,typename PHX::DevLayout<Scalar>::type,PHX::Device> ViewFactory;
213 PHX::MDField<Scalar,T0,T1,T2,T3>
field = PHX::MDField<Scalar,T0,T1,T2,T3>(
prefix_+str,Teuchos::rcp(
new PHX::MDALayout<T0,T1,T2,T3>(d0,d1,d2,d3)));
221template <
typename Scalar,
typename T0,
typename T1,
typename T2,
typename T3,
typename T4>
223buildStaticArray(
const std::string & str,
int d0,
int d1,
int d2,
int d3,
int d4)
const
225 typedef PHX::KokkosViewFactory<Scalar,typename PHX::DevLayout<Scalar>::type,PHX::Device> ViewFactory;
227 PHX::MDField<Scalar,T0,T1,T2,T3,T4>
field = PHX::MDField<Scalar,T0,T1,T2,T3,T4>(
prefix_+str,Teuchos::rcp(
new PHX::MDALayout<T0,T1,T2,T3,T4>(d0,d1,d2,d3,d4)));
PHX::MDField< ScalarT, panzer::Cell, panzer::BASIS > field
A field to which we'll contribute, or in which we'll store, the result of computing this integral.
Kokkos::DynRankView< Scalar, PHX::Device > buildArray(const std::string &str, int d0) const
std::vector< PHX::index_size_type > ddims_
PHX::MDField< Scalar, T0 > buildStaticArray(const std::string &str, int d0) const
PHX::MDField< Scalar > buildArray(const std::string &str, int d0) const