Updating Kokkos lib to 2.03.00

This commit is contained in:
Stan Moore
2017-04-25 13:48:51 -06:00
parent 9f6e126a2f
commit 8910ec6e59
261 changed files with 27816 additions and 17799 deletions

View File

@ -40,11 +40,14 @@
// ************************************************************************
//@HEADER
*/
#ifndef KOKKOS_TEST_SERIAL_HPP
#define KOKKOS_TEST_SERIAL_HPP
#include <gtest/gtest.h>
#include <Kokkos_Macros.hpp>
#ifdef KOKKOS_LAMBDA
#undef KOKKOS_LAMBDA
#endif
@ -53,21 +56,14 @@
#include <Kokkos_Core.hpp>
#include <TestTile.hpp>
//----------------------------------------------------------------------------
#include <TestSharedAlloc.hpp>
#include <TestViewMapping.hpp>
#include <TestViewAPI.hpp>
#include <TestViewOfClass.hpp>
#include <TestViewSubview.hpp>
#include <TestAtomic.hpp>
#include <TestAtomicOperations.hpp>
#include <TestAtomicViews.hpp>
#include <TestRange.hpp>
#include <TestTeam.hpp>
#include <TestReduce.hpp>
@ -76,15 +72,11 @@
#include <TestCompilerMacros.hpp>
#include <TestTaskScheduler.hpp>
#include <TestMemoryPool.hpp>
#include <TestCXX11.hpp>
#include <TestCXX11Deduction.hpp>
#include <TestTeamVector.hpp>
#include <TestTemplateMetaFunctions.hpp>
#include <TestPolicyConstruction.hpp>
#include <TestMDRange.hpp>
namespace Test {
@ -92,14 +84,16 @@ namespace Test {
class serial : public ::testing::Test {
protected:
static void SetUpTestCase()
{
Kokkos::HostSpace::execution_space::initialize();
}
{
Kokkos::HostSpace::execution_space::initialize();
}
static void TearDownTestCase()
{
Kokkos::HostSpace::execution_space::finalize();
}
{
Kokkos::HostSpace::execution_space::finalize();
}
};
}
} // namespace Test
#endif

View File

@ -40,165 +40,165 @@
// ************************************************************************
//@HEADER
*/
#include <serial/TestSerial.hpp>
namespace Test {
TEST_F( serial , atomics )
TEST_F( serial, atomics )
{
const int loop_count = 1e6 ;
const int loop_count = 1e6;
ASSERT_TRUE( ( TestAtomic::Loop<int,Kokkos::Serial>(loop_count,1) ) );
ASSERT_TRUE( ( TestAtomic::Loop<int,Kokkos::Serial>(loop_count,2) ) );
ASSERT_TRUE( ( TestAtomic::Loop<int,Kokkos::Serial>(loop_count,3) ) );
ASSERT_TRUE( ( TestAtomic::Loop< int, Kokkos::Serial >( loop_count, 1 ) ) );
ASSERT_TRUE( ( TestAtomic::Loop< int, Kokkos::Serial >( loop_count, 2 ) ) );
ASSERT_TRUE( ( TestAtomic::Loop< int, Kokkos::Serial >( loop_count, 3 ) ) );
ASSERT_TRUE( ( TestAtomic::Loop<unsigned int,Kokkos::Serial>(loop_count,1) ) );
ASSERT_TRUE( ( TestAtomic::Loop<unsigned int,Kokkos::Serial>(loop_count,2) ) );
ASSERT_TRUE( ( TestAtomic::Loop<unsigned int,Kokkos::Serial>(loop_count,3) ) );
ASSERT_TRUE( ( TestAtomic::Loop< unsigned int, Kokkos::Serial >( loop_count, 1 ) ) );
ASSERT_TRUE( ( TestAtomic::Loop< unsigned int, Kokkos::Serial >( loop_count, 2 ) ) );
ASSERT_TRUE( ( TestAtomic::Loop< unsigned int, Kokkos::Serial >( loop_count, 3 ) ) );
ASSERT_TRUE( ( TestAtomic::Loop<long int,Kokkos::Serial>(loop_count,1) ) );
ASSERT_TRUE( ( TestAtomic::Loop<long int,Kokkos::Serial>(loop_count,2) ) );
ASSERT_TRUE( ( TestAtomic::Loop<long int,Kokkos::Serial>(loop_count,3) ) );
ASSERT_TRUE( ( TestAtomic::Loop< long int, Kokkos::Serial >( loop_count, 1 ) ) );
ASSERT_TRUE( ( TestAtomic::Loop< long int, Kokkos::Serial >( loop_count, 2 ) ) );
ASSERT_TRUE( ( TestAtomic::Loop< long int, Kokkos::Serial >( loop_count, 3 ) ) );
ASSERT_TRUE( ( TestAtomic::Loop<unsigned long int,Kokkos::Serial>(loop_count,1) ) );
ASSERT_TRUE( ( TestAtomic::Loop<unsigned long int,Kokkos::Serial>(loop_count,2) ) );
ASSERT_TRUE( ( TestAtomic::Loop<unsigned long int,Kokkos::Serial>(loop_count,3) ) );
ASSERT_TRUE( ( TestAtomic::Loop< unsigned long int, Kokkos::Serial >( loop_count, 1 ) ) );
ASSERT_TRUE( ( TestAtomic::Loop< unsigned long int, Kokkos::Serial >( loop_count, 2 ) ) );
ASSERT_TRUE( ( TestAtomic::Loop< unsigned long int, Kokkos::Serial >( loop_count, 3 ) ) );
ASSERT_TRUE( ( TestAtomic::Loop<long long int,Kokkos::Serial>(loop_count,1) ) );
ASSERT_TRUE( ( TestAtomic::Loop<long long int,Kokkos::Serial>(loop_count,2) ) );
ASSERT_TRUE( ( TestAtomic::Loop<long long int,Kokkos::Serial>(loop_count,3) ) );
ASSERT_TRUE( ( TestAtomic::Loop< long long int, Kokkos::Serial >( loop_count, 1 ) ) );
ASSERT_TRUE( ( TestAtomic::Loop< long long int, Kokkos::Serial >( loop_count, 2 ) ) );
ASSERT_TRUE( ( TestAtomic::Loop< long long int, Kokkos::Serial >( loop_count, 3 ) ) );
ASSERT_TRUE( ( TestAtomic::Loop<double,Kokkos::Serial>(loop_count,1) ) );
ASSERT_TRUE( ( TestAtomic::Loop<double,Kokkos::Serial>(loop_count,2) ) );
ASSERT_TRUE( ( TestAtomic::Loop<double,Kokkos::Serial>(loop_count,3) ) );
ASSERT_TRUE( ( TestAtomic::Loop< double, Kokkos::Serial >( loop_count, 1 ) ) );
ASSERT_TRUE( ( TestAtomic::Loop< double, Kokkos::Serial >( loop_count, 2 ) ) );
ASSERT_TRUE( ( TestAtomic::Loop< double, Kokkos::Serial >( loop_count, 3 ) ) );
ASSERT_TRUE( ( TestAtomic::Loop<float,Kokkos::Serial>(100,1) ) );
ASSERT_TRUE( ( TestAtomic::Loop<float,Kokkos::Serial>(100,2) ) );
ASSERT_TRUE( ( TestAtomic::Loop<float,Kokkos::Serial>(100,3) ) );
ASSERT_TRUE( ( TestAtomic::Loop< float, Kokkos::Serial >( 100, 1 ) ) );
ASSERT_TRUE( ( TestAtomic::Loop< float, Kokkos::Serial >( 100, 2 ) ) );
ASSERT_TRUE( ( TestAtomic::Loop< float, Kokkos::Serial >( 100, 3 ) ) );
ASSERT_TRUE( ( TestAtomic::Loop<Kokkos::complex<double> ,Kokkos::Serial>(100,1) ) );
ASSERT_TRUE( ( TestAtomic::Loop<Kokkos::complex<double> ,Kokkos::Serial>(100,2) ) );
ASSERT_TRUE( ( TestAtomic::Loop<Kokkos::complex<double> ,Kokkos::Serial>(100,3) ) );
ASSERT_TRUE( ( TestAtomic::Loop< Kokkos::complex<double>, Kokkos::Serial >( 100, 1 ) ) );
ASSERT_TRUE( ( TestAtomic::Loop< Kokkos::complex<double>, Kokkos::Serial >( 100, 2 ) ) );
ASSERT_TRUE( ( TestAtomic::Loop< Kokkos::complex<double>, Kokkos::Serial >( 100, 3 ) ) );
ASSERT_TRUE( ( TestAtomic::Loop<TestAtomic::SuperScalar<4> ,Kokkos::Serial>(100,1) ) );
ASSERT_TRUE( ( TestAtomic::Loop<TestAtomic::SuperScalar<4> ,Kokkos::Serial>(100,2) ) );
ASSERT_TRUE( ( TestAtomic::Loop<TestAtomic::SuperScalar<4> ,Kokkos::Serial>(100,3) ) );
ASSERT_TRUE( ( TestAtomic::Loop< TestAtomic::SuperScalar<4>, Kokkos::Serial >( 100, 1 ) ) );
ASSERT_TRUE( ( TestAtomic::Loop< TestAtomic::SuperScalar<4>, Kokkos::Serial >( 100, 2 ) ) );
ASSERT_TRUE( ( TestAtomic::Loop< TestAtomic::SuperScalar<4>, Kokkos::Serial >( 100, 3 ) ) );
}
TEST_F( serial , atomic_operations )
TEST_F( serial, atomic_operations )
{
const int start = 1; //Avoid zero for division
const int start = 1; // Avoid zero for division.
const int end = 11;
for (int i = start; i < end; ++i)
for ( int i = start; i < end; ++i )
{
ASSERT_TRUE( ( TestAtomicOperations::AtomicOperationsTestIntegralType<int,Kokkos::Serial>(start, end-i, 1 ) ) );
ASSERT_TRUE( ( TestAtomicOperations::AtomicOperationsTestIntegralType<int,Kokkos::Serial>(start, end-i, 2 ) ) );
ASSERT_TRUE( ( TestAtomicOperations::AtomicOperationsTestIntegralType<int,Kokkos::Serial>(start, end-i, 3 ) ) );
ASSERT_TRUE( ( TestAtomicOperations::AtomicOperationsTestIntegralType<int,Kokkos::Serial>(start, end-i, 4 ) ) );
ASSERT_TRUE( ( TestAtomicOperations::AtomicOperationsTestIntegralType<int,Kokkos::Serial>(start, end-i, 5 ) ) );
ASSERT_TRUE( ( TestAtomicOperations::AtomicOperationsTestIntegralType<int,Kokkos::Serial>(start, end-i, 6 ) ) );
ASSERT_TRUE( ( TestAtomicOperations::AtomicOperationsTestIntegralType<int,Kokkos::Serial>(start, end-i, 7 ) ) );
ASSERT_TRUE( ( TestAtomicOperations::AtomicOperationsTestIntegralType<int,Kokkos::Serial>(start, end-i, 8 ) ) );
ASSERT_TRUE( ( TestAtomicOperations::AtomicOperationsTestIntegralType<int,Kokkos::Serial>(start, end-i, 9 ) ) );
ASSERT_TRUE( ( TestAtomicOperations::AtomicOperationsTestIntegralType<int,Kokkos::Serial>(start, end-i, 11 ) ) );
ASSERT_TRUE( ( TestAtomicOperations::AtomicOperationsTestIntegralType<int,Kokkos::Serial>(start, end-i, 12 ) ) );
ASSERT_TRUE( ( TestAtomicOperations::AtomicOperationsTestIntegralType< int, Kokkos::Serial >( start, end - i, 1 ) ) );
ASSERT_TRUE( ( TestAtomicOperations::AtomicOperationsTestIntegralType< int, Kokkos::Serial >( start, end - i, 2 ) ) );
ASSERT_TRUE( ( TestAtomicOperations::AtomicOperationsTestIntegralType< int, Kokkos::Serial >( start, end - i, 3 ) ) );
ASSERT_TRUE( ( TestAtomicOperations::AtomicOperationsTestIntegralType< int, Kokkos::Serial >( start, end - i, 4 ) ) );
ASSERT_TRUE( ( TestAtomicOperations::AtomicOperationsTestIntegralType< int, Kokkos::Serial >( start, end - i, 5 ) ) );
ASSERT_TRUE( ( TestAtomicOperations::AtomicOperationsTestIntegralType< int, Kokkos::Serial >( start, end - i, 6 ) ) );
ASSERT_TRUE( ( TestAtomicOperations::AtomicOperationsTestIntegralType< int, Kokkos::Serial >( start, end - i, 7 ) ) );
ASSERT_TRUE( ( TestAtomicOperations::AtomicOperationsTestIntegralType< int, Kokkos::Serial >( start, end - i, 8 ) ) );
ASSERT_TRUE( ( TestAtomicOperations::AtomicOperationsTestIntegralType< int, Kokkos::Serial >( start, end - i, 9 ) ) );
ASSERT_TRUE( ( TestAtomicOperations::AtomicOperationsTestIntegralType< int, Kokkos::Serial >( start, end - i, 11 ) ) );
ASSERT_TRUE( ( TestAtomicOperations::AtomicOperationsTestIntegralType< int, Kokkos::Serial >( start, end - i, 12 ) ) );
ASSERT_TRUE( ( TestAtomicOperations::AtomicOperationsTestIntegralType<unsigned int,Kokkos::Serial>(start, end-i, 1 ) ) );
ASSERT_TRUE( ( TestAtomicOperations::AtomicOperationsTestIntegralType<unsigned int,Kokkos::Serial>(start, end-i, 2 ) ) );
ASSERT_TRUE( ( TestAtomicOperations::AtomicOperationsTestIntegralType<unsigned int,Kokkos::Serial>(start, end-i, 3 ) ) );
ASSERT_TRUE( ( TestAtomicOperations::AtomicOperationsTestIntegralType<unsigned int,Kokkos::Serial>(start, end-i, 4 ) ) );
ASSERT_TRUE( ( TestAtomicOperations::AtomicOperationsTestIntegralType<unsigned int,Kokkos::Serial>(start, end-i, 5 ) ) );
ASSERT_TRUE( ( TestAtomicOperations::AtomicOperationsTestIntegralType<unsigned int,Kokkos::Serial>(start, end-i, 6 ) ) );
ASSERT_TRUE( ( TestAtomicOperations::AtomicOperationsTestIntegralType<unsigned int,Kokkos::Serial>(start, end-i, 7 ) ) );
ASSERT_TRUE( ( TestAtomicOperations::AtomicOperationsTestIntegralType<unsigned int,Kokkos::Serial>(start, end-i, 8 ) ) );
ASSERT_TRUE( ( TestAtomicOperations::AtomicOperationsTestIntegralType<unsigned int,Kokkos::Serial>(start, end-i, 9 ) ) );
ASSERT_TRUE( ( TestAtomicOperations::AtomicOperationsTestIntegralType<unsigned int,Kokkos::Serial>(start, end-i, 11 ) ) );
ASSERT_TRUE( ( TestAtomicOperations::AtomicOperationsTestIntegralType<unsigned int,Kokkos::Serial>(start, end-i, 12 ) ) );
ASSERT_TRUE( ( TestAtomicOperations::AtomicOperationsTestIntegralType< unsigned int, Kokkos::Serial >( start, end - i, 1 ) ) );
ASSERT_TRUE( ( TestAtomicOperations::AtomicOperationsTestIntegralType< unsigned int, Kokkos::Serial >( start, end - i, 2 ) ) );
ASSERT_TRUE( ( TestAtomicOperations::AtomicOperationsTestIntegralType< unsigned int, Kokkos::Serial >( start, end - i, 3 ) ) );
ASSERT_TRUE( ( TestAtomicOperations::AtomicOperationsTestIntegralType< unsigned int, Kokkos::Serial >( start, end - i, 4 ) ) );
ASSERT_TRUE( ( TestAtomicOperations::AtomicOperationsTestIntegralType< unsigned int, Kokkos::Serial >( start, end - i, 5 ) ) );
ASSERT_TRUE( ( TestAtomicOperations::AtomicOperationsTestIntegralType< unsigned int, Kokkos::Serial >( start, end - i, 6 ) ) );
ASSERT_TRUE( ( TestAtomicOperations::AtomicOperationsTestIntegralType< unsigned int, Kokkos::Serial >( start, end - i, 7 ) ) );
ASSERT_TRUE( ( TestAtomicOperations::AtomicOperationsTestIntegralType< unsigned int, Kokkos::Serial >( start, end - i, 8 ) ) );
ASSERT_TRUE( ( TestAtomicOperations::AtomicOperationsTestIntegralType< unsigned int, Kokkos::Serial >( start, end - i, 9 ) ) );
ASSERT_TRUE( ( TestAtomicOperations::AtomicOperationsTestIntegralType< unsigned int, Kokkos::Serial >( start, end - i, 11 ) ) );
ASSERT_TRUE( ( TestAtomicOperations::AtomicOperationsTestIntegralType< unsigned int, Kokkos::Serial >( start, end - i, 12 ) ) );
ASSERT_TRUE( ( TestAtomicOperations::AtomicOperationsTestIntegralType<long int,Kokkos::Serial>(start, end-i, 1 ) ) );
ASSERT_TRUE( ( TestAtomicOperations::AtomicOperationsTestIntegralType<long int,Kokkos::Serial>(start, end-i, 2 ) ) );
ASSERT_TRUE( ( TestAtomicOperations::AtomicOperationsTestIntegralType<long int,Kokkos::Serial>(start, end-i, 3 ) ) );
ASSERT_TRUE( ( TestAtomicOperations::AtomicOperationsTestIntegralType<long int,Kokkos::Serial>(start, end-i, 4 ) ) );
ASSERT_TRUE( ( TestAtomicOperations::AtomicOperationsTestIntegralType<long int,Kokkos::Serial>(start, end-i, 5 ) ) );
ASSERT_TRUE( ( TestAtomicOperations::AtomicOperationsTestIntegralType<long int,Kokkos::Serial>(start, end-i, 6 ) ) );
ASSERT_TRUE( ( TestAtomicOperations::AtomicOperationsTestIntegralType<long int,Kokkos::Serial>(start, end-i, 7 ) ) );
ASSERT_TRUE( ( TestAtomicOperations::AtomicOperationsTestIntegralType<long int,Kokkos::Serial>(start, end-i, 8 ) ) );
ASSERT_TRUE( ( TestAtomicOperations::AtomicOperationsTestIntegralType<long int,Kokkos::Serial>(start, end-i, 9 ) ) );
ASSERT_TRUE( ( TestAtomicOperations::AtomicOperationsTestIntegralType<long int,Kokkos::Serial>(start, end-i, 11 ) ) );
ASSERT_TRUE( ( TestAtomicOperations::AtomicOperationsTestIntegralType<long int,Kokkos::Serial>(start, end-i, 12 ) ) );
ASSERT_TRUE( ( TestAtomicOperations::AtomicOperationsTestIntegralType< long int, Kokkos::Serial >( start, end - i, 1 ) ) );
ASSERT_TRUE( ( TestAtomicOperations::AtomicOperationsTestIntegralType< long int, Kokkos::Serial >( start, end - i, 2 ) ) );
ASSERT_TRUE( ( TestAtomicOperations::AtomicOperationsTestIntegralType< long int, Kokkos::Serial >( start, end - i, 3 ) ) );
ASSERT_TRUE( ( TestAtomicOperations::AtomicOperationsTestIntegralType< long int, Kokkos::Serial >( start, end - i, 4 ) ) );
ASSERT_TRUE( ( TestAtomicOperations::AtomicOperationsTestIntegralType< long int, Kokkos::Serial >( start, end - i, 5 ) ) );
ASSERT_TRUE( ( TestAtomicOperations::AtomicOperationsTestIntegralType< long int, Kokkos::Serial >( start, end - i, 6 ) ) );
ASSERT_TRUE( ( TestAtomicOperations::AtomicOperationsTestIntegralType< long int, Kokkos::Serial >( start, end - i, 7 ) ) );
ASSERT_TRUE( ( TestAtomicOperations::AtomicOperationsTestIntegralType< long int, Kokkos::Serial >( start, end - i, 8 ) ) );
ASSERT_TRUE( ( TestAtomicOperations::AtomicOperationsTestIntegralType< long int, Kokkos::Serial >( start, end - i, 9 ) ) );
ASSERT_TRUE( ( TestAtomicOperations::AtomicOperationsTestIntegralType< long int, Kokkos::Serial >( start, end - i, 11 ) ) );
ASSERT_TRUE( ( TestAtomicOperations::AtomicOperationsTestIntegralType< long int, Kokkos::Serial >( start, end - i, 12 ) ) );
ASSERT_TRUE( ( TestAtomicOperations::AtomicOperationsTestIntegralType<unsigned long int,Kokkos::Serial>(start, end-i, 1 ) ) );
ASSERT_TRUE( ( TestAtomicOperations::AtomicOperationsTestIntegralType<unsigned long int,Kokkos::Serial>(start, end-i, 2 ) ) );
ASSERT_TRUE( ( TestAtomicOperations::AtomicOperationsTestIntegralType<unsigned long int,Kokkos::Serial>(start, end-i, 3 ) ) );
ASSERT_TRUE( ( TestAtomicOperations::AtomicOperationsTestIntegralType<unsigned long int,Kokkos::Serial>(start, end-i, 4 ) ) );
ASSERT_TRUE( ( TestAtomicOperations::AtomicOperationsTestIntegralType<unsigned long int,Kokkos::Serial>(start, end-i, 5 ) ) );
ASSERT_TRUE( ( TestAtomicOperations::AtomicOperationsTestIntegralType<unsigned long int,Kokkos::Serial>(start, end-i, 6 ) ) );
ASSERT_TRUE( ( TestAtomicOperations::AtomicOperationsTestIntegralType<unsigned long int,Kokkos::Serial>(start, end-i, 7 ) ) );
ASSERT_TRUE( ( TestAtomicOperations::AtomicOperationsTestIntegralType<unsigned long int,Kokkos::Serial>(start, end-i, 8 ) ) );
ASSERT_TRUE( ( TestAtomicOperations::AtomicOperationsTestIntegralType<unsigned long int,Kokkos::Serial>(start, end-i, 9 ) ) );
ASSERT_TRUE( ( TestAtomicOperations::AtomicOperationsTestIntegralType<unsigned long int,Kokkos::Serial>(start, end-i, 11 ) ) );
ASSERT_TRUE( ( TestAtomicOperations::AtomicOperationsTestIntegralType<unsigned long int,Kokkos::Serial>(start, end-i, 12) ) );
ASSERT_TRUE( ( TestAtomicOperations::AtomicOperationsTestIntegralType< unsigned long int, Kokkos::Serial >( start, end - i, 1 ) ) );
ASSERT_TRUE( ( TestAtomicOperations::AtomicOperationsTestIntegralType< unsigned long int, Kokkos::Serial >( start, end - i, 2 ) ) );
ASSERT_TRUE( ( TestAtomicOperations::AtomicOperationsTestIntegralType< unsigned long int, Kokkos::Serial >( start, end - i, 3 ) ) );
ASSERT_TRUE( ( TestAtomicOperations::AtomicOperationsTestIntegralType< unsigned long int, Kokkos::Serial >( start, end - i, 4 ) ) );
ASSERT_TRUE( ( TestAtomicOperations::AtomicOperationsTestIntegralType< unsigned long int, Kokkos::Serial >( start, end - i, 5 ) ) );
ASSERT_TRUE( ( TestAtomicOperations::AtomicOperationsTestIntegralType< unsigned long int, Kokkos::Serial >( start, end - i, 6 ) ) );
ASSERT_TRUE( ( TestAtomicOperations::AtomicOperationsTestIntegralType< unsigned long int, Kokkos::Serial >( start, end - i, 7 ) ) );
ASSERT_TRUE( ( TestAtomicOperations::AtomicOperationsTestIntegralType< unsigned long int, Kokkos::Serial >( start, end - i, 8 ) ) );
ASSERT_TRUE( ( TestAtomicOperations::AtomicOperationsTestIntegralType< unsigned long int, Kokkos::Serial >( start, end - i, 9 ) ) );
ASSERT_TRUE( ( TestAtomicOperations::AtomicOperationsTestIntegralType< unsigned long int, Kokkos::Serial >( start, end - i, 11 ) ) );
ASSERT_TRUE( ( TestAtomicOperations::AtomicOperationsTestIntegralType< unsigned long int, Kokkos::Serial >( start, end - i, 12 ) ) );
ASSERT_TRUE( ( TestAtomicOperations::AtomicOperationsTestIntegralType<long long int,Kokkos::Serial>(start, end-i, 1 ) ) );
ASSERT_TRUE( ( TestAtomicOperations::AtomicOperationsTestIntegralType<long long int,Kokkos::Serial>(start, end-i, 2 ) ) );
ASSERT_TRUE( ( TestAtomicOperations::AtomicOperationsTestIntegralType<long long int,Kokkos::Serial>(start, end-i, 3 ) ) );
ASSERT_TRUE( ( TestAtomicOperations::AtomicOperationsTestIntegralType<long long int,Kokkos::Serial>(start, end-i, 4 ) ) );
ASSERT_TRUE( ( TestAtomicOperations::AtomicOperationsTestIntegralType<long long int,Kokkos::Serial>(start, end-i, 5 ) ) );
ASSERT_TRUE( ( TestAtomicOperations::AtomicOperationsTestIntegralType<long long int,Kokkos::Serial>(start, end-i, 6 ) ) );
ASSERT_TRUE( ( TestAtomicOperations::AtomicOperationsTestIntegralType<long long int,Kokkos::Serial>(start, end-i, 7 ) ) );
ASSERT_TRUE( ( TestAtomicOperations::AtomicOperationsTestIntegralType<long long int,Kokkos::Serial>(start, end-i, 8 ) ) );
ASSERT_TRUE( ( TestAtomicOperations::AtomicOperationsTestIntegralType<long long int,Kokkos::Serial>(start, end-i, 9 ) ) );
ASSERT_TRUE( ( TestAtomicOperations::AtomicOperationsTestIntegralType<long long int,Kokkos::Serial>(start, end-i, 11 ) ) );
ASSERT_TRUE( ( TestAtomicOperations::AtomicOperationsTestIntegralType<long long int,Kokkos::Serial>(start, end-i, 12 ) ) );
ASSERT_TRUE( ( TestAtomicOperations::AtomicOperationsTestIntegralType< long long int, Kokkos::Serial >( start, end - i, 1 ) ) );
ASSERT_TRUE( ( TestAtomicOperations::AtomicOperationsTestIntegralType< long long int, Kokkos::Serial >( start, end - i, 2 ) ) );
ASSERT_TRUE( ( TestAtomicOperations::AtomicOperationsTestIntegralType< long long int, Kokkos::Serial >( start, end - i, 3 ) ) );
ASSERT_TRUE( ( TestAtomicOperations::AtomicOperationsTestIntegralType< long long int, Kokkos::Serial >( start, end - i, 4 ) ) );
ASSERT_TRUE( ( TestAtomicOperations::AtomicOperationsTestIntegralType< long long int, Kokkos::Serial >( start, end - i, 5 ) ) );
ASSERT_TRUE( ( TestAtomicOperations::AtomicOperationsTestIntegralType< long long int, Kokkos::Serial >( start, end - i, 6 ) ) );
ASSERT_TRUE( ( TestAtomicOperations::AtomicOperationsTestIntegralType< long long int, Kokkos::Serial >( start, end - i, 7 ) ) );
ASSERT_TRUE( ( TestAtomicOperations::AtomicOperationsTestIntegralType< long long int, Kokkos::Serial >( start, end - i, 8 ) ) );
ASSERT_TRUE( ( TestAtomicOperations::AtomicOperationsTestIntegralType< long long int, Kokkos::Serial >( start, end - i, 9 ) ) );
ASSERT_TRUE( ( TestAtomicOperations::AtomicOperationsTestIntegralType< long long int, Kokkos::Serial >( start, end - i, 11 ) ) );
ASSERT_TRUE( ( TestAtomicOperations::AtomicOperationsTestIntegralType< long long int, Kokkos::Serial >( start, end - i, 12 ) ) );
ASSERT_TRUE( ( TestAtomicOperations::AtomicOperationsTestNonIntegralType<double,Kokkos::Serial>(start, end-i, 1 ) ) );
ASSERT_TRUE( ( TestAtomicOperations::AtomicOperationsTestNonIntegralType<double,Kokkos::Serial>(start, end-i, 2 ) ) );
ASSERT_TRUE( ( TestAtomicOperations::AtomicOperationsTestNonIntegralType<double,Kokkos::Serial>(start, end-i, 3 ) ) );
ASSERT_TRUE( ( TestAtomicOperations::AtomicOperationsTestNonIntegralType<double,Kokkos::Serial>(start, end-i, 4 ) ) );
ASSERT_TRUE( ( TestAtomicOperations::AtomicOperationsTestNonIntegralType< double, Kokkos::Serial >( start, end - i, 1 ) ) );
ASSERT_TRUE( ( TestAtomicOperations::AtomicOperationsTestNonIntegralType< double, Kokkos::Serial >( start, end - i, 2 ) ) );
ASSERT_TRUE( ( TestAtomicOperations::AtomicOperationsTestNonIntegralType< double, Kokkos::Serial >( start, end - i, 3 ) ) );
ASSERT_TRUE( ( TestAtomicOperations::AtomicOperationsTestNonIntegralType< double, Kokkos::Serial >( start, end - i, 4 ) ) );
ASSERT_TRUE( ( TestAtomicOperations::AtomicOperationsTestNonIntegralType<float,Kokkos::Serial>(start, end-i, 1 ) ) );
ASSERT_TRUE( ( TestAtomicOperations::AtomicOperationsTestNonIntegralType<float,Kokkos::Serial>(start, end-i, 2 ) ) );
ASSERT_TRUE( ( TestAtomicOperations::AtomicOperationsTestNonIntegralType<float,Kokkos::Serial>(start, end-i, 3 ) ) );
ASSERT_TRUE( ( TestAtomicOperations::AtomicOperationsTestNonIntegralType<float,Kokkos::Serial>(start, end-i, 4 ) ) );
ASSERT_TRUE( ( TestAtomicOperations::AtomicOperationsTestNonIntegralType< float, Kokkos::Serial >( start, end - i, 1 ) ) );
ASSERT_TRUE( ( TestAtomicOperations::AtomicOperationsTestNonIntegralType< float, Kokkos::Serial >( start, end - i, 2 ) ) );
ASSERT_TRUE( ( TestAtomicOperations::AtomicOperationsTestNonIntegralType< float, Kokkos::Serial >( start, end - i, 3 ) ) );
ASSERT_TRUE( ( TestAtomicOperations::AtomicOperationsTestNonIntegralType< float, Kokkos::Serial >( start, end - i, 4 ) ) );
}
}
TEST_F( serial , atomic_views_integral )
TEST_F( serial, atomic_views_integral )
{
const long length = 1000000;
{
//Integral Types
ASSERT_TRUE( ( TestAtomicViews::AtomicViewsTestIntegralType<long, Kokkos::Serial>(length, 1 ) ) );
ASSERT_TRUE( ( TestAtomicViews::AtomicViewsTestIntegralType<long, Kokkos::Serial>(length, 2 ) ) );
ASSERT_TRUE( ( TestAtomicViews::AtomicViewsTestIntegralType<long, Kokkos::Serial>(length, 3 ) ) );
ASSERT_TRUE( ( TestAtomicViews::AtomicViewsTestIntegralType<long, Kokkos::Serial>(length, 4 ) ) );
ASSERT_TRUE( ( TestAtomicViews::AtomicViewsTestIntegralType<long, Kokkos::Serial>(length, 5 ) ) );
ASSERT_TRUE( ( TestAtomicViews::AtomicViewsTestIntegralType<long, Kokkos::Serial>(length, 6 ) ) );
ASSERT_TRUE( ( TestAtomicViews::AtomicViewsTestIntegralType<long, Kokkos::Serial>(length, 7 ) ) );
ASSERT_TRUE( ( TestAtomicViews::AtomicViewsTestIntegralType<long, Kokkos::Serial>(length, 8 ) ) );
{
// Integral Types.
ASSERT_TRUE( ( TestAtomicViews::AtomicViewsTestIntegralType< long, Kokkos::Serial >( length, 1 ) ) );
ASSERT_TRUE( ( TestAtomicViews::AtomicViewsTestIntegralType< long, Kokkos::Serial >( length, 2 ) ) );
ASSERT_TRUE( ( TestAtomicViews::AtomicViewsTestIntegralType< long, Kokkos::Serial >( length, 3 ) ) );
ASSERT_TRUE( ( TestAtomicViews::AtomicViewsTestIntegralType< long, Kokkos::Serial >( length, 4 ) ) );
ASSERT_TRUE( ( TestAtomicViews::AtomicViewsTestIntegralType< long, Kokkos::Serial >( length, 5 ) ) );
ASSERT_TRUE( ( TestAtomicViews::AtomicViewsTestIntegralType< long, Kokkos::Serial >( length, 6 ) ) );
ASSERT_TRUE( ( TestAtomicViews::AtomicViewsTestIntegralType< long, Kokkos::Serial >( length, 7 ) ) );
ASSERT_TRUE( ( TestAtomicViews::AtomicViewsTestIntegralType< long, Kokkos::Serial >( length, 8 ) ) );
}
}
TEST_F( serial , atomic_views_nonintegral )
TEST_F( serial, atomic_views_nonintegral )
{
const long length = 1000000;
{
//Non-Integral Types
ASSERT_TRUE( ( TestAtomicViews::AtomicViewsTestNonIntegralType<double,Kokkos::Serial>(length, 1 ) ) );
ASSERT_TRUE( ( TestAtomicViews::AtomicViewsTestNonIntegralType<double,Kokkos::Serial>(length, 2 ) ) );
ASSERT_TRUE( ( TestAtomicViews::AtomicViewsTestNonIntegralType<double,Kokkos::Serial>(length, 3 ) ) );
ASSERT_TRUE( ( TestAtomicViews::AtomicViewsTestNonIntegralType<double,Kokkos::Serial>(length, 4 ) ) );
{
// Non-Integral Types.
ASSERT_TRUE( ( TestAtomicViews::AtomicViewsTestNonIntegralType< double, Kokkos::Serial >( length, 1 ) ) );
ASSERT_TRUE( ( TestAtomicViews::AtomicViewsTestNonIntegralType< double, Kokkos::Serial >( length, 2 ) ) );
ASSERT_TRUE( ( TestAtomicViews::AtomicViewsTestNonIntegralType< double, Kokkos::Serial >( length, 3 ) ) );
ASSERT_TRUE( ( TestAtomicViews::AtomicViewsTestNonIntegralType< double, Kokkos::Serial >( length, 4 ) ) );
}
}
TEST_F( serial , atomic_view_api )
TEST_F( serial, atomic_view_api )
{
TestAtomicViews::TestAtomicViewAPI<int, Kokkos::Serial>();
TestAtomicViews::TestAtomicViewAPI< int, Kokkos::Serial >();
}
} // namespace test
} // namespace Test

View File

@ -40,50 +40,61 @@
// ************************************************************************
//@HEADER
*/
#include <serial/TestSerial.hpp>
namespace Test {
TEST_F( serial , md_range ) {
TestMDRange_2D< Kokkos::Serial >::test_for2(100,100);
TestMDRange_3D< Kokkos::Serial >::test_for3(100,100,100);
TEST_F( serial , mdrange_for )
{
TestMDRange_2D< Kokkos::Serial >::test_for2( 100, 100 );
TestMDRange_3D< Kokkos::Serial >::test_for3( 100, 10, 100 );
TestMDRange_4D< Kokkos::Serial >::test_for4( 100, 10, 10, 10 );
TestMDRange_5D< Kokkos::Serial >::test_for5( 100, 10, 10, 10, 5 );
TestMDRange_6D< Kokkos::Serial >::test_for6( 10, 10, 10, 10, 5, 5 );
}
TEST_F( serial, policy_construction) {
TEST_F( serial , mdrange_reduce )
{
TestMDRange_2D< Kokkos::Serial >::test_reduce2( 100, 100 );
TestMDRange_3D< Kokkos::Serial >::test_reduce3( 100, 10, 100 );
}
TEST_F( serial, policy_construction )
{
TestRangePolicyConstruction< Kokkos::Serial >();
TestTeamPolicyConstruction< Kokkos::Serial >();
}
TEST_F( serial , range_tag )
TEST_F( serial, range_tag )
{
TestRange< Kokkos::Serial , Kokkos::Schedule<Kokkos::Static> >::test_for(0);
TestRange< Kokkos::Serial , Kokkos::Schedule<Kokkos::Static> >::test_reduce(0);
TestRange< Kokkos::Serial , Kokkos::Schedule<Kokkos::Static> >::test_scan(0);
TestRange< Kokkos::Serial , Kokkos::Schedule<Kokkos::Dynamic> >::test_for(0);
TestRange< Kokkos::Serial , Kokkos::Schedule<Kokkos::Dynamic> >::test_reduce(0);
TestRange< Kokkos::Serial , Kokkos::Schedule<Kokkos::Dynamic> >::test_scan(0);
TestRange< Kokkos::Serial, Kokkos::Schedule<Kokkos::Static> >::test_for( 0 );
TestRange< Kokkos::Serial, Kokkos::Schedule<Kokkos::Static> >::test_reduce( 0 );
TestRange< Kokkos::Serial, Kokkos::Schedule<Kokkos::Static> >::test_scan( 0 );
TestRange< Kokkos::Serial, Kokkos::Schedule<Kokkos::Dynamic> >::test_for( 0 );
TestRange< Kokkos::Serial, Kokkos::Schedule<Kokkos::Dynamic> >::test_reduce( 0 );
TestRange< Kokkos::Serial, Kokkos::Schedule<Kokkos::Dynamic> >::test_scan( 0 );
TestRange< Kokkos::Serial , Kokkos::Schedule<Kokkos::Static> >::test_for(1000);
TestRange< Kokkos::Serial , Kokkos::Schedule<Kokkos::Static> >::test_reduce(1000);
TestRange< Kokkos::Serial , Kokkos::Schedule<Kokkos::Static> >::test_scan(1000);
TestRange< Kokkos::Serial , Kokkos::Schedule<Kokkos::Dynamic> >::test_for(1001);
TestRange< Kokkos::Serial , Kokkos::Schedule<Kokkos::Dynamic> >::test_reduce(1001);
TestRange< Kokkos::Serial , Kokkos::Schedule<Kokkos::Dynamic> >::test_scan(1001);
TestRange< Kokkos::Serial , Kokkos::Schedule<Kokkos::Dynamic> >::test_dynamic_policy(1000);
TestRange< Kokkos::Serial, Kokkos::Schedule<Kokkos::Static> >::test_for( 1000 );
TestRange< Kokkos::Serial, Kokkos::Schedule<Kokkos::Static> >::test_reduce( 1000 );
TestRange< Kokkos::Serial, Kokkos::Schedule<Kokkos::Static> >::test_scan( 1000 );
TestRange< Kokkos::Serial, Kokkos::Schedule<Kokkos::Dynamic> >::test_for( 1001 );
TestRange< Kokkos::Serial, Kokkos::Schedule<Kokkos::Dynamic> >::test_reduce( 1001 );
TestRange< Kokkos::Serial, Kokkos::Schedule<Kokkos::Dynamic> >::test_scan( 1001 );
TestRange< Kokkos::Serial, Kokkos::Schedule<Kokkos::Dynamic> >::test_dynamic_policy( 1000 );
}
//----------------------------------------------------------------------------
TEST_F( serial , compiler_macros )
TEST_F( serial, compiler_macros )
{
ASSERT_TRUE( ( TestCompilerMacros::Test< Kokkos::Serial >() ) );
}
//----------------------------------------------------------------------------
TEST_F( serial , memory_pool )
TEST_F( serial, memory_pool )
{
bool val = TestMemoryPool::test_mempool< Kokkos::Serial >( 128, 128000000 );
ASSERT_TRUE( val );
@ -97,24 +108,24 @@ TEST_F( serial , memory_pool )
#if defined( KOKKOS_ENABLE_TASKDAG )
TEST_F( serial , task_fib )
TEST_F( serial, task_fib )
{
for ( int i = 0 ; i < 25 ; ++i ) {
TestTaskScheduler::TestFib< Kokkos::Serial >::run(i);
for ( int i = 0; i < 25; ++i ) {
TestTaskScheduler::TestFib< Kokkos::Serial >::run( i );
}
}
TEST_F( serial , task_depend )
TEST_F( serial, task_depend )
{
for ( int i = 0 ; i < 25 ; ++i ) {
TestTaskScheduler::TestTaskDependence< Kokkos::Serial >::run(i);
for ( int i = 0; i < 25; ++i ) {
TestTaskScheduler::TestTaskDependence< Kokkos::Serial >::run( i );
}
}
TEST_F( serial , task_team )
TEST_F( serial, task_team )
{
TestTaskScheduler::TestTaskTeam< Kokkos::Serial >::run(1000);
//TestTaskScheduler::TestTaskTeamValue< Kokkos::Serial >::run(1000); //put back after testing
TestTaskScheduler::TestTaskTeam< Kokkos::Serial >::run( 1000 );
//TestTaskScheduler::TestTaskTeamValue< Kokkos::Serial >::run( 1000 ); // Put back after testing.
}
#endif /* #if defined( KOKKOS_ENABLE_TASKDAG ) */
@ -122,44 +133,40 @@ TEST_F( serial , task_team )
//----------------------------------------------------------------------------
#if defined( KOKKOS_ENABLE_DEFAULT_DEVICE_TYPE_SERIAL )
TEST_F( serial , cxx11 )
TEST_F( serial, cxx11 )
{
if ( std::is_same< Kokkos::DefaultExecutionSpace , Kokkos::Serial >::value ) {
ASSERT_TRUE( ( TestCXX11::Test< Kokkos::Serial >(1) ) );
ASSERT_TRUE( ( TestCXX11::Test< Kokkos::Serial >(2) ) );
ASSERT_TRUE( ( TestCXX11::Test< Kokkos::Serial >(3) ) );
ASSERT_TRUE( ( TestCXX11::Test< Kokkos::Serial >(4) ) );
if ( std::is_same< Kokkos::DefaultExecutionSpace, Kokkos::Serial >::value ) {
ASSERT_TRUE( ( TestCXX11::Test< Kokkos::Serial >( 1 ) ) );
ASSERT_TRUE( ( TestCXX11::Test< Kokkos::Serial >( 2 ) ) );
ASSERT_TRUE( ( TestCXX11::Test< Kokkos::Serial >( 3 ) ) );
ASSERT_TRUE( ( TestCXX11::Test< Kokkos::Serial >( 4 ) ) );
}
}
#endif
TEST_F( serial, tile_layout )
{
TestTile::test< Kokkos::Serial , 1 , 1 >( 1 , 1 );
TestTile::test< Kokkos::Serial , 1 , 1 >( 2 , 3 );
TestTile::test< Kokkos::Serial , 1 , 1 >( 9 , 10 );
TestTile::test< Kokkos::Serial, 1, 1 >( 1, 1 );
TestTile::test< Kokkos::Serial, 1, 1 >( 2, 3 );
TestTile::test< Kokkos::Serial, 1, 1 >( 9, 10 );
TestTile::test< Kokkos::Serial , 2 , 2 >( 1 , 1 );
TestTile::test< Kokkos::Serial , 2 , 2 >( 2 , 3 );
TestTile::test< Kokkos::Serial , 2 , 2 >( 4 , 4 );
TestTile::test< Kokkos::Serial , 2 , 2 >( 9 , 9 );
TestTile::test< Kokkos::Serial, 2, 2 >( 1, 1 );
TestTile::test< Kokkos::Serial, 2, 2 >( 2, 3 );
TestTile::test< Kokkos::Serial, 2, 2 >( 4, 4 );
TestTile::test< Kokkos::Serial, 2, 2 >( 9, 9 );
TestTile::test< Kokkos::Serial , 2 , 4 >( 9 , 9 );
TestTile::test< Kokkos::Serial , 4 , 2 >( 9 , 9 );
TestTile::test< Kokkos::Serial, 2, 4 >( 9, 9 );
TestTile::test< Kokkos::Serial, 4, 2 >( 9, 9 );
TestTile::test< Kokkos::Serial , 4 , 4 >( 1 , 1 );
TestTile::test< Kokkos::Serial , 4 , 4 >( 4 , 4 );
TestTile::test< Kokkos::Serial , 4 , 4 >( 9 , 9 );
TestTile::test< Kokkos::Serial , 4 , 4 >( 9 , 11 );
TestTile::test< Kokkos::Serial, 4, 4 >( 1, 1 );
TestTile::test< Kokkos::Serial, 4, 4 >( 4, 4 );
TestTile::test< Kokkos::Serial, 4, 4 >( 9, 9 );
TestTile::test< Kokkos::Serial, 4, 4 >( 9, 11 );
TestTile::test< Kokkos::Serial , 8 , 8 >( 1 , 1 );
TestTile::test< Kokkos::Serial , 8 , 8 >( 4 , 4 );
TestTile::test< Kokkos::Serial , 8 , 8 >( 9 , 9 );
TestTile::test< Kokkos::Serial , 8 , 8 >( 9 , 11 );
TestTile::test< Kokkos::Serial, 8, 8 >( 1, 1 );
TestTile::test< Kokkos::Serial, 8, 8 >( 4, 4 );
TestTile::test< Kokkos::Serial, 8, 8 >( 9, 9 );
TestTile::test< Kokkos::Serial, 8, 8 >( 9, 11 );
}
} // namespace test
} // namespace Test

View File

@ -40,83 +40,90 @@
// ************************************************************************
//@HEADER
*/
#include <serial/TestSerial.hpp>
namespace Test {
TEST_F( serial, long_reduce) {
TestReduce< long , Kokkos::Serial >( 0 );
TestReduce< long , Kokkos::Serial >( 1000000 );
}
TEST_F( serial, double_reduce) {
TestReduce< double , Kokkos::Serial >( 0 );
TestReduce< double , Kokkos::Serial >( 1000000 );
}
TEST_F( serial , reducers )
TEST_F( serial, long_reduce )
{
TestReducers<int, Kokkos::Serial>::execute_integer();
TestReducers<size_t, Kokkos::Serial>::execute_integer();
TestReducers<double, Kokkos::Serial>::execute_float();
TestReducers<Kokkos::complex<double>, Kokkos::Serial>::execute_basic();
TestReduce< long, Kokkos::Serial >( 0 );
TestReduce< long, Kokkos::Serial >( 1000000 );
}
TEST_F( serial, long_reduce_dynamic ) {
TestReduceDynamic< long , Kokkos::Serial >( 0 );
TestReduceDynamic< long , Kokkos::Serial >( 1000000 );
}
TEST_F( serial, double_reduce_dynamic ) {
TestReduceDynamic< double , Kokkos::Serial >( 0 );
TestReduceDynamic< double , Kokkos::Serial >( 1000000 );
}
TEST_F( serial, long_reduce_dynamic_view ) {
TestReduceDynamicView< long , Kokkos::Serial >( 0 );
TestReduceDynamicView< long , Kokkos::Serial >( 1000000 );
}
TEST_F( serial , scan )
TEST_F( serial, double_reduce )
{
TestScan< Kokkos::Serial >::test_range( 1 , 1000 );
TestReduce< double, Kokkos::Serial >( 0 );
TestReduce< double, Kokkos::Serial >( 1000000 );
}
TEST_F( serial, reducers )
{
TestReducers< int, Kokkos::Serial >::execute_integer();
TestReducers< size_t, Kokkos::Serial >::execute_integer();
TestReducers< double, Kokkos::Serial >::execute_float();
TestReducers< Kokkos::complex<double >, Kokkos::Serial>::execute_basic();
}
TEST_F( serial, long_reduce_dynamic )
{
TestReduceDynamic< long, Kokkos::Serial >( 0 );
TestReduceDynamic< long, Kokkos::Serial >( 1000000 );
}
TEST_F( serial, double_reduce_dynamic )
{
TestReduceDynamic< double, Kokkos::Serial >( 0 );
TestReduceDynamic< double, Kokkos::Serial >( 1000000 );
}
TEST_F( serial, long_reduce_dynamic_view )
{
TestReduceDynamicView< long, Kokkos::Serial >( 0 );
TestReduceDynamicView< long, Kokkos::Serial >( 1000000 );
}
TEST_F( serial, scan )
{
TestScan< Kokkos::Serial >::test_range( 1, 1000 );
TestScan< Kokkos::Serial >( 0 );
TestScan< Kokkos::Serial >( 10 );
TestScan< Kokkos::Serial >( 10000 );
}
TEST_F( serial , team_scan )
TEST_F( serial, team_scan )
{
TestScanTeam< Kokkos::Serial , Kokkos::Schedule<Kokkos::Static> >( 0 );
TestScanTeam< Kokkos::Serial , Kokkos::Schedule<Kokkos::Dynamic> >( 0 );
TestScanTeam< Kokkos::Serial , Kokkos::Schedule<Kokkos::Static> >( 10 );
TestScanTeam< Kokkos::Serial , Kokkos::Schedule<Kokkos::Dynamic> >( 10 );
TestScanTeam< Kokkos::Serial , Kokkos::Schedule<Kokkos::Static> >( 10000 );
TestScanTeam< Kokkos::Serial , Kokkos::Schedule<Kokkos::Dynamic> >( 10000 );
TestScanTeam< Kokkos::Serial, Kokkos::Schedule<Kokkos::Static> >( 0 );
TestScanTeam< Kokkos::Serial, Kokkos::Schedule<Kokkos::Dynamic> >( 0 );
TestScanTeam< Kokkos::Serial, Kokkos::Schedule<Kokkos::Static> >( 10 );
TestScanTeam< Kokkos::Serial, Kokkos::Schedule<Kokkos::Dynamic> >( 10 );
TestScanTeam< Kokkos::Serial, Kokkos::Schedule<Kokkos::Static> >( 10000 );
TestScanTeam< Kokkos::Serial, Kokkos::Schedule<Kokkos::Dynamic> >( 10000 );
}
TEST_F( serial , team_long_reduce) {
TestReduceTeam< long , Kokkos::Serial , Kokkos::Schedule<Kokkos::Static> >( 0 );
TestReduceTeam< long , Kokkos::Serial , Kokkos::Schedule<Kokkos::Dynamic> >( 0 );
TestReduceTeam< long , Kokkos::Serial , Kokkos::Schedule<Kokkos::Static> >( 3 );
TestReduceTeam< long , Kokkos::Serial , Kokkos::Schedule<Kokkos::Dynamic> >( 3 );
TestReduceTeam< long , Kokkos::Serial , Kokkos::Schedule<Kokkos::Static> >( 100000 );
TestReduceTeam< long , Kokkos::Serial , Kokkos::Schedule<Kokkos::Dynamic> >( 100000 );
TEST_F( serial, team_long_reduce )
{
TestReduceTeam< long, Kokkos::Serial, Kokkos::Schedule<Kokkos::Static> >( 0 );
TestReduceTeam< long, Kokkos::Serial, Kokkos::Schedule<Kokkos::Dynamic> >( 0 );
TestReduceTeam< long, Kokkos::Serial, Kokkos::Schedule<Kokkos::Static> >( 3 );
TestReduceTeam< long, Kokkos::Serial, Kokkos::Schedule<Kokkos::Dynamic> >( 3 );
TestReduceTeam< long, Kokkos::Serial, Kokkos::Schedule<Kokkos::Static> >( 100000 );
TestReduceTeam< long, Kokkos::Serial, Kokkos::Schedule<Kokkos::Dynamic> >( 100000 );
}
TEST_F( serial , team_double_reduce) {
TestReduceTeam< double , Kokkos::Serial , Kokkos::Schedule<Kokkos::Static> >( 0 );
TestReduceTeam< double , Kokkos::Serial , Kokkos::Schedule<Kokkos::Dynamic> >( 0 );
TestReduceTeam< double , Kokkos::Serial , Kokkos::Schedule<Kokkos::Static> >( 3 );
TestReduceTeam< double , Kokkos::Serial , Kokkos::Schedule<Kokkos::Dynamic> >( 3 );
TestReduceTeam< double , Kokkos::Serial , Kokkos::Schedule<Kokkos::Static> >( 100000 );
TestReduceTeam< double , Kokkos::Serial , Kokkos::Schedule<Kokkos::Dynamic> >( 100000 );
TEST_F( serial, team_double_reduce )
{
TestReduceTeam< double, Kokkos::Serial, Kokkos::Schedule<Kokkos::Static> >( 0 );
TestReduceTeam< double, Kokkos::Serial, Kokkos::Schedule<Kokkos::Dynamic> >( 0 );
TestReduceTeam< double, Kokkos::Serial, Kokkos::Schedule<Kokkos::Static> >( 3 );
TestReduceTeam< double, Kokkos::Serial, Kokkos::Schedule<Kokkos::Dynamic> >( 3 );
TestReduceTeam< double, Kokkos::Serial, Kokkos::Schedule<Kokkos::Static> >( 100000 );
TestReduceTeam< double, Kokkos::Serial, Kokkos::Schedule<Kokkos::Dynamic> >( 100000 );
}
TEST_F( serial , reduction_deduction )
TEST_F( serial, reduction_deduction )
{
TestCXX11::test_reduction_deduction< Kokkos::Serial >();
}
} // namespace test
} // namespace Test

View File

@ -40,53 +40,64 @@
// ************************************************************************
//@HEADER
*/
#include <serial/TestSerial.hpp>
namespace Test {
TEST_F( serial, view_subview_auto_1d_left ) {
TestViewSubview::test_auto_1d< Kokkos::LayoutLeft,Kokkos::Serial >();
TEST_F( serial, view_subview_auto_1d_left )
{
TestViewSubview::test_auto_1d< Kokkos::LayoutLeft, Kokkos::Serial >();
}
TEST_F( serial, view_subview_auto_1d_right ) {
TestViewSubview::test_auto_1d< Kokkos::LayoutRight,Kokkos::Serial >();
TEST_F( serial, view_subview_auto_1d_right )
{
TestViewSubview::test_auto_1d< Kokkos::LayoutRight, Kokkos::Serial >();
}
TEST_F( serial, view_subview_auto_1d_stride ) {
TestViewSubview::test_auto_1d< Kokkos::LayoutStride,Kokkos::Serial >();
TEST_F( serial, view_subview_auto_1d_stride )
{
TestViewSubview::test_auto_1d< Kokkos::LayoutStride, Kokkos::Serial >();
}
TEST_F( serial, view_subview_assign_strided ) {
TEST_F( serial, view_subview_assign_strided )
{
TestViewSubview::test_1d_strided_assignment< Kokkos::Serial >();
}
TEST_F( serial, view_subview_left_0 ) {
TEST_F( serial, view_subview_left_0 )
{
TestViewSubview::test_left_0< Kokkos::Serial >();
}
TEST_F( serial, view_subview_left_1 ) {
TEST_F( serial, view_subview_left_1 )
{
TestViewSubview::test_left_1< Kokkos::Serial >();
}
TEST_F( serial, view_subview_left_2 ) {
TEST_F( serial, view_subview_left_2 )
{
TestViewSubview::test_left_2< Kokkos::Serial >();
}
TEST_F( serial, view_subview_left_3 ) {
TEST_F( serial, view_subview_left_3 )
{
TestViewSubview::test_left_3< Kokkos::Serial >();
}
TEST_F( serial, view_subview_right_0 ) {
TEST_F( serial, view_subview_right_0 )
{
TestViewSubview::test_right_0< Kokkos::Serial >();
}
TEST_F( serial, view_subview_right_1 ) {
TEST_F( serial, view_subview_right_1 )
{
TestViewSubview::test_right_1< Kokkos::Serial >();
}
TEST_F( serial, view_subview_right_3 ) {
TEST_F( serial, view_subview_right_3 )
{
TestViewSubview::test_right_3< Kokkos::Serial >();
}
} // namespace test
} // namespace Test

View File

@ -40,21 +40,23 @@
// ************************************************************************
//@HEADER
*/
#include <serial/TestSerial.hpp>
namespace Test {
TEST_F( serial, view_subview_layoutleft_to_layoutleft) {
TEST_F( serial, view_subview_layoutleft_to_layoutleft )
{
TestViewSubview::test_layoutleft_to_layoutleft< Kokkos::Serial >();
TestViewSubview::test_layoutleft_to_layoutleft< Kokkos::Serial , Kokkos::MemoryTraits<Kokkos::Atomic> >();
TestViewSubview::test_layoutleft_to_layoutleft< Kokkos::Serial , Kokkos::MemoryTraits<Kokkos::RandomAccess> >();
TestViewSubview::test_layoutleft_to_layoutleft< Kokkos::Serial, Kokkos::MemoryTraits<Kokkos::Atomic> >();
TestViewSubview::test_layoutleft_to_layoutleft< Kokkos::Serial, Kokkos::MemoryTraits<Kokkos::RandomAccess> >();
}
TEST_F( serial, view_subview_layoutright_to_layoutright) {
TEST_F( serial, view_subview_layoutright_to_layoutright )
{
TestViewSubview::test_layoutright_to_layoutright< Kokkos::Serial >();
TestViewSubview::test_layoutright_to_layoutright< Kokkos::Serial , Kokkos::MemoryTraits<Kokkos::Atomic> >();
TestViewSubview::test_layoutright_to_layoutright< Kokkos::Serial , Kokkos::MemoryTraits<Kokkos::RandomAccess> >();
TestViewSubview::test_layoutright_to_layoutright< Kokkos::Serial, Kokkos::MemoryTraits<Kokkos::Atomic> >();
TestViewSubview::test_layoutright_to_layoutright< Kokkos::Serial, Kokkos::MemoryTraits<Kokkos::RandomAccess> >();
}
} // namespace test
} // namespace Test

View File

@ -40,13 +40,14 @@
// ************************************************************************
//@HEADER
*/
#include <serial/TestSerial.hpp>
namespace Test {
TEST_F( serial, view_subview_1d_assign ) {
TEST_F( serial, view_subview_1d_assign )
{
TestViewSubview::test_1d_assign< Kokkos::Serial >();
}
} // namespace test
} // namespace Test

View File

@ -40,13 +40,14 @@
// ************************************************************************
//@HEADER
*/
#include <serial/TestSerial.hpp>
namespace Test {
TEST_F( serial, view_subview_1d_assign_atomic ) {
TestViewSubview::test_1d_assign< Kokkos::Serial , Kokkos::MemoryTraits<Kokkos::Atomic> >();
TEST_F( serial, view_subview_1d_assign_atomic )
{
TestViewSubview::test_1d_assign< Kokkos::Serial, Kokkos::MemoryTraits<Kokkos::Atomic> >();
}
} // namespace test
} // namespace Test

View File

@ -40,13 +40,14 @@
// ************************************************************************
//@HEADER
*/
#include <serial/TestSerial.hpp>
namespace Test {
TEST_F( serial, view_subview_1d_assign_randomaccess ) {
TestViewSubview::test_1d_assign< Kokkos::Serial , Kokkos::MemoryTraits<Kokkos::RandomAccess> >();
TEST_F( serial, view_subview_1d_assign_randomaccess )
{
TestViewSubview::test_1d_assign< Kokkos::Serial, Kokkos::MemoryTraits<Kokkos::RandomAccess> >();
}
} // namespace test
} // namespace Test

View File

@ -40,13 +40,14 @@
// ************************************************************************
//@HEADER
*/
#include <serial/TestSerial.hpp>
namespace Test {
TEST_F( serial, view_subview_2d_from_3d ) {
TEST_F( serial, view_subview_2d_from_3d )
{
TestViewSubview::test_2d_subview_3d< Kokkos::Serial >();
}
} // namespace test
} // namespace Test

View File

@ -40,13 +40,14 @@
// ************************************************************************
//@HEADER
*/
#include <serial/TestSerial.hpp>
namespace Test {
TEST_F( serial, view_subview_2d_from_3d_atomic ) {
TestViewSubview::test_2d_subview_3d< Kokkos::Serial , Kokkos::MemoryTraits<Kokkos::Atomic> >();
TEST_F( serial, view_subview_2d_from_3d_atomic )
{
TestViewSubview::test_2d_subview_3d< Kokkos::Serial, Kokkos::MemoryTraits<Kokkos::Atomic> >();
}
} // namespace test
} // namespace Test

View File

@ -40,13 +40,14 @@
// ************************************************************************
//@HEADER
*/
#include <serial/TestSerial.hpp>
namespace Test {
TEST_F( serial, view_subview_2d_from_3d_randomaccess ) {
TestViewSubview::test_2d_subview_3d< Kokkos::Serial , Kokkos::MemoryTraits<Kokkos::RandomAccess> >();
TEST_F( serial, view_subview_2d_from_3d_randomaccess )
{
TestViewSubview::test_2d_subview_3d< Kokkos::Serial, Kokkos::MemoryTraits<Kokkos::RandomAccess> >();
}
} // namespace test
} // namespace Test

View File

@ -40,13 +40,14 @@
// ************************************************************************
//@HEADER
*/
#include <serial/TestSerial.hpp>
namespace Test {
TEST_F( serial, view_subview_3d_from_5d_left ) {
TEST_F( serial, view_subview_3d_from_5d_left )
{
TestViewSubview::test_3d_subview_5d_left< Kokkos::Serial >();
}
} // namespace test
} // namespace Test

View File

@ -40,13 +40,14 @@
// ************************************************************************
//@HEADER
*/
#include <serial/TestSerial.hpp>
namespace Test {
TEST_F( serial, view_subview_3d_from_5d_left_atomic ) {
TestViewSubview::test_3d_subview_5d_left< Kokkos::Serial , Kokkos::MemoryTraits<Kokkos::Atomic> >();
TEST_F( serial, view_subview_3d_from_5d_left_atomic )
{
TestViewSubview::test_3d_subview_5d_left< Kokkos::Serial, Kokkos::MemoryTraits<Kokkos::Atomic> >();
}
} // namespace test
} // namespace Test

View File

@ -40,13 +40,14 @@
// ************************************************************************
//@HEADER
*/
#include <serial/TestSerial.hpp>
namespace Test {
TEST_F( serial, view_subview_3d_from_5d_left_randomaccess ) {
TestViewSubview::test_3d_subview_5d_left< Kokkos::Serial , Kokkos::MemoryTraits<Kokkos::RandomAccess> >();
TEST_F( serial, view_subview_3d_from_5d_left_randomaccess )
{
TestViewSubview::test_3d_subview_5d_left< Kokkos::Serial, Kokkos::MemoryTraits<Kokkos::RandomAccess> >();
}
} // namespace test
} // namespace Test

View File

@ -40,13 +40,14 @@
// ************************************************************************
//@HEADER
*/
#include <serial/TestSerial.hpp>
namespace Test {
TEST_F( serial, view_subview_3d_from_5d_right ) {
TEST_F( serial, view_subview_3d_from_5d_right )
{
TestViewSubview::test_3d_subview_5d_right< Kokkos::Serial >();
}
} // namespace test
} // namespace Test

View File

@ -40,13 +40,14 @@
// ************************************************************************
//@HEADER
*/
#include <serial/TestSerial.hpp>
namespace Test {
TEST_F( serial, view_subview_3d_from_5d_right_atomic ) {
TestViewSubview::test_3d_subview_5d_right< Kokkos::Serial , Kokkos::MemoryTraits<Kokkos::Atomic> >();
TEST_F( serial, view_subview_3d_from_5d_right_atomic )
{
TestViewSubview::test_3d_subview_5d_right< Kokkos::Serial, Kokkos::MemoryTraits<Kokkos::Atomic> >();
}
} // namespace test
} // namespace Test

View File

@ -40,13 +40,14 @@
// ************************************************************************
//@HEADER
*/
#include <serial/TestSerial.hpp>
namespace Test {
TEST_F( serial, view_subview_3d_from_5d_right_randomaccess ) {
TestViewSubview::test_3d_subview_5d_right< Kokkos::Serial , Kokkos::MemoryTraits<Kokkos::RandomAccess> >();
TEST_F( serial, view_subview_3d_from_5d_right_randomaccess )
{
TestViewSubview::test_3d_subview_5d_right< Kokkos::Serial, Kokkos::MemoryTraits<Kokkos::RandomAccess> >();
}
} // namespace test
} // namespace Test

View File

@ -1,12 +1,12 @@
#include<serial/TestSerial_SubView_c01.cpp>
#include<serial/TestSerial_SubView_c02.cpp>
#include<serial/TestSerial_SubView_c03.cpp>
#include<serial/TestSerial_SubView_c04.cpp>
#include<serial/TestSerial_SubView_c05.cpp>
#include<serial/TestSerial_SubView_c06.cpp>
#include<serial/TestSerial_SubView_c07.cpp>
#include<serial/TestSerial_SubView_c08.cpp>
#include<serial/TestSerial_SubView_c09.cpp>
#include<serial/TestSerial_SubView_c10.cpp>
#include<serial/TestSerial_SubView_c11.cpp>
#include<serial/TestSerial_SubView_c12.cpp>
#include <serial/TestSerial_SubView_c01.cpp>
#include <serial/TestSerial_SubView_c02.cpp>
#include <serial/TestSerial_SubView_c03.cpp>
#include <serial/TestSerial_SubView_c04.cpp>
#include <serial/TestSerial_SubView_c05.cpp>
#include <serial/TestSerial_SubView_c06.cpp>
#include <serial/TestSerial_SubView_c07.cpp>
#include <serial/TestSerial_SubView_c08.cpp>
#include <serial/TestSerial_SubView_c09.cpp>
#include <serial/TestSerial_SubView_c10.cpp>
#include <serial/TestSerial_SubView_c11.cpp>
#include <serial/TestSerial_SubView_c12.cpp>

View File

@ -40,62 +40,68 @@
// ************************************************************************
//@HEADER
*/
#include <serial/TestSerial.hpp>
namespace Test {
TEST_F( serial , team_tag )
TEST_F( serial, team_tag )
{
TestTeamPolicy< Kokkos::Serial , Kokkos::Schedule<Kokkos::Static> >::test_for(0);
TestTeamPolicy< Kokkos::Serial , Kokkos::Schedule<Kokkos::Static> >::test_reduce(0);
TestTeamPolicy< Kokkos::Serial , Kokkos::Schedule<Kokkos::Dynamic> >::test_for(0);
TestTeamPolicy< Kokkos::Serial , Kokkos::Schedule<Kokkos::Dynamic> >::test_reduce(0);
TestTeamPolicy< Kokkos::Serial, Kokkos::Schedule<Kokkos::Static> >::test_for( 0 );
TestTeamPolicy< Kokkos::Serial, Kokkos::Schedule<Kokkos::Static> >::test_reduce( 0 );
TestTeamPolicy< Kokkos::Serial, Kokkos::Schedule<Kokkos::Dynamic> >::test_for( 0 );
TestTeamPolicy< Kokkos::Serial, Kokkos::Schedule<Kokkos::Dynamic> >::test_reduce( 0 );
TestTeamPolicy< Kokkos::Serial , Kokkos::Schedule<Kokkos::Static> >::test_for(1000);
TestTeamPolicy< Kokkos::Serial , Kokkos::Schedule<Kokkos::Static> >::test_reduce(1000);
TestTeamPolicy< Kokkos::Serial , Kokkos::Schedule<Kokkos::Dynamic> >::test_for(1000);
TestTeamPolicy< Kokkos::Serial , Kokkos::Schedule<Kokkos::Dynamic> >::test_reduce(1000);
TestTeamPolicy< Kokkos::Serial, Kokkos::Schedule<Kokkos::Static> >::test_for( 1000 );
TestTeamPolicy< Kokkos::Serial, Kokkos::Schedule<Kokkos::Static> >::test_reduce( 1000 );
TestTeamPolicy< Kokkos::Serial, Kokkos::Schedule<Kokkos::Dynamic> >::test_for( 1000 );
TestTeamPolicy< Kokkos::Serial, Kokkos::Schedule<Kokkos::Dynamic> >::test_reduce( 1000 );
}
TEST_F( serial , team_shared_request) {
TestSharedTeam< Kokkos::Serial , Kokkos::Schedule<Kokkos::Static> >();
TestSharedTeam< Kokkos::Serial , Kokkos::Schedule<Kokkos::Dynamic> >();
TEST_F( serial, team_shared_request )
{
TestSharedTeam< Kokkos::Serial, Kokkos::Schedule<Kokkos::Static> >();
TestSharedTeam< Kokkos::Serial, Kokkos::Schedule<Kokkos::Dynamic> >();
}
TEST_F( serial, team_scratch_request) {
TestScratchTeam< Kokkos::Serial , Kokkos::Schedule<Kokkos::Static> >();
TestScratchTeam< Kokkos::Serial , Kokkos::Schedule<Kokkos::Dynamic> >();
TEST_F( serial, team_scratch_request )
{
TestScratchTeam< Kokkos::Serial, Kokkos::Schedule<Kokkos::Static> >();
TestScratchTeam< Kokkos::Serial, Kokkos::Schedule<Kokkos::Dynamic> >();
}
#if defined(KOKKOS_ENABLE_CXX11_DISPATCH_LAMBDA)
TEST_F( serial , team_lambda_shared_request) {
TestLambdaSharedTeam< Kokkos::HostSpace, Kokkos::Serial , Kokkos::Schedule<Kokkos::Static> >();
TestLambdaSharedTeam< Kokkos::HostSpace, Kokkos::Serial , Kokkos::Schedule<Kokkos::Dynamic> >();
#if defined( KOKKOS_ENABLE_CXX11_DISPATCH_LAMBDA )
TEST_F( serial, team_lambda_shared_request )
{
TestLambdaSharedTeam< Kokkos::HostSpace, Kokkos::Serial, Kokkos::Schedule<Kokkos::Static> >();
TestLambdaSharedTeam< Kokkos::HostSpace, Kokkos::Serial, Kokkos::Schedule<Kokkos::Dynamic> >();
}
#endif
TEST_F( serial, shmem_size) {
TEST_F( serial, shmem_size )
{
TestShmemSize< Kokkos::Serial >();
}
TEST_F( serial, multi_level_scratch) {
TestMultiLevelScratchTeam< Kokkos::Serial , Kokkos::Schedule<Kokkos::Static> >();
TestMultiLevelScratchTeam< Kokkos::Serial , Kokkos::Schedule<Kokkos::Dynamic> >();
TEST_F( serial, multi_level_scratch )
{
TestMultiLevelScratchTeam< Kokkos::Serial, Kokkos::Schedule<Kokkos::Static> >();
TestMultiLevelScratchTeam< Kokkos::Serial, Kokkos::Schedule<Kokkos::Dynamic> >();
}
TEST_F( serial , team_vector )
TEST_F( serial, team_vector )
{
ASSERT_TRUE( ( TestTeamVector::Test< Kokkos::Serial >(0) ) );
ASSERT_TRUE( ( TestTeamVector::Test< Kokkos::Serial >(1) ) );
ASSERT_TRUE( ( TestTeamVector::Test< Kokkos::Serial >(2) ) );
ASSERT_TRUE( ( TestTeamVector::Test< Kokkos::Serial >(3) ) );
ASSERT_TRUE( ( TestTeamVector::Test< Kokkos::Serial >(4) ) );
ASSERT_TRUE( ( TestTeamVector::Test< Kokkos::Serial >(5) ) );
ASSERT_TRUE( ( TestTeamVector::Test< Kokkos::Serial >(6) ) );
ASSERT_TRUE( ( TestTeamVector::Test< Kokkos::Serial >(7) ) );
ASSERT_TRUE( ( TestTeamVector::Test< Kokkos::Serial >(8) ) );
ASSERT_TRUE( ( TestTeamVector::Test< Kokkos::Serial >(9) ) );
ASSERT_TRUE( ( TestTeamVector::Test< Kokkos::Serial >(10) ) );
ASSERT_TRUE( ( TestTeamVector::Test< Kokkos::Serial >( 0 ) ) );
ASSERT_TRUE( ( TestTeamVector::Test< Kokkos::Serial >( 1 ) ) );
ASSERT_TRUE( ( TestTeamVector::Test< Kokkos::Serial >( 2 ) ) );
ASSERT_TRUE( ( TestTeamVector::Test< Kokkos::Serial >( 3 ) ) );
ASSERT_TRUE( ( TestTeamVector::Test< Kokkos::Serial >( 4 ) ) );
ASSERT_TRUE( ( TestTeamVector::Test< Kokkos::Serial >( 5 ) ) );
ASSERT_TRUE( ( TestTeamVector::Test< Kokkos::Serial >( 6 ) ) );
ASSERT_TRUE( ( TestTeamVector::Test< Kokkos::Serial >( 7 ) ) );
ASSERT_TRUE( ( TestTeamVector::Test< Kokkos::Serial >( 8 ) ) );
ASSERT_TRUE( ( TestTeamVector::Test< Kokkos::Serial >( 9 ) ) );
ASSERT_TRUE( ( TestTeamVector::Test< Kokkos::Serial >( 10 ) ) );
}
#ifdef KOKKOS_COMPILER_GNU
@ -107,11 +113,10 @@ TEST_F( serial , team_vector )
#ifndef SKIP_TEST
TEST_F( serial, triple_nested_parallelism )
{
TestTripleNestedReduce< double, Kokkos::Serial >( 8192, 2048 , 32 , 32 );
TestTripleNestedReduce< double, Kokkos::Serial >( 8192, 2048 , 32 , 16 );
TestTripleNestedReduce< double, Kokkos::Serial >( 8192, 2048 , 16 , 16 );
TestTripleNestedReduce< double, Kokkos::Serial >( 8192, 2048, 32, 32 );
TestTripleNestedReduce< double, Kokkos::Serial >( 8192, 2048, 32, 16 );
TestTripleNestedReduce< double, Kokkos::Serial >( 8192, 2048, 16, 16 );
}
#endif
} // namespace test
} // namespace Test

View File

@ -40,14 +40,15 @@
// ************************************************************************
//@HEADER
*/
#include <serial/TestSerial.hpp>
namespace Test {
TEST_F( serial , impl_view_mapping_a ) {
TEST_F( serial, impl_view_mapping_a )
{
test_view_mapping< Kokkos::Serial >();
test_view_mapping_operator< Kokkos::Serial >();
}
} // namespace test
} // namespace Test

View File

@ -40,82 +40,85 @@
// ************************************************************************
//@HEADER
*/
#include <serial/TestSerial.hpp>
namespace Test {
TEST_F( serial , impl_shared_alloc ) {
test_shared_alloc< Kokkos::HostSpace , Kokkos::Serial >();
TEST_F( serial, impl_shared_alloc )
{
test_shared_alloc< Kokkos::HostSpace, Kokkos::Serial >();
}
TEST_F( serial , impl_view_mapping_b ) {
TEST_F( serial, impl_view_mapping_b )
{
test_view_mapping_subview< Kokkos::Serial >();
TestViewMappingAtomic< Kokkos::Serial >::run();
}
TEST_F( serial, view_api) {
TestViewAPI< double , Kokkos::Serial >();
TEST_F( serial, view_api )
{
TestViewAPI< double, Kokkos::Serial >();
}
TEST_F( serial , view_nested_view )
TEST_F( serial, view_nested_view )
{
::Test::view_nested_view< Kokkos::Serial >();
}
TEST_F( serial , view_remap )
TEST_F( serial, view_remap )
{
enum { N0 = 3 , N1 = 2 , N2 = 8 , N3 = 9 };
enum { N0 = 3, N1 = 2, N2 = 8, N3 = 9 };
typedef Kokkos::View< double*[N1][N2][N3] ,
Kokkos::LayoutRight ,
Kokkos::Serial > output_type ;
typedef Kokkos::View< double*[N1][N2][N3],
Kokkos::LayoutRight,
Kokkos::Serial > output_type;
typedef Kokkos::View< int**[N2][N3] ,
Kokkos::LayoutLeft ,
Kokkos::Serial > input_type ;
typedef Kokkos::View< int**[N2][N3],
Kokkos::LayoutLeft,
Kokkos::Serial > input_type;
typedef Kokkos::View< int*[N0][N2][N3] ,
Kokkos::LayoutLeft ,
Kokkos::Serial > diff_type ;
typedef Kokkos::View< int*[N0][N2][N3],
Kokkos::LayoutLeft,
Kokkos::Serial > diff_type;
output_type output( "output" , N0 );
input_type input ( "input" , N0 , N1 );
diff_type diff ( "diff" , N0 );
output_type output( "output", N0 );
input_type input ( "input", N0, N1 );
diff_type diff ( "diff", N0 );
int value = 0 ;
for ( size_t i3 = 0 ; i3 < N3 ; ++i3 ) {
for ( size_t i2 = 0 ; i2 < N2 ; ++i2 ) {
for ( size_t i1 = 0 ; i1 < N1 ; ++i1 ) {
for ( size_t i0 = 0 ; i0 < N0 ; ++i0 ) {
input(i0,i1,i2,i3) = ++value ;
}}}}
int value = 0;
// Kokkos::deep_copy( diff , input ); // throw with incompatible shape
Kokkos::deep_copy( output , input );
for ( size_t i3 = 0; i3 < N3; ++i3 )
for ( size_t i2 = 0; i2 < N2; ++i2 )
for ( size_t i1 = 0; i1 < N1; ++i1 )
for ( size_t i0 = 0; i0 < N0; ++i0 )
{
input( i0, i1, i2, i3 ) = ++value;
}
value = 0 ;
for ( size_t i3 = 0 ; i3 < N3 ; ++i3 ) {
for ( size_t i2 = 0 ; i2 < N2 ; ++i2 ) {
for ( size_t i1 = 0 ; i1 < N1 ; ++i1 ) {
for ( size_t i0 = 0 ; i0 < N0 ; ++i0 ) {
++value ;
ASSERT_EQ( value , ((int) output(i0,i1,i2,i3) ) );
}}}}
// Kokkos::deep_copy( diff, input ); // Throw with incompatible shape.
Kokkos::deep_copy( output, input );
value = 0;
for ( size_t i3 = 0; i3 < N3; ++i3 )
for ( size_t i2 = 0; i2 < N2; ++i2 )
for ( size_t i1 = 0; i1 < N1; ++i1 )
for ( size_t i0 = 0; i0 < N0; ++i0 )
{
++value;
ASSERT_EQ( value, ( (int) output( i0, i1, i2, i3 ) ) );
}
}
//----------------------------------------------------------------------------
TEST_F( serial , view_aggregate )
TEST_F( serial, view_aggregate )
{
TestViewAggregate< Kokkos::Serial >();
}
TEST_F( serial , template_meta_functions )
TEST_F( serial, template_meta_functions )
{
TestTemplateMetaFunctions<int, Kokkos::Serial >();
TestTemplateMetaFunctions< int, Kokkos::Serial >();
}
} // namespace test
} // namespace Test