Permalink
Browse files

added annotations to CUDAGrid and UnstructuredGrid

  • Loading branch information...
gentryx committed Jun 29, 2018
1 parent 6146ae8 commit 2b2f42feee6ba27928b71d9c71385c1b03fcd764
@@ -147,6 +147,7 @@ class CUDAGrid : public GridBase<CELL_TYPE, TOPOLOGY::DIM>
CellType *cursor = target->data();
// fixme: this is slow
for (typename Region<DIM>::StreakIterator i = region.beginStreak();
i != region.endStreak();
++i) {
@@ -168,6 +169,7 @@ class CUDAGrid : public GridBase<CELL_TYPE, TOPOLOGY::DIM>
const CellType *cursor = source.data();
// fixme: this is slow
for (typename Region<DIM>::StreakIterator i = region.beginStreak();
i != region.endStreak();
++i) {
@@ -181,6 +183,7 @@ class CUDAGrid : public GridBase<CELL_TYPE, TOPOLOGY::DIM>
template<typename GRID_TYPE, typename REGION>
void saveRegion(GRID_TYPE *target, const REGION& region) const
{
// fixme: this is slow
for (typename REGION::StreakIterator i = region.beginStreak();
i != region.endStreak();
++i) {
@@ -193,6 +196,7 @@ class CUDAGrid : public GridBase<CELL_TYPE, TOPOLOGY::DIM>
template<typename GRID_TYPE, typename REGION>
void loadRegion(const GRID_TYPE& source, const REGION& region)
{
// fixme: this is slow
for (typename REGION::StreakIterator i = region.beginStreak();
i != region.endStreak();
++i) {
@@ -229,6 +233,7 @@ class CUDAGrid : public GridBase<CELL_TYPE, TOPOLOGY::DIM>
{
char *targetCursor = target;
// fixme: this is slow
for (typename Region<DIM>::StreakIterator i = begin; i != end; ++i) {
selector.copyMemberOut(
address(i->origin),
@@ -250,6 +255,7 @@ class CUDAGrid : public GridBase<CELL_TYPE, TOPOLOGY::DIM>
{
const char *sourceCursor = source;
// fixme: this is slow
for (typename Region<DIM>::StreakIterator i = begin; i != end; ++i) {
selector.copyMemberIn(
sourceCursor,
@@ -363,7 +363,6 @@ class ReorderingUnstructuredGrid : public GridBase<typename DELEGATE_GRID::CellT
return nodeSet;
}
// fixme: use forwarding to delegate for all serialization types
virtual void saveRegion(BufferType *buffer, const Region<DIM>& region, const Coord<DIM>& offset = Coord<DIM>()) const
{
delegate.saveRegion(
@@ -373,7 +372,6 @@ class ReorderingUnstructuredGrid : public GridBase<typename DELEGATE_GRID::CellT
region.size());
}
// fixme: use forwarding to delegate for all serialization types
virtual void loadRegion(const BufferType& buffer, const Region<DIM>& region, const Coord<DIM>& offset = Coord<DIM>())
{
delegate.loadRegion(
@@ -313,6 +313,7 @@ class UnstructuredGrid : public GridBase<ELEMENT_TYPE, 1, WEIGHT_TYPE>
{
ELEMENT_TYPE *target = buffer->data();
// fixme: delegate here?
for (ITER1 i = start; i != end; ++i) {
get(*i, target);
target += i->length();
@@ -333,6 +334,7 @@ class UnstructuredGrid : public GridBase<ELEMENT_TYPE, 1, WEIGHT_TYPE>
{
const ELEMENT_TYPE *source = buffer.data();
// fixme: delegate here?
for (ITER1 i = start; i != end; ++i) {
set(*i, source);
source += i->length();
@@ -373,6 +375,7 @@ class UnstructuredGrid : public GridBase<ELEMENT_TYPE, 1, WEIGHT_TYPE>
const Coord<DIM>& offset,
const APITraits::TrueType&) const
{
// fixme: delegate here?
// fixme:
// #ifdef LIBGEODECOMP_WITH_HPX
// int archive_flags = boost::archive::no_header;
@@ -406,6 +409,7 @@ class UnstructuredGrid : public GridBase<ELEMENT_TYPE, 1, WEIGHT_TYPE>
const Coord<DIM>& offset,
const APITraits::TrueType&)
{
// fixme: delegate here?
// fixme:
// #ifdef LIBGEODECOMP_WITH_HPX
// int archive_flags = boost::archive::no_header;
@@ -434,6 +438,7 @@ class UnstructuredGrid : public GridBase<ELEMENT_TYPE, 1, WEIGHT_TYPE>
const ITER1& start,
const ITER2& end) const
{
// fixme: delegate here?
for (ITER1 i = start; i != end; ++i) {
selector.copyMemberOut(&(*this)[i->origin], MemoryLocation::HOST, target, targetLocation, i->length());
target += selector.sizeOfExternal() * i->length();
@@ -448,6 +453,7 @@ class UnstructuredGrid : public GridBase<ELEMENT_TYPE, 1, WEIGHT_TYPE>
const ITER1& start,
const ITER2& end)
{
// fixme: delegate here?
for (ITER1 i = start; i != end; ++i) {
selector.copyMemberIn(source, sourceLocation, &(*this)[i->origin], MemoryLocation::HOST, i->length());
source += selector.sizeOfExternal() * i->length();

0 comments on commit 2b2f42f

Please sign in to comment.