Updating Kokkos lib

This commit is contained in:
Stan Moore
2017-02-13 10:50:34 -07:00
parent cb982f2f28
commit 383da816c2
180 changed files with 3657 additions and 1100 deletions

View File

@ -53,6 +53,8 @@ struct TestScan {
typedef Device execution_space ;
typedef long int value_type ;
Kokkos::View<int,Device,Kokkos::MemoryTraits<Kokkos::Atomic> > errors;
KOKKOS_INLINE_FUNCTION
void operator()( const int iwork , value_type & update , const bool final_pass ) const
{
@ -69,7 +71,9 @@ struct TestScan {
const value_type answer = n & 1 ? ( n * ( ( n + 1 ) / 2 ) ) : ( ( n / 2 ) * ( n + 1 ) );
if ( answer != update ) {
printf("TestScan(%d,%ld) != %ld\n",iwork,update,answer);
errors()++;
if(errors()<20)
printf("TestScan(%d,%ld) != %ld\n",iwork,update,answer);
}
}
}
@ -83,11 +87,21 @@ struct TestScan {
{ update += input ; }
TestScan( const WorkSpec & N )
{ parallel_scan( N , *this ); }
{
Kokkos::View<int,Device > errors_a("Errors");
Kokkos::deep_copy(errors_a,0);
errors = errors_a;
parallel_scan( N , *this );
}
TestScan( const WorkSpec & Start , const WorkSpec & N )
{
typedef Kokkos::RangePolicy<execution_space> exec_policy ;
Kokkos::View<int,Device > errors_a("Errors");
Kokkos::deep_copy(errors_a,0);
errors = errors_a;
parallel_scan( exec_policy( Start , N ) , *this );
}