Update Kokkos library to r2.6.00

This commit is contained in:
Stan Moore
2018-03-08 10:57:08 -07:00
parent 0c4c002f34
commit 39786b1740
694 changed files with 12261 additions and 6745 deletions

View File

@ -35,7 +35,7 @@
// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov)
// Questions? Contact Christian R. Trott (crtrott@sandia.gov)
//
// ************************************************************************
//@HEADER
@ -81,7 +81,7 @@ struct set_boundary {
KOKKOS_INLINE_FUNCTION
void operator() (const typename ViewType::size_type i) const {
for (typename ViewType::size_type j = 0; j < a.dimension_1 (); ++j) {
for (typename ViewType::size_type j = 0; j < a.extent(1); ++j) {
a(i,j) = value;
}
}
@ -102,8 +102,8 @@ struct set_inner {
KOKKOS_INLINE_FUNCTION
void operator () (const typename ViewType::size_type i) const {
typedef typename ViewType::size_type size_type;
for (size_type j = 0; j < a.dimension_1 (); ++j) {
for (size_type k = 0; k < a.dimension_2 (); ++k) {
for (size_type j = 0; j < a.extent(1); ++j) {
for (size_type k = 0; k < a.extent(2); ++k) {
a(i,j,k) = value;
}
}
@ -125,8 +125,8 @@ struct update {
void operator() (typename ViewType::size_type i) const {
typedef typename ViewType::size_type size_type;
i++;
for (size_type j = 1; j < a.dimension_1()-1; j++) {
for (size_type k = 1; k < a.dimension_2()-1; k++) {
for (size_type j = 1; j < a.extent(1)-1; j++) {
for (size_type k = 1; k < a.extent(2)-1; k++) {
a(i,j,k) += dt* (a(i,j,k+1) - a(i,j,k-1) +
a(i,j+1,k) - a(i,j-1,k) +
a(i+1,j,k) - a(i-1,j,k));
@ -170,19 +170,19 @@ int main (int narg, char* arg[]) {
yz_plane_type Xpos_halo = subview(A, 101, ALL (), ALL ());
// Set the boundaries to their initial conditions.
parallel_for (Zneg_halo.dimension_0 (), set_boundary<xy_plane_type> (Zneg_halo, 1));
parallel_for (Zpos_halo.dimension_0 (), set_boundary<xy_plane_type> (Zpos_halo, -1));
parallel_for (Yneg_halo.dimension_0 (), set_boundary<xz_plane_type> (Yneg_halo, 2));
parallel_for (Ypos_halo.dimension_0 (), set_boundary<xz_plane_type> (Ypos_halo, -2));
parallel_for (Xneg_halo.dimension_0 (), set_boundary<yz_plane_type> (Xneg_halo, 3));
parallel_for (Xpos_halo.dimension_0 (), set_boundary<yz_plane_type> (Xpos_halo, -3));
parallel_for (Zneg_halo.extent(0), set_boundary<xy_plane_type> (Zneg_halo, 1));
parallel_for (Zpos_halo.extent(0), set_boundary<xy_plane_type> (Zpos_halo, -1));
parallel_for (Yneg_halo.extent(0), set_boundary<xz_plane_type> (Yneg_halo, 2));
parallel_for (Ypos_halo.extent(0), set_boundary<xz_plane_type> (Ypos_halo, -2));
parallel_for (Xneg_halo.extent(0), set_boundary<yz_plane_type> (Xneg_halo, 3));
parallel_for (Xpos_halo.extent(0), set_boundary<yz_plane_type> (Xpos_halo, -3));
// Set the interior of the mesh to its initial condition.
parallel_for (Ai.dimension_0 (), set_inner<inner_mesh_type> (Ai, 0));
parallel_for (Ai.extent(0), set_inner<inner_mesh_type> (Ai, 0));
// Update the interior of the mesh.
// This simulates one timestep with dt = 0.1.
parallel_for (Ai.dimension_0 (), update<mesh_type> (A, 0.1));
parallel_for (Ai.extent(0), update<mesh_type> (A, 0.1));
printf ("Done\n");
Kokkos::finalize ();