Skip to content

Commit d281d99

Browse files
committed
fixed outdated extention access
1 parent 128a8e5 commit d281d99

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

dash/include/dash/halo/CoordinateAccess.h

+13-13
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#ifndef DASH__HALO_HALOCOORDINATEACCESS_H
22
#define DASH__HALO_HALOCOORDINATEACCESS_H
33

4-
#include <dash/halo/Halo.h>
4+
#include <dash/halo/Halo.h>
55

66
namespace dash {
77

@@ -37,7 +37,7 @@ class DataInnerAccess {
3737
template<dim_t _CurrentDimension = CurrentDimension + 1>
3838
std::enable_if_t<(_CurrentDimension != NumDimensions), DataInnerAccess<CoordinateInnerAccessT, CurrentDimension+1>>
3939
operator[](index_t pos) {
40-
40+
4141
return DataInnerAccess<CoordinateInnerAccessT, CurrentDimension+1>(_offsets, _mem + pos * (*_offsets)[CurrentDimension]);
4242
}
4343

@@ -137,14 +137,14 @@ class DataAccess {
137137
if(pos < 0) {
138138
return DataAccess<CoordinateAccessT, CurrentDimension+1>(_access, _mem + pos * _access->_offsets[CurrentDimension], _coords, _reg_index, true);
139139
}
140-
140+
141141
if(pos >= static_cast<index_t>(_access->_view_local->extent(CurrentDimension))) {
142142
return DataAccess<CoordinateAccessT, CurrentDimension+1>(_access, _mem + pos * _access->_offsets[CurrentDimension], _coords, _reg_index + 2, true);
143143
}
144144

145145
return DataAccess<CoordinateAccessT, CurrentDimension+1>(_access, _mem + pos * _access->_offsets[CurrentDimension], _coords, _reg_index + 1, true);
146146
}
147-
147+
148148
return DataAccess<CoordinateAccessT, CurrentDimension+1>(_access, _mem + pos * _access->_offsets[CurrentDimension], _coords, _reg_index + 1, false);
149149
}
150150

@@ -153,11 +153,11 @@ class DataAccess {
153153
operator[](index_t pos) {
154154
if(_halo || pos < 0 || pos >= static_cast<index_t>(_access->_view_local->extent(CurrentDimension))) {
155155
_reg_index *= REGION_INDEX_BASE;
156-
156+
157157
if(pos >= 0) {
158158
++_reg_index;
159-
}
160-
159+
}
160+
161161
if(pos >= static_cast<index_t>(_access->_view_local->extent(CurrentDimension))) {
162162
++_reg_index;
163163
}
@@ -169,7 +169,7 @@ class DataAccess {
169169
return *(halo_memory->first_element_at(_reg_index)
170170
+ halo_memory->offset(_reg_index, _coords));
171171
}
172-
172+
173173
return _mem[pos];
174174
}
175175

@@ -185,7 +185,7 @@ template<typename CoordinateAccessT>
185185
class CoordinateHaloAccess {
186186
private:
187187
using Self_t = CoordinateHaloAccess<CoordinateAccessT>;
188-
188+
189189
static constexpr auto NumDimensions = CoordinateAccessT::ndim();
190190
static constexpr auto MemoryArrange = CoordinateAccessT::memory_order();
191191

@@ -236,7 +236,7 @@ class CoordinateHaloAccess {
236236
for(const auto& view : bnd_views) {
237237
AllViewRanges_t ranges;
238238
for(dim_t d = 0; d < NumDimensions; ++d) {
239-
ranges[d] = {static_cast<index_t>(view.offset(d)),
239+
ranges[d] = {static_cast<index_t>(view.offset(d)),
240240
static_cast<index_t>(view.offset(d) + view.extent(d))};
241241
}
242242
all_ranges.push_back(ranges);
@@ -370,7 +370,7 @@ class CoordinateAccess {
370370
AllViewRanges_t set_ranges(ViewSpec_t view) const {
371371
AllViewRanges_t ranges;
372372
for(dim_t d = 0; d < NumDimensions; ++d) {
373-
ranges[d] = {static_cast<index_t>(view.offset(d)),
373+
ranges[d] = {static_cast<index_t>(view.offset(d)),
374374
static_cast<index_t>(view.offset(d) + view.extent(d))};
375375
}
376376

@@ -380,8 +380,8 @@ class CoordinateAccess {
380380
AllViewRanges_t set_ranges_halo(ViewSpec_t view) const {
381381
AllViewRanges_t ranges;
382382
for(dim_t d = 0; d < NumDimensions; ++d) {
383-
const auto& ext_max = _halo_block->halo_extension_max(d);
384-
ranges[d] = {static_cast<index_t>(view.offset(d)) - ext_max.first,
383+
const auto& ext_max = _halo_block->halo_spec().halo_extension_max(d);
384+
ranges[d] = {static_cast<index_t>(view.offset(d)) - ext_max.first,
385385
static_cast<index_t>(view.offset(d) + view.extent(d)) + ext_max.second};
386386
}
387387

0 commit comments

Comments
 (0)