Skip to content

Commit 497087f

Browse files
authored
Merge pull request #830 from nitishingde/dev
Resolve issues #828 and #829
2 parents 2a8efb4 + e478b7f commit 497087f

File tree

2 files changed

+14
-45
lines changed

2 files changed

+14
-45
lines changed

grid/src/Cabana_Grid_Array.hpp

Lines changed: 0 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -774,14 +774,6 @@ struct DotFunctor
774774
dst[j] += src[j];
775775
}
776776

777-
//! Join operation.
778-
KOKKOS_INLINE_FUNCTION
779-
void join( volatile value_type dst, const volatile value_type src ) const
780-
{
781-
for ( size_type j = 0; j < value_count; ++j )
782-
dst[j] += src[j];
783-
}
784-
785777
//! Zero initialization.
786778
KOKKOS_INLINE_FUNCTION void init( value_type sum ) const
787779
{
@@ -882,15 +874,6 @@ struct NormInfFunctor
882874
dst[j] = src[j];
883875
}
884876

885-
//! Join operation.
886-
KOKKOS_INLINE_FUNCTION
887-
void join( volatile value_type dst, const volatile value_type src ) const
888-
{
889-
for ( size_type j = 0; j < value_count; ++j )
890-
if ( src[j] > dst[j] )
891-
dst[j] = src[j];
892-
}
893-
894877
//! Zero initialization.
895878
KOKKOS_INLINE_FUNCTION void init( value_type norm ) const
896879
{
@@ -984,14 +967,6 @@ struct Norm1Functor
984967
dst[j] += src[j];
985968
}
986969

987-
//! Join operation.
988-
KOKKOS_INLINE_FUNCTION
989-
void join( volatile value_type dst, const volatile value_type src ) const
990-
{
991-
for ( size_type j = 0; j < value_count; ++j )
992-
dst[j] += src[j];
993-
}
994-
995970
//! Zero initialization.
996971
KOKKOS_INLINE_FUNCTION void init( value_type norm ) const
997972
{
@@ -1085,14 +1060,6 @@ struct Norm2Functor
10851060
dst[j] += src[j];
10861061
}
10871062

1088-
//! Join operation.
1089-
KOKKOS_INLINE_FUNCTION
1090-
void join( volatile value_type dst, const volatile value_type src ) const
1091-
{
1092-
for ( size_type j = 0; j < value_count; ++j )
1093-
dst[j] += src[j];
1094-
}
1095-
10961063
//! Zero initialization.
10971064
KOKKOS_INLINE_FUNCTION void init( value_type norm ) const
10981065
{

grid/src/Cabana_Grid_IndexSpace.hpp

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -172,10 +172,11 @@ class IndexSpace
172172
*/
173173
template <class ExecutionSpace>
174174
Kokkos::RangePolicy<ExecutionSpace>
175-
createExecutionPolicy( const IndexSpace<1>& index_space, const ExecutionSpace& )
175+
createExecutionPolicy( const IndexSpace<1>& index_space,
176+
const ExecutionSpace& exec_space )
176177
{
177-
return Kokkos::RangePolicy<ExecutionSpace>( index_space.min( 0 ),
178-
index_space.max( 0 ) );
178+
return Kokkos::RangePolicy<ExecutionSpace>(
179+
exec_space, index_space.min( 0 ), index_space.max( 0 ) );
179180
}
180181

181182
//---------------------------------------------------------------------------//
@@ -187,11 +188,11 @@ createExecutionPolicy( const IndexSpace<1>& index_space, const ExecutionSpace& )
187188
*/
188189
template <class ExecutionSpace, class WorkTag>
189190
Kokkos::RangePolicy<ExecutionSpace, WorkTag>
190-
createExecutionPolicy( const IndexSpace<1>& index_space, const ExecutionSpace&,
191-
const WorkTag& )
191+
createExecutionPolicy( const IndexSpace<1>& index_space,
192+
const ExecutionSpace& exec_space, const WorkTag& )
192193
{
193-
return Kokkos::RangePolicy<ExecutionSpace, WorkTag>( index_space.min( 0 ),
194-
index_space.max( 0 ) );
194+
return Kokkos::RangePolicy<ExecutionSpace, WorkTag>(
195+
exec_space, index_space.min( 0 ), index_space.max( 0 ) );
195196
}
196197

197198
//---------------------------------------------------------------------------//
@@ -201,11 +202,12 @@ createExecutionPolicy( const IndexSpace<1>& index_space, const ExecutionSpace&,
201202
*/
202203
template <class IndexSpace_t, class ExecutionSpace>
203204
Kokkos::MDRangePolicy<ExecutionSpace, Kokkos::Rank<IndexSpace_t::Rank>>
204-
createExecutionPolicy( const IndexSpace_t& index_space, const ExecutionSpace& )
205+
createExecutionPolicy( const IndexSpace_t& index_space,
206+
const ExecutionSpace& exec_space )
205207
{
206208
return Kokkos::MDRangePolicy<ExecutionSpace,
207209
Kokkos::Rank<IndexSpace_t::Rank>>(
208-
index_space.min(), index_space.max() );
210+
exec_space, index_space.min(), index_space.max() );
209211
}
210212

211213
//---------------------------------------------------------------------------//
@@ -216,12 +218,12 @@ createExecutionPolicy( const IndexSpace_t& index_space, const ExecutionSpace& )
216218
*/
217219
template <class IndexSpace_t, class ExecutionSpace, class WorkTag>
218220
Kokkos::MDRangePolicy<ExecutionSpace, WorkTag, Kokkos::Rank<IndexSpace_t::Rank>>
219-
createExecutionPolicy( const IndexSpace_t& index_space, const ExecutionSpace&,
220-
const WorkTag& )
221+
createExecutionPolicy( const IndexSpace_t& index_space,
222+
const ExecutionSpace& exec_space, const WorkTag& )
221223
{
222224
return Kokkos::MDRangePolicy<ExecutionSpace, WorkTag,
223225
Kokkos::Rank<IndexSpace_t::Rank>>(
224-
index_space.min(), index_space.max() );
226+
exec_space, index_space.min(), index_space.max() );
225227
}
226228

227229
//---------------------------------------------------------------------------//

0 commit comments

Comments
 (0)