Skip to content
This repository was archived by the owner on Nov 27, 2023. It is now read-only.

Commit c1a8c6e

Browse files
committed
Remove temporary variables
1 parent cf8e16d commit c1a8c6e

File tree

2 files changed

+13
-33
lines changed

2 files changed

+13
-33
lines changed

packages/Discretization/src/DTK_PointSearch_decl.hpp

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -117,11 +117,7 @@ class PointSearch
117117
* Compute the position in the reference frame of candidates found by the
118118
* search.
119119
*/
120-
std::tuple<Kokkos::View<int *, DeviceType>, Kokkos::View<int *, DeviceType>,
121-
Kokkos::View<double **, DeviceType>,
122-
Kokkos::View<bool *, DeviceType>,
123-
Kokkos::View<int *, DeviceType>>
124-
performPointInCell(
120+
Kokkos::View<int *, DeviceType> performPointInCell(
125121
Kokkos::View<double ***, DeviceType> cells,
126122
Kokkos::View<unsigned int **, DeviceType> bounding_box_to_cell,
127123
Kokkos::View<int *, DeviceType> imported_cell_indices,

packages/Discretization/src/DTK_PointSearch_def.hpp

Lines changed: 12 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -242,27 +242,10 @@ PointSearch<DeviceType>::PointSearch(
242242
for ( unsigned int topo_id = 0; topo_id < DTK_N_TOPO; ++topo_id )
243243
if ( block_cells[topo_id].extent( 0 ) != 0 )
244244
{
245-
Kokkos::View<int *, DeviceType> filtered_per_topo_cell_indices;
246-
Kokkos::View<int *, DeviceType> filtered_per_topo_query_ids;
247-
Kokkos::View<double **, DeviceType>
248-
filtered_per_topo_reference_points;
249-
Kokkos::View<bool *, DeviceType> filtered_per_topo_point_in_cell;
250-
Kokkos::View<int *, DeviceType> filtered_per_topo_ranks;
251-
std::tie(
252-
filtered_per_topo_cell_indices, filtered_per_topo_query_ids,
253-
filtered_per_topo_reference_points,
254-
filtered_per_topo_point_in_cell, filtered_per_topo_ranks ) =
255-
performPointInCell( block_cells[topo_id], bounding_box_to_cell,
256-
imported_cell_indices, imported_points,
257-
imported_query_ids, imported_ranks, topo,
258-
topo_id, topo_size_host( topo_id ) );
259-
260-
// Filter the points. Only keep the points that are in cell
261-
filtered_ranks[topo_id] = filterInCell(
262-
filtered_per_topo_point_in_cell,
263-
filtered_per_topo_reference_points,
264-
filtered_per_topo_cell_indices, filtered_per_topo_query_ids,
265-
filtered_per_topo_ranks, topo_id );
245+
filtered_ranks[topo_id] = performPointInCell(
246+
block_cells[topo_id], bounding_box_to_cell,
247+
imported_cell_indices, imported_points, imported_query_ids,
248+
imported_ranks, topo, topo_id, topo_size_host( topo_id ) );
266249
}
267250

268251
// Build the _source_to_target_distributor
@@ -548,10 +531,7 @@ Kokkos::View<int *, DeviceType> PointSearch<DeviceType>::filterInCell(
548531
}
549532

550533
template <typename DeviceType>
551-
std::tuple<Kokkos::View<int *, DeviceType>, Kokkos::View<int *, DeviceType>,
552-
Kokkos::View<double **, DeviceType>,
553-
Kokkos::View<bool *, DeviceType>, Kokkos::View<int *, DeviceType>>
554-
PointSearch<DeviceType>::performPointInCell(
534+
Kokkos::View<int *, DeviceType> PointSearch<DeviceType>::performPointInCell(
555535
Kokkos::View<double ***, DeviceType> cells,
556536
Kokkos::View<unsigned int **, DeviceType> bounding_box_to_cell,
557537
Kokkos::View<int *, DeviceType> imported_cell_indices,
@@ -584,10 +564,14 @@ PointSearch<DeviceType>::performPointInCell(
584564
topologies[topo_id].topo, filtered_per_topo_reference_points,
585565
filtered_per_topo_point_in_cell );
586566

587-
return std::make_tuple(
567+
// Filter the points. Only keep the points that are in cell
568+
Kokkos::View<int *, DeviceType> filtered_ranks;
569+
filtered_ranks = filterInCell(
570+
filtered_per_topo_point_in_cell, filtered_per_topo_reference_points,
588571
filtered_per_topo_cell_indices, filtered_per_topo_query_ids,
589-
filtered_per_topo_reference_points, filtered_per_topo_point_in_cell,
590-
filtered_per_topo_ranks );
572+
filtered_per_topo_ranks, topo_id );
573+
574+
return filtered_ranks;
591575
}
592576

593577
template <typename DeviceType>

0 commit comments

Comments
 (0)