Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Benchmark compilation issues on lassen / pecan with cpp17 + cuda11 #294

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 48 additions & 6 deletions benchmarks/benchmarkArray1DR2TensorMultiplicationKernels.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -137,9 +137,30 @@ class ArrayOfR2TensorsNative

void RAJAView() const
{
RajaView< VALUE_TYPE const, PERMUTATION > const a = makeRajaView( m_a );
RajaView< VALUE_TYPE const, PERMUTATION > const b = makeRajaView( m_b );
RajaView< VALUE_TYPE, PERMUTATION > const c = makeRajaView( m_c );
constexpr int NDIM = typeManipulation::getDimension< PERMUTATION >;
constexpr std::array< camp::idx_t, NDIM > const permutation = RAJA::as_array< PERMUTATION >::get();

std::array< INDEX_TYPE, NDIM > a_sizes;
for( int i = 0; i < NDIM; ++i )
{
a_sizes[ i ] = m_a.dims()[ i ];
}
RajaView< VALUE_TYPE const, PERMUTATION > const a = RajaView< VALUE_TYPE const, PERMUTATION >( m_a.data(), RAJA::make_permuted_layout( a_sizes, permutation ) );

std::array< INDEX_TYPE, NDIM > b_sizes;
for( int i = 0; i < NDIM; ++i )
{
b_sizes[ i ] = m_b.dims()[ i ];
}
RajaView< VALUE_TYPE const, PERMUTATION > const b = RajaView< VALUE_TYPE const, PERMUTATION >( m_b.data(), RAJA::make_permuted_layout( b_sizes, permutation ) );

std::array< INDEX_TYPE, NDIM > c_sizes;
for( int i = 0; i < NDIM; ++i )
{
c_sizes[ i ] = m_c.dims()[ i ];
}
RajaView< VALUE_TYPE, PERMUTATION > const c = RajaView< VALUE_TYPE, PERMUTATION >( m_c.data(), RAJA::make_permuted_layout( c_sizes, permutation ) );

TIMING_LOOP( RAJAViewKernel( a, b, c ) );
}

Expand Down Expand Up @@ -308,9 +329,30 @@ class ArrayOfR2TensorsRAJA : private ArrayOfR2TensorsNative< PERMUTATION >

void RAJAView() const
{
RajaView< VALUE_TYPE const, PERMUTATION > const a = makeRajaView( this->m_a );
RajaView< VALUE_TYPE const, PERMUTATION > const b = makeRajaView( this->m_b );
RajaView< VALUE_TYPE, PERMUTATION > const c = makeRajaView( this->m_c );
constexpr int NDIM = typeManipulation::getDimension< PERMUTATION >;
constexpr std::array< camp::idx_t, NDIM > const permutation = RAJA::as_array< PERMUTATION >::get();

std::array< INDEX_TYPE, NDIM > a_sizes;
for( int i = 0; i < NDIM; ++i )
{
a_sizes[ i ] = m_a.dims()[ i ];
}
RajaView< VALUE_TYPE const, PERMUTATION > const a = RajaView< VALUE_TYPE const, PERMUTATION >( m_a.data(), RAJA::make_permuted_layout( a_sizes, permutation ) );

std::array< INDEX_TYPE, NDIM > b_sizes;
for( int i = 0; i < NDIM; ++i )
{
b_sizes[ i ] = m_b.dims()[ i ];
}
RajaView< VALUE_TYPE const, PERMUTATION > const b = RajaView< VALUE_TYPE const, PERMUTATION >( m_b.data(), RAJA::make_permuted_layout( b_sizes, permutation ) );

std::array< INDEX_TYPE, NDIM > c_sizes;
for( int i = 0; i < NDIM; ++i )
{
c_sizes[ i ] = m_c.dims()[ i ];
}
RajaView< VALUE_TYPE, PERMUTATION > const c = RajaView< VALUE_TYPE, PERMUTATION >( m_c.data(), RAJA::make_permuted_layout( c_sizes, permutation ) );

TIMING_LOOP( RAJAViewKernel( a, b, c ) );
}

Expand Down
12 changes: 6 additions & 6 deletions benchmarks/benchmarkHelpers.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,11 @@ inline std::string typeToString( RAJA::PERM_KJI const & ) { return "RAJA::PERM_K
using INDEX_TYPE = std::ptrdiff_t;

template< typename T, typename PERMUTATION >
using ArrayT = LvArray::Array< T, typeManipulation::getDimension< PERMUTATION >, PERMUTATION, INDEX_TYPE, DEFAULT_BUFFER >;
using ArrayT = LvArray::Array< T,
typeManipulation::getDimension< PERMUTATION >,
PERMUTATION,
INDEX_TYPE,
DEFAULT_BUFFER >;

template< typename T, typename PERMUTATION >
using ArrayViewT = LvArray::ArrayView< T,
Expand All @@ -83,9 +87,7 @@ INDEX_TYPE >;

template< typename T, typename PERMUTATION >
using RajaView = RAJA::View< T,
RAJA::Layout< typeManipulation::getDimension< PERMUTATION >,
INDEX_TYPE,
typeManipulation::getStrideOneDimension( PERMUTATION {} ) >>;
RAJA::Layout< typeManipulation::getDimension< PERMUTATION >, INDEX_TYPE, typeManipulation::getStrideOneDimension( PERMUTATION {} ) >>;

template< typename T >
using ArrayOfArraysT = ArrayOfArrays< T, INDEX_TYPE, DEFAULT_BUFFER >;
Expand Down Expand Up @@ -162,7 +164,6 @@ void initialize( ArraySlice< T, NDIM, USD, INDEX_TYPE > const slice, int & iter
} );
}


template< typename T, typename PERMUTATION >
RajaView< T, PERMUTATION > makeRajaView( ArrayT< T, PERMUTATION > const & array )
{
Expand All @@ -178,7 +179,6 @@ RajaView< T, PERMUTATION > makeRajaView( ArrayT< T, PERMUTATION > const & array
return RajaView< T, PERMUTATION >( array.data(), RAJA::make_permuted_layout( sizes, permutation ) );
}


template< typename T, typename PERMUTATION >
INDEX_TYPE reduce( ArrayT< T, PERMUTATION > const & array )
{
Expand Down
36 changes: 32 additions & 4 deletions benchmarks/benchmarkInnerProductKernels.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,22 @@ class InnerProductNative

void RAJAView()
{
RajaView< VALUE_TYPE const, RAJA::PERM_I > const a = makeRajaView( m_a );
RajaView< VALUE_TYPE const, RAJA::PERM_I > const b = makeRajaView( m_b );
constexpr int NDIM = typeManipulation::getDimension< RAJA::PERM_I >;
constexpr std::array< camp::idx_t, NDIM > const permutation = RAJA::as_array< RAJA::PERM_I >::get();

std::array< INDEX_TYPE, NDIM > a_sizes;
for( int i = 0; i < NDIM; ++i )
{
a_sizes[ i ] = m_a.dims()[ i ];
}
RajaView< VALUE_TYPE const, RAJA::PERM_I > const a = RajaView< VALUE_TYPE const, RAJA::PERM_I >( m_a.data(), RAJA::make_permuted_layout( a_sizes, permutation ) );

std::array< INDEX_TYPE, NDIM > b_sizes;
for( int i = 0; i < NDIM; ++i )
{
b_sizes[ i ] = m_b.dims()[ i ];
}
RajaView< VALUE_TYPE const, RAJA::PERM_I > const b = RajaView< VALUE_TYPE const, RAJA::PERM_I >( m_b.data(), RAJA::make_permuted_layout( b_sizes, permutation ) );
TIMING_LOOP( RAJAViewKernel( a, b ) );
}

Expand Down Expand Up @@ -180,8 +194,22 @@ class InnerProductRAJA : public InnerProductNative

void RAJAView()
{
RajaView< VALUE_TYPE const, RAJA::PERM_I > const a = makeRajaView( m_a );
RajaView< VALUE_TYPE const, RAJA::PERM_I > const b = makeRajaView( m_b );
constexpr int NDIM = typeManipulation::getDimension< RAJA::PERM_I >;
constexpr std::array< camp::idx_t, NDIM > const permutation = RAJA::as_array< RAJA::PERM_I >::get();

std::array< INDEX_TYPE, NDIM > a_sizes;
for( int i = 0; i < NDIM; ++i )
{
a_sizes[ i ] = m_a.dims()[ i ];
}
RajaView< VALUE_TYPE const, RAJA::PERM_I > const a = RajaView< VALUE_TYPE const, RAJA::PERM_I >( m_a.data(), RAJA::make_permuted_layout( a_sizes, permutation ) );

std::array< INDEX_TYPE, NDIM > b_sizes;
for( int i = 0; i < NDIM; ++i )
{
b_sizes[ i ] = m_b.dims()[ i ];
}
RajaView< VALUE_TYPE const, RAJA::PERM_I > const b = RajaView< VALUE_TYPE const, RAJA::PERM_I >( m_b.data(), RAJA::make_permuted_layout( b_sizes, permutation ) );
TIMING_LOOP( RAJAViewKernel( a, b ) );
}

Expand Down
52 changes: 46 additions & 6 deletions benchmarks/benchmarkMatrixMatrixKernels.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -96,9 +96,29 @@ class MatrixMatrixNative

void RAJAView() const
{
RajaView< VALUE_TYPE const, PERMUTATION > const a = makeRajaView( m_a );
RajaView< VALUE_TYPE const, PERMUTATION > const b = makeRajaView( m_b );
RajaView< VALUE_TYPE, PERMUTATION > const c = makeRajaView( m_c );
constexpr int NDIM = typeManipulation::getDimension< PERMUTATION >;
constexpr std::array< camp::idx_t, NDIM > const permutation = RAJA::as_array< PERMUTATION >::get();

std::array< INDEX_TYPE, NDIM > a_sizes;
for( int i = 0; i < NDIM; ++i )
{
a_sizes[ i ] = m_a.dims()[ i ];
}
RajaView< VALUE_TYPE const, PERMUTATION > const a = RajaView< VALUE_TYPE const, PERMUTATION >( m_a.data(), RAJA::make_permuted_layout( a_sizes, permutation ) );

std::array< INDEX_TYPE, NDIM > b_sizes;
for( int i = 0; i < NDIM; ++i )
{
b_sizes[ i ] = m_b.dims()[ i ];
}
RajaView< VALUE_TYPE const, PERMUTATION > const b = RajaView< VALUE_TYPE const, PERMUTATION >( m_b.data(), RAJA::make_permuted_layout( b_sizes, permutation ) );

std::array< INDEX_TYPE, NDIM > c_sizes;
for( int i = 0; i < NDIM; ++i )
{
c_sizes[ i ] = m_c.dims()[ i ];
}
RajaView< VALUE_TYPE, PERMUTATION > const c = RajaView< VALUE_TYPE, PERMUTATION >( m_c.data(), RAJA::make_permuted_layout( c_sizes, permutation ) );
TIMING_LOOP( RAJAViewKernel( a, b, c ); )
}

Expand Down Expand Up @@ -206,9 +226,29 @@ class MatrixMatrixRAJA : public MatrixMatrixNative< PERMUTATION >

void RAJAView() const
{
RajaView< VALUE_TYPE const, PERMUTATION > const a = makeRajaView( this->m_a );
RajaView< VALUE_TYPE const, PERMUTATION > const b = makeRajaView( this->m_b );
RajaView< VALUE_TYPE, PERMUTATION > const c = makeRajaView( this->m_c );
constexpr int NDIM = typeManipulation::getDimension< PERMUTATION >;
constexpr std::array< camp::idx_t, NDIM > const permutation = RAJA::as_array< PERMUTATION >::get();

std::array< INDEX_TYPE, NDIM > a_sizes;
for( int i = 0; i < NDIM; ++i )
{
a_sizes[ i ] = this->m_a.dims()[ i ];
}
RajaView< VALUE_TYPE const, PERMUTATION > const a = RajaView< VALUE_TYPE const, PERMUTATION >( this->m_a.data(), RAJA::make_permuted_layout( a_sizes, permutation ) );

std::array< INDEX_TYPE, NDIM > b_sizes;
for( int i = 0; i < NDIM; ++i )
{
b_sizes[ i ] = this->m_b.dims()[ i ];
}
RajaView< VALUE_TYPE const, PERMUTATION > const b = RajaView< VALUE_TYPE const, PERMUTATION >( this->m_b.data(), RAJA::make_permuted_layout( b_sizes, permutation ) );

std::array< INDEX_TYPE, NDIM > c_sizes;
for( int i = 0; i < NDIM; ++i )
{
c_sizes[ i ] = this->m_c.dims()[ i ];
}
RajaView< VALUE_TYPE, PERMUTATION > const c = RajaView< VALUE_TYPE, PERMUTATION >( this->m_c.data(), RAJA::make_permuted_layout( c_sizes, permutation ) );
TIMING_LOOP( RAJAViewKernel( a, b, c ); )
}

Expand Down
60 changes: 54 additions & 6 deletions benchmarks/benchmarkMatrixVectorKernels.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,33 @@ class MatrixVectorNative

void RAJAView() const
{
RajaView< VALUE_TYPE const, PERMUTATION > const a = makeRajaView( m_a );
RajaView< VALUE_TYPE const, RAJA::PERM_I > const b = makeRajaView( m_b );
RajaView< VALUE_TYPE, RAJA::PERM_I > const c = makeRajaView( m_c );
constexpr int NDIM = typeManipulation::getDimension< PERMUTATION >;
constexpr std::array< camp::idx_t, NDIM > const permutation = RAJA::as_array< PERMUTATION >::get();

std::array< INDEX_TYPE, NDIM > a_sizes;
for( int i = 0; i < NDIM; ++i )
{
a_sizes[ i ] = m_a.dims()[ i ];
}
RajaView< VALUE_TYPE const, PERMUTATION > const a = RajaView< VALUE_TYPE const, PERMUTATION >( m_a.data(), RAJA::make_permuted_layout( a_sizes, permutation ) );

constexpr int NDIM_I = typeManipulation::getDimension< RAJA::PERM_I >;
constexpr std::array< camp::idx_t, NDIM_I > const permutation_I = RAJA::as_array< RAJA::PERM_I >::get();

std::array< INDEX_TYPE, NDIM_I > b_sizes;
for( int i = 0; i < NDIM_I; ++i )
{
b_sizes[ i ] = m_b.dims()[ i ];
}
RajaView< VALUE_TYPE const, RAJA::PERM_I > const b = RajaView< VALUE_TYPE const, RAJA::PERM_I >( m_b.data(), RAJA::make_permuted_layout( b_sizes, permutation_I ) );

std::array< INDEX_TYPE, NDIM_I > c_sizes;
for( int i = 0; i < NDIM_I; ++i )
{
c_sizes[ i ] = m_c.dims()[ i ];
}
RajaView< VALUE_TYPE, RAJA::PERM_I > const c = RajaView< VALUE_TYPE, RAJA::PERM_I >( m_c.data(), RAJA::make_permuted_layout( c_sizes, permutation_I ) );

TIMING_LOOP( RAJAViewKernel( a, b, c ); )
}

Expand Down Expand Up @@ -204,9 +228,33 @@ class MatrixVectorRAJA : public MatrixVectorNative< PERMUTATION >

void RAJAView() const
{
RajaView< VALUE_TYPE const, PERMUTATION > const a = makeRajaView( this->m_a );
RajaView< VALUE_TYPE const, RAJA::PERM_I > const b = makeRajaView( this->m_b );
RajaView< VALUE_TYPE, RAJA::PERM_I > const c = makeRajaView( this->m_c );
constexpr int NDIM = typeManipulation::getDimension< PERMUTATION >;
constexpr std::array< camp::idx_t, NDIM > const permutation = RAJA::as_array< PERMUTATION >::get();

std::array< INDEX_TYPE, NDIM > a_sizes;
for( int i = 0; i < NDIM; ++i )
{
a_sizes[ i ] = this->m_a.dims()[ i ];
}
RajaView< VALUE_TYPE const, PERMUTATION > const a = RajaView< VALUE_TYPE const, PERMUTATION >( this->m_a.data(), RAJA::make_permuted_layout( a_sizes, permutation ) );

constexpr int NDIM_I = typeManipulation::getDimension< RAJA::PERM_I >;
constexpr std::array< camp::idx_t, NDIM_I > const permutation_I = RAJA::as_array< RAJA::PERM_I >::get();

std::array< INDEX_TYPE, NDIM_I > b_sizes;
for( int i = 0; i < NDIM_I; ++i )
{
b_sizes[ i ] = this->m_b.dims()[ i ];
}
RajaView< VALUE_TYPE const, RAJA::PERM_I > const b = RajaView< VALUE_TYPE const, RAJA::PERM_I >( this->m_b.data(), RAJA::make_permuted_layout( b_sizes, permutation_I ) );

std::array< INDEX_TYPE, NDIM_I > c_sizes;
for( int i = 0; i < NDIM_I; ++i )
{
c_sizes[ i ] = this->m_c.dims()[ i ];
}
RajaView< VALUE_TYPE, RAJA::PERM_I > const c = RajaView< VALUE_TYPE, RAJA::PERM_I >( this->m_c.data(), RAJA::make_permuted_layout( c_sizes, permutation_I ) );

TIMING_LOOP( RAJAViewKernel( a, b, c ); )
}

Expand Down
4 changes: 2 additions & 2 deletions benchmarks/benchmarkOuterProduct.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ void registerBenchmarks()
REGISTER_BENCHMARK_TEMPLATE( WRAP( { SERIAL_N, SERIAL_M } ), RAJAViewNative, PERMUTATION );
REGISTER_BENCHMARK_TEMPLATE( WRAP( { SERIAL_N, SERIAL_M } ), pointerNative, PERMUTATION );
},
RAJA::PERM_IJ {}
RAJA::PERM_IJ {}
, RAJA::PERM_JI {}
);

Expand All @@ -163,7 +163,7 @@ void registerBenchmarks()
REGISTER_BENCHMARK_TEMPLATE( WRAP( { N, M } ), RAJAViewRAJA, PERMUTATION, POLICY );
REGISTER_BENCHMARK_TEMPLATE( WRAP( { N, M } ), pointerRAJA, PERMUTATION, POLICY );
},
std::make_tuple( SERIAL_N, SERIAL_M, RAJA::PERM_IJ {}, serialPolicy {} )
std::make_tuple( SERIAL_N, SERIAL_M, RAJA::PERM_IJ {}, serialPolicy {} )
, std::make_tuple( SERIAL_N, SERIAL_M, RAJA::PERM_JI {}, serialPolicy {} )
#if defined(RAJA_ENABLE_OPENMP)
, std::make_tuple( OMP_N, OMP_M, RAJA::PERM_IJ {}, parallelHostPolicy {} )
Expand Down
56 changes: 50 additions & 6 deletions benchmarks/benchmarkOuterProductKernels.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,31 @@ class OuterProductNative

void RAJAView() const
{
RajaView< VALUE_TYPE const, RAJA::PERM_I > const a = makeRajaView( m_a );
RajaView< VALUE_TYPE const, RAJA::PERM_I > const b = makeRajaView( m_b );
RajaView< VALUE_TYPE, PERMUTATION > const c = makeRajaView( m_c );
constexpr int NDIM_I = typeManipulation::getDimension< RAJA::PERM_I >;
constexpr std::array< camp::idx_t, NDIM_I > const permutation_I = RAJA::as_array< RAJA::PERM_I >::get();

std::array< INDEX_TYPE, NDIM_I > a_sizes;
for( int i = 0; i < NDIM_I; ++i )
{
a_sizes[ i ] = m_a.dims()[ i ];
}
RajaView< VALUE_TYPE const, RAJA::PERM_I > const a = RajaView< VALUE_TYPE const, RAJA::PERM_I >( m_a.data(), RAJA::make_permuted_layout( a_sizes, permutation_I ) );

std::array< INDEX_TYPE, NDIM_I > b_sizes;
for( int i = 0; i < NDIM_I; ++i )
{
b_sizes[ i ] = m_b.dims()[ i ];
}
RajaView< VALUE_TYPE const, RAJA::PERM_I > const b = RajaView< VALUE_TYPE const, RAJA::PERM_I >( m_b.data(), RAJA::make_permuted_layout( b_sizes, permutation_I ) );

constexpr int NDIM = typeManipulation::getDimension< PERMUTATION >;
constexpr std::array< camp::idx_t, NDIM > const permutation = RAJA::as_array< PERMUTATION >::get();
std::array< INDEX_TYPE, NDIM > c_sizes;
for( int i = 0; i < NDIM; ++i )
{
c_sizes[ i ] = m_c.dims()[ i ];
}
RajaView< VALUE_TYPE, PERMUTATION > const c = RajaView< VALUE_TYPE, PERMUTATION >( m_c.data(), RAJA::make_permuted_layout( c_sizes, permutation ) );
TIMING_LOOP( RAJAViewKernel( a, b, c ); )
}

Expand Down Expand Up @@ -204,9 +226,31 @@ class OuterProductRAJA : public OuterProductNative< PERMUTATION >

void RAJAView() const
{
RajaView< VALUE_TYPE const, RAJA::PERM_I > const a = makeRajaView( this->m_a );
RajaView< VALUE_TYPE const, RAJA::PERM_I > const b = makeRajaView( this->m_b );
RajaView< VALUE_TYPE, PERMUTATION > const c = makeRajaView( this->m_c );
constexpr int NDIM_I = typeManipulation::getDimension< RAJA::PERM_I >;
constexpr std::array< camp::idx_t, NDIM_I > const permutation_I = RAJA::as_array< RAJA::PERM_I >::get();

std::array< INDEX_TYPE, NDIM_I > a_sizes;
for( int i = 0; i < NDIM_I; ++i )
{
a_sizes[ i ] = this->m_a.dims()[ i ];
}
RajaView< VALUE_TYPE const, RAJA::PERM_I > const a = RajaView< VALUE_TYPE const, RAJA::PERM_I >( this->m_a.data(), RAJA::make_permuted_layout( a_sizes, permutation_I ) );

std::array< INDEX_TYPE, NDIM_I > b_sizes;
for( int i = 0; i < NDIM_I; ++i )
{
b_sizes[ i ] = this->m_b.dims()[ i ];
}
RajaView< VALUE_TYPE const, RAJA::PERM_I > const b = RajaView< VALUE_TYPE const, RAJA::PERM_I >( this->m_b.data(), RAJA::make_permuted_layout( b_sizes, permutation_I ) );

constexpr int NDIM = typeManipulation::getDimension< PERMUTATION >;
constexpr std::array< camp::idx_t, NDIM > const permutation = RAJA::as_array< PERMUTATION >::get();
std::array< INDEX_TYPE, NDIM > c_sizes;
for( int i = 0; i < NDIM; ++i )
{
c_sizes[ i ] = this->m_c.dims()[ i ];
}
RajaView< VALUE_TYPE, PERMUTATION > const c = RajaView< VALUE_TYPE, PERMUTATION >( this->m_c.data(), RAJA::make_permuted_layout( c_sizes, permutation ) );
TIMING_LOOP( RAJAViewKernel( a, b, c ); )
}

Expand Down
Loading