Skip to content

Commit b292e21

Browse files
committed
Test memcpy by changing SD field to contiguous RightLayout
1 parent a8dae06 commit b292e21

3 files changed

Lines changed: 6 additions & 4 deletions

File tree

src/pmpo_MPMesh.hpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,12 +56,14 @@ class MPMesh{
5656

5757
timer.reset();
5858
std::vector<double> fieldData1(nEntities*numEntries);
59-
pumipic::RecordTime("SD: STL alloc" + std::to_string(self), timer.seconds());
59+
pumipic::RecordTime("SD: STL alloc-" + std::to_string(self), timer.seconds());
6060
timer.reset();
61+
/*
6162
for (int i=0;i<nEntities;i++)
6263
for (int j=0;j<numEntries;j++)
6364
fieldData1[i*numEntries+j]=reconVals_host(i,j);
64-
//std::memcpy(fieldData1.data(), reconVals_host.data(), nEntities*numEntries*sizeof(double));
65+
*/
66+
std::memcpy(fieldData1.data(), reconVals_host.data(), nEntities*numEntries*sizeof(double));
6567
pumipic::RecordTime("SD: STL alloc_copy-" + std::to_string(self), timer.seconds());
6668

6769
/*

src/pmpo_mesh.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ namespace polyMPO{
5454

5555
auto stressDivergenceEntry = meshFields2TypeAndString.at(MeshF_StressDivergence);
5656
PMT_ALWAYS_ASSERT(stressDivergenceEntry.first == MeshFType_VtxBased);
57-
stressDivergence_ = MeshFView<MeshF_StressDivergence>(stressDivergenceEntry.second, numVtxs_);
57+
stressDivergence_ = MeshFView<MeshF_StressDivergence>(stressDivergenceEntry.second, numVtxs_, 2);
5858

5959
auto solveVelocityEntry = meshFields2TypeAndString.at(MeshF_SolveVelocity);
6060
PMT_ALWAYS_ASSERT(solveVelocityEntry.first == MeshFType_VtxBased);

src/pmpo_mesh.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ template <> struct meshFieldToType < MeshF_TanLatVertexRotatedOverRadius > { usi
6666
template <> struct meshFieldToType < MeshF_SolveStress > { using type = IntView; };
6767
template <> struct meshFieldToType < MeshF_SolveVelocity > { using type = IntView; };
6868
template <> struct meshFieldToType < MeshF_InteriorVertex > { using type = IntView; };
69-
template <> struct meshFieldToType < MeshF_StressDivergence > { using type = Kokkos::View<vec2d_t*>; };
69+
template <> struct meshFieldToType < MeshF_StressDivergence > { using type = Kokkos::View<double**, Kokkos::LayoutRight>; };
7070
template <> struct meshFieldToType < MeshF_TotalMassVtx > { using type = Kokkos::View<doubleSclr_t*>; };
7171
template <> struct meshFieldToType < MeshF_AirStress > { using type = Kokkos::View<vec2d_t*>; };
7272
template <> struct meshFieldToType < MeshF_SurfaceTilt > { using type = Kokkos::View<vec2d_t*>; };

0 commit comments

Comments
 (0)