Update Kokkos library to v2.03.13
This commit is contained in:
@ -61,14 +61,19 @@ protected:
|
||||
{
|
||||
std::cout << std::setprecision(5) << std::scientific;
|
||||
|
||||
unsigned threads_count = omp_get_max_threads();
|
||||
int threads_count = 0;
|
||||
#pragma omp parallel
|
||||
{
|
||||
#pragma omp atomic
|
||||
++threads_count;
|
||||
}
|
||||
|
||||
if ( Kokkos::hwloc::available() ) {
|
||||
threads_count = Kokkos::hwloc::get_available_numa_count() *
|
||||
Kokkos::hwloc::get_available_cores_per_numa();
|
||||
if (threads_count > 3) {
|
||||
threads_count /= 2;
|
||||
}
|
||||
|
||||
Kokkos::OpenMP::initialize( threads_count );
|
||||
Kokkos::OpenMP::print_configuration( std::cout );
|
||||
}
|
||||
|
||||
static void TearDownTestCase()
|
||||
|
||||
@ -1,12 +1,12 @@
|
||||
//@HEADER
|
||||
// ************************************************************************
|
||||
//
|
||||
//
|
||||
// Kokkos v. 2.0
|
||||
// Copyright (2014) Sandia Corporation
|
||||
//
|
||||
//
|
||||
// Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
|
||||
// the U.S. Government retains certain rights in this software.
|
||||
//
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions are
|
||||
// met:
|
||||
@ -35,7 +35,7 @@
|
||||
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
//
|
||||
// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov)
|
||||
//
|
||||
//
|
||||
// ************************************************************************
|
||||
//@HEADER
|
||||
|
||||
@ -283,12 +283,12 @@ struct test_random_scalar {
|
||||
RandomGenerator& pool,
|
||||
unsigned int num_draws)
|
||||
{
|
||||
using std::cerr;
|
||||
using std::cout;
|
||||
using std::endl;
|
||||
using Kokkos::parallel_reduce;
|
||||
|
||||
{
|
||||
cerr << " -- Testing randomness properties" << endl;
|
||||
cout << " -- Testing randomness properties" << endl;
|
||||
|
||||
RandomProperties result;
|
||||
typedef test_random_functor<RandomGenerator, Scalar> functor_type;
|
||||
@ -307,7 +307,7 @@ struct test_random_scalar {
|
||||
( 1.5*tolerance > variance_eps)) ? 1:0;
|
||||
pass_covar = ((-2.0*tolerance < covariance_eps) &&
|
||||
( 2.0*tolerance > covariance_eps)) ? 1:0;
|
||||
cerr << "Pass: " << pass_mean
|
||||
cout << "Pass: " << pass_mean
|
||||
<< " " << pass_var
|
||||
<< " " << mean_eps
|
||||
<< " " << variance_eps
|
||||
@ -315,7 +315,7 @@ struct test_random_scalar {
|
||||
<< " || " << tolerance << endl;
|
||||
}
|
||||
{
|
||||
cerr << " -- Testing 1-D histogram" << endl;
|
||||
cout << " -- Testing 1-D histogram" << endl;
|
||||
|
||||
RandomProperties result;
|
||||
typedef test_histogram1d_functor<typename RandomGenerator::device_type> functor_type;
|
||||
@ -335,7 +335,7 @@ struct test_random_scalar {
|
||||
pass_hist1d_covar = ((-0.06 < covariance_eps) &&
|
||||
( 0.06 > covariance_eps)) ? 1:0;
|
||||
|
||||
cerr << "Density 1D: " << mean_eps
|
||||
cout << "Density 1D: " << mean_eps
|
||||
<< " " << variance_eps
|
||||
<< " " << (result.covariance/HIST_DIM1D/HIST_DIM1D)
|
||||
<< " || " << tolerance
|
||||
@ -348,7 +348,7 @@ struct test_random_scalar {
|
||||
<< endl;
|
||||
}
|
||||
{
|
||||
cerr << " -- Testing 3-D histogram" << endl;
|
||||
cout << " -- Testing 3-D histogram" << endl;
|
||||
|
||||
RandomProperties result;
|
||||
typedef test_histogram3d_functor<typename RandomGenerator::device_type> functor_type;
|
||||
@ -368,7 +368,7 @@ struct test_random_scalar {
|
||||
pass_hist3d_covar = ((-tolerance < covariance_eps) &&
|
||||
( tolerance > covariance_eps)) ? 1:0;
|
||||
|
||||
cerr << "Density 3D: " << mean_eps
|
||||
cout << "Density 3D: " << mean_eps
|
||||
<< " " << variance_eps
|
||||
<< " " << result.covariance/HIST_DIM1D/HIST_DIM1D
|
||||
<< " || " << tolerance
|
||||
@ -381,18 +381,18 @@ struct test_random_scalar {
|
||||
template <class RandomGenerator>
|
||||
void test_random(unsigned int num_draws)
|
||||
{
|
||||
using std::cerr;
|
||||
using std::cout;
|
||||
using std::endl;
|
||||
typename test_random_functor<RandomGenerator,int>::type_1d density_1d("D1d");
|
||||
typename test_random_functor<RandomGenerator,int>::type_3d density_3d("D3d");
|
||||
|
||||
|
||||
uint64_t ticks = std::chrono::high_resolution_clock::now().time_since_epoch().count();
|
||||
cerr << "Test Seed:" << ticks << endl;
|
||||
cout << "Test Seed:" << ticks << endl;
|
||||
|
||||
RandomGenerator pool(ticks);
|
||||
|
||||
cerr << "Test Scalar=int" << endl;
|
||||
cout << "Test Scalar=int" << endl;
|
||||
test_random_scalar<RandomGenerator,int> test_int(density_1d,density_3d,pool,num_draws);
|
||||
ASSERT_EQ( test_int.pass_mean,1);
|
||||
ASSERT_EQ( test_int.pass_var,1);
|
||||
@ -406,7 +406,7 @@ void test_random(unsigned int num_draws)
|
||||
deep_copy(density_1d,0);
|
||||
deep_copy(density_3d,0);
|
||||
|
||||
cerr << "Test Scalar=unsigned int" << endl;
|
||||
cout << "Test Scalar=unsigned int" << endl;
|
||||
test_random_scalar<RandomGenerator,unsigned int> test_uint(density_1d,density_3d,pool,num_draws);
|
||||
ASSERT_EQ( test_uint.pass_mean,1);
|
||||
ASSERT_EQ( test_uint.pass_var,1);
|
||||
@ -420,7 +420,7 @@ void test_random(unsigned int num_draws)
|
||||
deep_copy(density_1d,0);
|
||||
deep_copy(density_3d,0);
|
||||
|
||||
cerr << "Test Scalar=int64_t" << endl;
|
||||
cout << "Test Scalar=int64_t" << endl;
|
||||
test_random_scalar<RandomGenerator,int64_t> test_int64(density_1d,density_3d,pool,num_draws);
|
||||
ASSERT_EQ( test_int64.pass_mean,1);
|
||||
ASSERT_EQ( test_int64.pass_var,1);
|
||||
@ -434,7 +434,7 @@ void test_random(unsigned int num_draws)
|
||||
deep_copy(density_1d,0);
|
||||
deep_copy(density_3d,0);
|
||||
|
||||
cerr << "Test Scalar=uint64_t" << endl;
|
||||
cout << "Test Scalar=uint64_t" << endl;
|
||||
test_random_scalar<RandomGenerator,uint64_t> test_uint64(density_1d,density_3d,pool,num_draws);
|
||||
ASSERT_EQ( test_uint64.pass_mean,1);
|
||||
ASSERT_EQ( test_uint64.pass_var,1);
|
||||
@ -448,7 +448,7 @@ void test_random(unsigned int num_draws)
|
||||
deep_copy(density_1d,0);
|
||||
deep_copy(density_3d,0);
|
||||
|
||||
cerr << "Test Scalar=float" << endl;
|
||||
cout << "Test Scalar=float" << endl;
|
||||
test_random_scalar<RandomGenerator,float> test_float(density_1d,density_3d,pool,num_draws);
|
||||
ASSERT_EQ( test_float.pass_mean,1);
|
||||
ASSERT_EQ( test_float.pass_var,1);
|
||||
@ -462,7 +462,7 @@ void test_random(unsigned int num_draws)
|
||||
deep_copy(density_1d,0);
|
||||
deep_copy(density_3d,0);
|
||||
|
||||
cerr << "Test Scalar=double" << endl;
|
||||
cout << "Test Scalar=double" << endl;
|
||||
test_random_scalar<RandomGenerator,double> test_double(density_1d,density_3d,pool,num_draws);
|
||||
ASSERT_EQ( test_double.pass_mean,1);
|
||||
ASSERT_EQ( test_double.pass_var,1);
|
||||
|
||||
@ -1,13 +1,13 @@
|
||||
/*
|
||||
//@HEADER
|
||||
// ************************************************************************
|
||||
//
|
||||
//
|
||||
// Kokkos v. 2.0
|
||||
// Copyright (2014) Sandia Corporation
|
||||
//
|
||||
//
|
||||
// Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
|
||||
// the U.S. Government retains certain rights in this software.
|
||||
//
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions are
|
||||
// met:
|
||||
@ -36,7 +36,7 @@
|
||||
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
//
|
||||
// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov)
|
||||
//
|
||||
//
|
||||
// ************************************************************************
|
||||
//@HEADER
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user