ppm_compact_mask_index.f90 supposing you have a mask array and use it in something like a WHERE, then it can be beneficial to only visit those indices of the array expression with the condition evaluating to .TRUE., in case this is relatively sparse or the ensuing conditional is expensive in comparison to the WHERE/FORALL body
More...
|
pure subroutine | build_ranges_2d (mask, offsets, sseq, idx) |
|
pure integer function | count_ranges_2d (mask, sseq) |
|
pure subroutine | index_from_mask_2d (idx, mask, offsets, sseq) |
| compute index from mask array More...
|
|
integer function | build_ranges_3d (mask, sizes, strides, sseq, offsets, idx) |
|
subroutine | index_from_mask_3d (idx, mask, offsets, sseq) |
| construct compact index from mask More...
|
|
integer function | build_ranges_mt_3d (mask, sizes, strides, sseq, offsets, idx) |
|
subroutine | index_from_mask_mt_3d (idx, mask, offsets, sseq) |
| construct compact index from mask More...
|
|
ppm_compact_mask_index.f90 supposing you have a mask array and use it in something like a WHERE, then it can be beneficial to only visit those indices of the array expression with the condition evaluating to .TRUE., in case this is relatively sparse or the ensuing conditional is expensive in comparison to the WHERE/FORALL body
This index variation addresses the case where each range in the subscript varied most rapidly (ll) corresponds to a change in at least one slower (hl) subscript.
◆ index_from_mask_2d()
pure subroutine ppm_compact_mask_index::index_from_mask_2d |
( |
type(range_compact_2d), dimension(:), intent(out), allocatable |
idx, |
|
|
logical, dimension(:, :), intent(in) |
mask, |
|
|
integer, dimension(2), intent(in), optional |
offsets, |
|
|
integer, dimension(2), intent(in), optional |
sseq |
|
) |
| |
|
private |
compute index from mask array
- Parameters
-
idx | index to construct |
mask | to be indexed |
offsets | low bounds of mask (if not present assumed to be 1) |
sseq | sequence in which to travel indices, e.g. if mask is transposed, one would pass (/ 2, 1 /) to the routine |
◆ index_from_mask_3d()
subroutine ppm_compact_mask_index::index_from_mask_3d |
( |
type(range_compact_3d), dimension(:), intent(out), allocatable |
idx, |
|
|
logical, dimension(:, :, :), intent(in) |
mask, |
|
|
integer, dimension(3), intent(in), optional |
offsets, |
|
|
integer, dimension(3), intent(in), optional |
sseq |
|
) |
| |
|
private |
construct compact index from mask
- Parameters
-
idx | index to construct |
mask | to be indexed |
offsets | low bounds of mask (if not present assumed to be 1) |
sseq | subscript sequence i.e. sequence by which to store ranges in index |
◆ index_from_mask_mt_3d()
subroutine ppm_compact_mask_index::index_from_mask_mt_3d |
( |
type(range_compact_3d), dimension(:), intent(out), allocatable |
idx, |
|
|
logical, dimension(:, :, :), intent(in) |
mask, |
|
|
integer, dimension(3), intent(in), optional |
offsets, |
|
|
integer, dimension(3), intent(in), optional |
sseq |
|
) |
| |
|
private |
construct compact index from mask
this version must be called from outside an OpenMP parallel region because it will open its own region
- Parameters
-
idx | index to construct |
mask | to be indexed |
offsets | low bounds of mask (if not present assumed to be 1) |
sseq | subscript sequence i.e. sequence by which to store ranges in index |
Das diesem Bericht zugrundeliegende Vorhaben wurde mit Mitteln des Bundesministeriums für Bildung, und Forschung unter dem Förderkennzeichen 01IH08004E gefördert. Die Verantwortung für den Inhalt dieser Veröffentlichung liegt beim Autor.