Skip to content

Commit d6f1fe4

Browse files
committed
Removed deprecated device type class templates
1 parent 7f5ca75 commit d6f1fe4

18 files changed

+76
-209
lines changed

benchmark/grid/Cabana_Grid_InterpolationPerformance.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,7 @@ void performanceTest( std::ostream& stream, const std::string& test_prefix,
312312

313313
// Create a local grid and local mesh
314314
auto local_grid = createLocalGrid( global_grid, halo_width );
315-
auto local_mesh = createLocalMesh<exec_space>( *local_grid );
315+
auto local_mesh = createLocalMesh<memory_space>( *local_grid );
316316
auto owned_cells = local_grid->indexSpace( Own(), Cell(), Local() );
317317
int num_cells = owned_cells.size();
318318

core/src/Cabana_AoSoA.hpp

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -136,15 +136,10 @@ class AoSoA
136136
//! Member data types.
137137
using member_types = DataTypes;
138138

139-
// FIXME: extracting the self type for backwards compatibility with previous
140-
// template on DeviceType. Should simply be MemorySpace after next release.
141-
//! Memory space.
142-
using memory_space = typename MemorySpace::memory_space;
143-
// FIXME: replace warning with memory space assert after next release.
144-
static_assert( Impl::deprecated( Kokkos::is_device<MemorySpace>() ) );
145-
146-
//! Default device type.
147-
using device_type [[deprecated]] = typename memory_space::device_type;
139+
//! Kokkos memory space.
140+
using memory_space = MemorySpace;
141+
static_assert( Kokkos::is_memory_space<MemorySpace>() );
142+
148143
//! Default execution space.
149144
using execution_space = typename memory_space::execution_space;
150145

core/src/Cabana_CommunicationPlan.hpp

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -437,15 +437,9 @@ template <class MemorySpace>
437437
class CommunicationPlan
438438
{
439439
public:
440-
// FIXME: extracting the self type for backwards compatibility with previous
441-
// template on DeviceType. Should simply be MemorySpace after next release.
442-
//! Memory space.
443-
using memory_space = typename MemorySpace::memory_space;
444-
// FIXME: replace warning with memory space assert after next release.
445-
static_assert( Impl::deprecated( Kokkos::is_device<MemorySpace>() ) );
446-
447-
//! Default device type.
448-
using device_type [[deprecated]] = typename memory_space::device_type;
440+
//! Kokkos memory space.
441+
using memory_space = MemorySpace;
442+
static_assert( Kokkos::is_memory_space<MemorySpace>() );
449443

450444
//! Default execution space.
451445
using execution_space = typename memory_space::execution_space;

core/src/Cabana_Experimental_NeighborList.hpp

Lines changed: 0 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -454,37 +454,6 @@ auto makeNeighborList( Tag tag, Positions const& positions,
454454
buffer_size );
455455
}
456456

457-
/*!
458-
\brief Neighbor list implementation using ArborX for particles within the
459-
interaction distance with a 1D compressed layout for particles and neighbors.
460-
461-
\tparam DeviceType Kokkos device type.
462-
\tparam Positions The position type.
463-
\tparam Tag Tag indicating whether to build a full or half neighbor list.
464-
465-
\param tag Tag indicating whether to build a full or half neighbor list.
466-
\param positions The particle positions.
467-
\param first The beginning particle index to compute neighbors for.
468-
\param last The end particle index to compute neighbors for.
469-
\param radius The radius of the neighborhood. Particles within this radius are
470-
considered neighbors.
471-
\param buffer_size Optional guess for maximum number of neighbors.
472-
473-
Neighbor list implementation most appropriate for highly varying particle
474-
densities.
475-
*/
476-
template <typename DeviceType, typename Positions, typename Tag>
477-
[[deprecated]] auto makeNeighborList( Tag tag, Positions const& positions,
478-
typename Positions::size_type first,
479-
typename Positions::size_type last,
480-
typename Positions::value_type radius,
481-
int buffer_size = 0 )
482-
{
483-
using exec_space = typename DeviceType::execution_space;
484-
return makeNeighborList( exec_space{}, tag, positions, first, last, radius,
485-
buffer_size );
486-
}
487-
488457
//---------------------------------------------------------------------------//
489458
//! 2d ArborX neighbor list storage layout.
490459
template <typename MemorySpace, typename Tag>
@@ -626,38 +595,6 @@ auto make2DNeighborList( Tag tag, Positions const& positions,
626595
radius, buffer_size );
627596
}
628597

629-
/*!
630-
\brief Neighbor list implementation using ArborX for particles within the
631-
interaction distance with a 2D layout for particles and neighbors.
632-
633-
\tparam DeviceType Kokkos device type.
634-
\tparam Positions The position type.
635-
\tparam Tag Tag indicating whether to build a full or half neighbor list.
636-
637-
\param tag Tag indicating whether to build a full or half neighbor list.
638-
\param positions The particle positions.
639-
\param first The beginning particle index to compute neighbors for.
640-
\param last The end particle index to compute neighbors for.
641-
\param radius The radius of the neighborhood. Particles within this radius are
642-
considered neighbors.
643-
\param buffer_size Optional guess for maximum number of neighbors per
644-
particle.
645-
646-
Neighbor list implementation most appropriate for highly varying particle
647-
densities.
648-
*/
649-
template <typename DeviceType, typename Positions, typename Tag>
650-
[[deprecated]] auto make2DNeighborList( Tag tag, Positions const& positions,
651-
typename Positions::size_type first,
652-
typename Positions::size_type last,
653-
typename Positions::value_type radius,
654-
int buffer_size = 0 )
655-
{
656-
using exec_space = typename DeviceType::execution_space;
657-
return make2DNeighborList( exec_space{}, tag, positions, first, last,
658-
radius, buffer_size );
659-
}
660-
661598
} // namespace Experimental
662599

663600
//! 1d ArborX NeighborList interface.

core/src/Cabana_LinkedCellList.hpp

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -94,17 +94,10 @@ template <class MemorySpace, class Scalar = double>
9494
class LinkedCellList
9595
{
9696
public:
97-
// FIXME: add static_assert that this is a valid MemorySpace.
98-
99-
// FIXME: extracting the self type for backwards compatibility with previous
100-
// template on DeviceType. Should simply be MemorySpace after next release.
101-
//! Memory space.
102-
using memory_space = typename MemorySpace::memory_space;
103-
// FIXME: replace warning with memory space assert after next release.
104-
static_assert( Impl::deprecated( Kokkos::is_device<MemorySpace>() ) );
97+
//! Kokkos memory space.
98+
using memory_space = MemorySpace;
99+
static_assert( Kokkos::is_memory_space<MemorySpace>() );
105100

106-
//! Default device type.
107-
using device_type [[deprecated]] = typename memory_space::device_type;
108101
//! Default execution space.
109102
using execution_space = typename memory_space::execution_space;
110103
//! Memory space size type.

core/src/Cabana_SiloParticleOutput.hpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ void writeFields(
9696
{
9797
// Reorder in a contiguous blocked format.
9898
Kokkos::View<typename SliceType::value_type*,
99-
typename SliceType::device_type>
99+
typename SliceType::memory_space>
100100
view( Kokkos::ViewAllocateWithoutInitializing( "scalar_field" ),
101101
end - begin );
102102
copySliceToView( view, slice, begin, end );
@@ -122,7 +122,7 @@ void writeFields(
122122
{
123123
// Reorder in a contiguous blocked format.
124124
Kokkos::View<typename SliceType::value_type**, Kokkos::LayoutLeft,
125-
typename SliceType::device_type>
125+
typename SliceType::memory_space>
126126
view( Kokkos::ViewAllocateWithoutInitializing( "vector_field" ),
127127
end - begin, slice.extent( 2 ) );
128128
copySliceToView( view, slice, begin, end );
@@ -153,7 +153,7 @@ void writeFields(
153153
{
154154
// Reorder in a contiguous blocked format.
155155
Kokkos::View<typename SliceType::value_type***, Kokkos::LayoutLeft,
156-
typename SliceType::device_type>
156+
typename SliceType::memory_space>
157157
view( Kokkos::ViewAllocateWithoutInitializing( "matrix_field" ),
158158
end - begin, slice.extent( 2 ), slice.extent( 3 ) );
159159
copySliceToView( view, slice, begin, end );
@@ -439,7 +439,7 @@ void writePartialRangeTimeStep( const std::string& prefix, MPI_Comm comm,
439439

440440
// Reorder the coordinates in a blocked format.
441441
Kokkos::View<typename CoordSliceType::value_type**, Kokkos::LayoutLeft,
442-
typename CoordSliceType::device_type>
442+
typename CoordSliceType::memory_space>
443443
view( Kokkos::ViewAllocateWithoutInitializing( "coords" ), end - begin,
444444
coords.extent( 2 ) );
445445
copySliceToView( view, coords, begin, end );

core/src/Cabana_Slice.hpp

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -509,15 +509,10 @@ class Slice
509509
using slice_type =
510510
Slice<DataType, MemorySpace, MemoryAccessType, VectorLength, Stride>;
511511

512-
// FIXME: extracting the self type for backwards compatibility with previous
513-
// template on DeviceType. Should simply be MemorySpace after next release.
514-
//! Memory space.
515-
using memory_space = typename MemorySpace::memory_space;
516-
// FIXME: replace warning with memory space assert after next release.
517-
static_assert( Impl::deprecated( Kokkos::is_device<MemorySpace>() ) );
518-
519-
//! Default device type.
520-
using device_type [[deprecated]] = typename memory_space::device_type;
512+
//! Kokkos memory space.
513+
using memory_space = MemorySpace;
514+
static_assert( Kokkos::is_memory_space<MemorySpace>() );
515+
521516
//! Default execution space.
522517
using execution_space = typename memory_space::execution_space;
523518

core/src/Cabana_Sort.hpp

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -38,15 +38,10 @@ template <class MemorySpace>
3838
class BinningData
3939
{
4040
public:
41-
// FIXME: extracting the self type for backwards compatibility with previous
42-
// template on DeviceType. Should simply be MemorySpace after next release.
43-
//! Memory space.
44-
using memory_space = typename MemorySpace::memory_space;
45-
// FIXME: replace warning with memory space assert after next release.
46-
static_assert( Impl::deprecated( Kokkos::is_device<MemorySpace>() ) );
47-
48-
//! Default device type.
49-
using device_type [[deprecated]] = typename memory_space::device_type;
41+
//! Kokkos memory space.
42+
using memory_space = MemorySpace;
43+
static_assert( Kokkos::is_memory_space<MemorySpace>() );
44+
5045
//! Default execution space.
5146
using execution_space = typename memory_space::execution_space;
5247
//! Memory space size type.
@@ -673,7 +668,7 @@ void permute(
673668
\param view The view to permute.
674669
*/
675670
template <class BinningDataType, class ViewType,
676-
class DeviceType = typename BinningDataType::device_type>
671+
class MemorySpace = typename BinningDataType::memory_space>
677672
void permute(
678673
const BinningDataType& binning_data, ViewType& view,
679674
typename std::enable_if<( is_binning_data<BinningDataType>::value &&
@@ -690,7 +685,7 @@ void permute(
690685
for ( std::size_t d = 1; d < view.rank; ++d )
691686
num_comp *= view.extent( d );
692687

693-
Kokkos::View<typename ViewType::value_type**, DeviceType> scratch(
688+
Kokkos::View<typename ViewType::value_type**, MemorySpace> scratch(
694689
Kokkos::ViewAllocateWithoutInitializing( "scratch" ), end - begin,
695690
num_comp );
696691

@@ -701,7 +696,8 @@ void permute(
701696
scratch( i - begin, n ) = view( permute_i, n );
702697
};
703698
auto policy =
704-
Kokkos::RangePolicy<typename DeviceType::execution_space>( begin, end );
699+
Kokkos::RangePolicy<typename BinningDataType::execution_space>( begin,
700+
end );
705701
Kokkos::parallel_for( "Cabana::kokkosBinSort::permute_to_scratch", policy,
706702
permute_to_scratch );
707703
Kokkos::fence();

core/src/Cabana_Utils.hpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,10 @@ namespace Impl
2626
{
2727
//! \cond Impl
2828

29-
// Custom warning for switch from device_type to memory_space.
29+
// Custom warning for use within static_assert.
3030
constexpr bool deprecated( std::false_type ) { return true; }
3131

32-
[[deprecated(
33-
"Template parameter should be converted from Kokkos device type to "
34-
"Kokkos memory space." )]] constexpr bool
32+
[[deprecated( "Cabana deprecation." )]] constexpr bool
3533
deprecated( std::true_type )
3634
{
3735
return true;

example/grid_tutorial/14_spline/spline_example.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ void splineExample()
3636
This includes the creation of a simple uniform mesh and a single particle
3737
position.
3838
*/
39-
using ExecutionSpace = Kokkos::DefaultHostExecutionSpace;
4039

4140
// Create a 3-dimensional global uniform mesh
4241
// Global bounding box.
@@ -67,7 +66,7 @@ void splineExample()
6766

6867
// Get the local mesh for this rank.
6968
auto local_mesh =
70-
Cabana::Grid::createLocalMesh<ExecutionSpace>( *local_grid );
69+
Cabana::Grid::createLocalMesh<Kokkos::HostSpace>( *local_grid );
7170

7271
// Create a particle position vector.
7372
double xp[3] = { 0.5, 2, 1.5 };

0 commit comments

Comments
 (0)