Skip to content

Commit

Permalink
Merge branch 'master' of github.com:trilinos/Trilinos
Browse files Browse the repository at this point in the history
  • Loading branch information
kddevin committed Feb 8, 2016
2 parents 6a8136d + 731f031 commit fbddd98
Show file tree
Hide file tree
Showing 331 changed files with 8,208 additions and 5,655 deletions.
6 changes: 3 additions & 3 deletions cmake/ctest/drivers/ride/cron_driver.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ export TDD_CTEST_TEST_TYPE=${JENKINS_JOB_TYPE}

# Machine specific environment
#
module load python/2.7.9
module load cmake/3.3.2
module load git/20150310
module load python/2.7.10
module load cmake/3.4.1
module load git/2.2.2

export TRIBITS_TDD_USE_SYSTEM_CTEST=1
export CUDA_LAUNCH_BLOCKING=1
Expand Down
6 changes: 4 additions & 2 deletions packages/belos/epetra/test/TFQMR/test_pseudo_ptfqmr_hb.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -176,9 +176,11 @@ int main(int argc, char *argv[]) {
// *****Construct solution std::vector and random right-hand-sides *****
//
RCP<Epetra_MultiVector> X = rcp( new Epetra_MultiVector(Map, numrhs) );
X->PutScalar( 0.0 );
RCP<Epetra_MultiVector> B = rcp( new Epetra_MultiVector(Map, numrhs) );
B->Random();
MVT::MvRandom( *X );
OPT::Apply( *A, *X, *B );
MVT::MvInit( *X, 0.0 );

Belos::LinearProblem<double,MV,OP> problem( A, X, B );
if (leftprec)
problem.setLeftPrec( Prec );
Expand Down
6 changes: 4 additions & 2 deletions packages/belos/epetra/test/TFQMR/test_ptfqmr_hb.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -176,9 +176,11 @@ int main(int argc, char *argv[]) {
// *****Construct solution std::vector and random right-hand-sides *****
//
RCP<Epetra_MultiVector> X = rcp( new Epetra_MultiVector(Map, numrhs) );
X->PutScalar( 0.0 );
RCP<Epetra_MultiVector> B = rcp( new Epetra_MultiVector(Map, numrhs) );
B->Random();
MVT::MvRandom( *X );
OPT::Apply( *A, *X, *B );
MVT::MvInit( *X, 0.0 );

Belos::LinearProblem<double,MV,OP> problem( A, X, B );
if (leftprec)
problem.setLeftPrec( Prec );
Expand Down
4 changes: 2 additions & 2 deletions packages/domi/src/Domi_Utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,8 @@ regularizeCommDims(int numProcs,
TEUCHOS_TEST_FOR_EXCEPTION(
(block != numProcs),
InvalidArgument,
"Product of axis processor sizes does not "
"equal total number of processors");
"Product of axis processor sizes (" << block << ") does not "
"equal total number of processors (" << numProcs << ")");
}
// For underspecified processor partitions, give the remainder to
// the first unspecified axis and set all the rest to 1
Expand Down
3 changes: 3 additions & 0 deletions packages/kokkos/core/src/Cuda/Kokkos_CudaExec.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,9 @@ struct CudaParallelLaunch< DriverType , true > {
Kokkos::Impl::throw_runtime_exception( std::string("CudaParallelLaunch FAILED: Functor is too large") );
}

// Fence before changing settings and copying closure
Kokkos::Cuda::fence();

if ( CudaTraits::SharedMemoryCapacity < shmem ) {
Kokkos::Impl::throw_runtime_exception( std::string("CudaParallelLaunch FAILED: shared memory request is too large") );
}
Expand Down
8 changes: 4 additions & 4 deletions packages/kokkos/core/src/Cuda/Kokkos_Cuda_Parallel.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1082,14 +1082,14 @@ class ParallelScan< FunctorType
template< class TagType >
__device__ inline
typename std::enable_if< std::is_same< TagType , void >::value >::type
exec_range( const Member & i , reference_type update , const bool final ) const
{ m_functor( i , update , final ); }
exec_range( const Member & i , reference_type update , const bool final_result ) const
{ m_functor( i , update , final_result ); }

template< class TagType >
__device__ inline
typename std::enable_if< ! std::is_same< TagType , void >::value >::type
exec_range( const Member & i , reference_type update , const bool final ) const
{ m_functor( TagType() , i , update , final ); }
exec_range( const Member & i , reference_type update , const bool final_result ) const
{ m_functor( TagType() , i , update , final_result ); }

//----------------------------------------

Expand Down
6 changes: 4 additions & 2 deletions packages/kokkos/core/src/Cuda/Kokkos_Cuda_TaskPolicy.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -586,15 +586,17 @@ class TaskPolicy< Kokkos::Cuda >

template< class ValueType >
const Future< ValueType , execution_space > &
spawn( const Future< ValueType , execution_space > & f ) const
spawn( const Future< ValueType , execution_space > & f
, const bool priority = false ) const
{
f.m_task->schedule();
return f ;
}

template< class FunctorType >
KOKKOS_INLINE_FUNCTION
void respawn( FunctorType * task_functor ) const
void respawn( FunctorType * task_functor
, const bool priority = false ) const
{ get_task_root(task_functor)->reschedule(); }

//----------------------------------------
Expand Down
137 changes: 107 additions & 30 deletions packages/kokkos/core/src/KokkosExp_View.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -403,12 +403,35 @@ constexpr Kokkos::Experimental::Impl::AllowPadding_t
*/
template< class ... Args >
inline
Impl::ViewAllocProp< typename Impl::ViewAllocProp< void , Args >::type ... >
Impl::ViewCtorProp< typename Impl::ViewCtorProp< void , Args >::type ... >
view_alloc( Args const & ... args )
{
return
Impl::ViewAllocProp< typename Impl::ViewAllocProp< void , Args >::type ... >
( args... );
typedef
Impl::ViewCtorProp< typename Impl::ViewCtorProp< void , Args >::type ... >
return_type ;

static_assert( ! return_type::has_pointer
, "Cannot give pointer-to-memory for view allocation" );

return return_type( args... );
}

template< class ... Args >
inline
Impl::ViewCtorProp< typename Impl::ViewCtorProp< void , Args >::type ... >
view_wrap( Args const & ... args )
{
typedef
Impl::ViewCtorProp< typename Impl::ViewCtorProp< void , Args >::type ... >
return_type ;

static_assert( ! return_type::has_memory_space &&
! return_type::has_execution_space &&
! return_type::has_label &&
return_type::has_pointer
, "Must only give pointer-to-memory for view wrapping" );

return return_type( args... );
}

} /* namespace Experimental */
Expand All @@ -435,7 +458,12 @@ class View : public ViewTraits< DataType , Properties ... > {
template< class , class ... > friend class View ;
template< class , class ... > friend class Impl::ViewMapping ;

typedef ViewTraits< DataType , Properties ... > traits ;
public:

typedef ViewTraits< DataType , Properties ... > traits ;

private:

typedef Kokkos::Experimental::Impl::ViewMapping< traits , void > map_type ;
typedef Kokkos::Experimental::Impl::SharedAllocationTracker track_type ;

Expand Down Expand Up @@ -489,6 +517,10 @@ class View : public ViewTraits< DataType , Properties ... > {
extent_int( const iType & r ) const
{ return static_cast<int>(m_map.extent(r)); }

KOKKOS_INLINE_FUNCTION constexpr
typename traits::array_layout layout() const
{ return m_map.layout(); }

//----------------------------------------
/* Deprecate all 'dimension' functions in favor of
* ISO/C++ vocabulary 'extent'.
Expand Down Expand Up @@ -554,7 +586,8 @@ class View : public ViewTraits< DataType , Properties ... > {
// Allow specializations to query their specialized map

KOKKOS_INLINE_FUNCTION
const map_type & implementation_map() const { return m_map ; }
const Kokkos::Experimental::Impl::ViewMapping< traits , void > &
implementation_map() const { return m_map ; }

//----------------------------------------

Expand Down Expand Up @@ -1131,18 +1164,20 @@ class View : public ViewTraits< DataType , Properties ... > {

template< class ... P >
explicit inline
View( const Impl::ViewAllocProp< P ... > & arg_prop
, const typename traits::array_layout & arg_layout
View( const Impl::ViewCtorProp< P ... > & arg_prop
, typename std::enable_if< ! Impl::ViewCtorProp< P... >::has_pointer
, typename traits::array_layout
>::type const & arg_layout
)
: m_track()
, m_map()
{
// Append layout and spaces if not input
typedef Impl::ViewAllocProp< P ... > alloc_prop_input ;
typedef Impl::ViewCtorProp< P ... > alloc_prop_input ;

// use 'std::integral_constant<unsigned,I>' for non-types
// to avoid duplicate class error.
typedef Impl::ViewAllocProp
typedef Impl::ViewCtorProp
< P ...
, typename std::conditional
< alloc_prop_input::has_label
Expand Down Expand Up @@ -1181,11 +1216,31 @@ class View : public ViewTraits< DataType , Properties ... > {
m_track.assign_allocated_record_to_uninitialized( record );
}

// Wrap memory according to properties and array layout
template< class ... P >
explicit KOKKOS_INLINE_FUNCTION
View( const Impl::ViewCtorProp< P ... > & arg_prop
, typename std::enable_if< Impl::ViewCtorProp< P... >::has_pointer
, typename traits::array_layout
>::type const & arg_layout
)
: m_track() // No memory tracking
, m_map( arg_prop , arg_layout )
{
static_assert(
std::is_same< pointer_type
, typename Impl::ViewCtorProp< P... >::pointer_type
>::value ,
"Constructing View to wrap user memory must supply matching pointer type" );
}

// Simple dimension-only layout
template< class ... P >
explicit inline
View( const Impl::ViewAllocProp< P ... > & arg_prop
, const size_t arg_N0 = 0
View( const Impl::ViewCtorProp< P ... > & arg_prop
, typename std::enable_if< ! Impl::ViewCtorProp< P... >::has_pointer
, size_t
>::type const arg_N0 = 0
, const size_t arg_N1 = 0
, const size_t arg_N2 = 0
, const size_t arg_N3 = 0
Expand All @@ -1201,20 +1256,44 @@ class View : public ViewTraits< DataType , Properties ... > {
)
{}

// Label and layout
template< class ... P >
explicit KOKKOS_INLINE_FUNCTION
View( const Impl::ViewCtorProp< P ... > & arg_prop
, typename std::enable_if< Impl::ViewCtorProp< P... >::has_pointer
, size_t
>::type const arg_N0 = 0
, const size_t arg_N1 = 0
, const size_t arg_N2 = 0
, const size_t arg_N3 = 0
, const size_t arg_N4 = 0
, const size_t arg_N5 = 0
, const size_t arg_N6 = 0
, const size_t arg_N7 = 0
)
: View( arg_prop
, typename traits::array_layout
( arg_N0 , arg_N1 , arg_N2 , arg_N3
, arg_N4 , arg_N5 , arg_N6 , arg_N7 )
)
{}

// Allocate with label and layout
template< typename Label >
explicit inline
View( const Label & arg_label
, const typename traits::array_layout & arg_layout
, typename std::enable_if<
Kokkos::Experimental::Impl::is_view_label<Label>::value ,
typename traits::array_layout >::type const & arg_layout
)
: View( Impl::ViewAllocProp< std::string >( arg_label ) , arg_layout )
: View( Impl::ViewCtorProp< std::string >( arg_label ) , arg_layout )
{}

// Label and layout, must disambiguate from subview constructor.
// Allocate label and layout, must disambiguate from subview constructor.
template< typename Label >
explicit inline
View( const Label & arg_label
, typename std::enable_if< Kokkos::Experimental::Impl::is_view_label<Label>::value ,
, typename std::enable_if<
Kokkos::Experimental::Impl::is_view_label<Label>::value ,
const size_t >::type arg_N0 = 0
, const size_t arg_N1 = 0
, const size_t arg_N2 = 0
Expand All @@ -1224,7 +1303,7 @@ class View : public ViewTraits< DataType , Properties ... > {
, const size_t arg_N6 = 0
, const size_t arg_N7 = 0
)
: View( Impl::ViewAllocProp< std::string >( arg_label )
: View( Impl::ViewCtorProp< std::string >( arg_label )
, typename traits::array_layout
( arg_N0 , arg_N1 , arg_N2 , arg_N3
, arg_N4 , arg_N5 , arg_N6 , arg_N7 )
Expand All @@ -1236,7 +1315,7 @@ class View : public ViewTraits< DataType , Properties ... > {
View( const ViewAllocateWithoutInitializing & arg_prop
, const typename traits::array_layout & arg_layout
)
: View( Impl::ViewAllocProp< std::string , Kokkos::Experimental::Impl::WithoutInitializing_t >( arg_prop.label , Kokkos::Experimental::WithoutInitializing )
: View( Impl::ViewCtorProp< std::string , Kokkos::Experimental::Impl::WithoutInitializing_t >( arg_prop.label , Kokkos::Experimental::WithoutInitializing )
, arg_layout
)
{}
Expand All @@ -1252,7 +1331,7 @@ class View : public ViewTraits< DataType , Properties ... > {
, const size_t arg_N6 = 0
, const size_t arg_N7 = 0
)
: View( Impl::ViewAllocProp< std::string , Kokkos::Experimental::Impl::WithoutInitializing_t >( arg_prop.label , Kokkos::Experimental::WithoutInitializing )
: View( Impl::ViewCtorProp< std::string , Kokkos::Experimental::Impl::WithoutInitializing_t >( arg_prop.label , Kokkos::Experimental::WithoutInitializing )
, typename traits::array_layout
( arg_N0 , arg_N1 , arg_N2 , arg_N3
, arg_N4 , arg_N5 , arg_N6 , arg_N7 )
Expand Down Expand Up @@ -1288,20 +1367,18 @@ class View : public ViewTraits< DataType , Properties ... > {
, const size_t arg_N6 = 0
, const size_t arg_N7 = 0
)
: m_track() // No memory tracking
, m_map( arg_ptr
, typename traits::array_layout
( arg_N0 , arg_N1 , arg_N2 , arg_N3
, arg_N4 , arg_N5 , arg_N6 , arg_N7 )
)
: View( Impl::ViewCtorProp<pointer_type>(arg_ptr)
, typename traits::array_layout
( arg_N0 , arg_N1 , arg_N2 , arg_N3
, arg_N4 , arg_N5 , arg_N6 , arg_N7 )
)
{}

explicit KOKKOS_INLINE_FUNCTION
View( pointer_type arg_ptr
, typename traits::array_layout & arg_layout
)
: m_track() // No memory tracking
, m_map( arg_ptr , arg_layout )
: View( Impl::ViewCtorProp<pointer_type>(arg_ptr) , arg_layout )
{}

//----------------------------------------
Expand Down Expand Up @@ -1334,12 +1411,12 @@ class View : public ViewTraits< DataType , Properties ... > {
, const size_t arg_N6 = 0
, const size_t arg_N7 = 0 )
: m_track() // No memory tracking
, m_map( reinterpret_cast<pointer_type>(
, m_map( Impl::ViewCtorProp<pointer_type>( reinterpret_cast<pointer_type>(
arg_space.get_shmem(
map_type::memory_span(
typename traits::array_layout
( arg_N0 , arg_N1 , arg_N2 , arg_N3
, arg_N4 , arg_N5 , arg_N6 , arg_N7 ) ) ) )
, arg_N4 , arg_N5 , arg_N6 , arg_N7 ) ) ) ) )
, typename traits::array_layout
( arg_N0 , arg_N1 , arg_N2 , arg_N3
, arg_N4 , arg_N5 , arg_N6 , arg_N7 )
Expand Down
14 changes: 14 additions & 0 deletions packages/kokkos/core/src/Kokkos_Layout.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,20 @@ struct LayoutStride {
}
return tmp ;
}

KOKKOS_INLINE_FUNCTION constexpr
LayoutStride( size_t N0 = 0 , size_t S0 = 0
, size_t N1 = 0 , size_t S1 = 0
, size_t N2 = 0 , size_t S2 = 0
, size_t N3 = 0 , size_t S3 = 0
, size_t N4 = 0 , size_t S4 = 0
, size_t N5 = 0 , size_t S5 = 0
, size_t N6 = 0 , size_t S6 = 0
, size_t N7 = 0 , size_t S7 = 0
)
: dimension { N0 , N1 , N2 , N3 , N4 , N5 , N6 , N7 }
, stride { S0 , S1 , S2 , S3 , S4 , S5 , S6 , S7 }
{}
};

//----------------------------------------------------------------------------
Expand Down
Loading

0 comments on commit fbddd98

Please sign in to comment.