From 5397495496feb861f34c42ec129a1b312d4f0d84 Mon Sep 17 00:00:00 2001 From: jpekkila Date: Thu, 8 Aug 2019 20:43:01 +0300 Subject: [PATCH] Added acLoadWithOffset --- include/astaroth.h | 3 ++- src/core/astaroth.cu | 8 +++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/include/astaroth.h b/include/astaroth.h index 19eee0d..cae7139 100644 --- a/include/astaroth.h +++ b/include/astaroth.h @@ -87,10 +87,11 @@ AcResult acStoreWithOffset(const int3 dst, const size_t num_vertices, AcMesh* ho /** Will potentially be deprecated in later versions. Added only to fix backwards compatibility with * PC for now.*/ -AcResult acIntegrateStep(const int isubstep, const AcReal& dt); +AcResult acIntegrateStep(const int isubstep, const AcReal dt); AcResult acIntegrateStepWithOffset(const int isubstep, const AcReal dt, const int3 start, const int3 end); AcResult acSynchronize(void); +AcResult acLoadWithOffset(const AcMesh host_mesh, const int3 src, const int num_vertices); #ifdef __cplusplus } // extern "C" diff --git a/src/core/astaroth.cu b/src/core/astaroth.cu index 59b6b89..6e06663 100644 --- a/src/core/astaroth.cu +++ b/src/core/astaroth.cu @@ -104,7 +104,7 @@ acIntegrate(const AcReal dt) } AcResult -acIntegrateStep(const int& isubstep, const AcReal dt) +acIntegrateStep(const int isubstep, const AcReal dt) { const int3 start = (int3){NGHOST, NGHOST, NGHOST}; const int3 end = start + grid_n; @@ -145,3 +145,9 @@ acStoreWithOffset(const int3 dst, const size_t num_vertices, AcMesh* host_mesh) { return acNodeStoreMeshWithOffset(nodes[0], STREAM_DEFAULT, dst, dst, num_vertices, host_mesh); } + +AcResult +acLoadWithOffset(const AcMesh host_mesh, const int3 src, const int num_vertices) +{ + return acNodeLoadMeshWithOffset(nodes[0], STREAM_DEFAULT, host_mesh, src, src, num_vertices); +}