Update Kokkos library in LAMMPS to v3.2
This commit is contained in:
@ -49,11 +49,19 @@ SET(SOURCES
|
||||
)
|
||||
|
||||
IF(Kokkos_ENABLE_HIP)
|
||||
# FIXME requires TeamPolicy
|
||||
# FIXME HIP requires TeamPolicy
|
||||
LIST(REMOVE_ITEM SOURCES
|
||||
PerfTest_CustomReduction.cpp
|
||||
PerfTest_ExecSpacePartitioning.cpp
|
||||
)
|
||||
)
|
||||
ENDIF()
|
||||
|
||||
IF(Kokkos_ENABLE_OPENMPTARGET)
|
||||
# FIXME OPENMPTARGET requires TeamPolicy Reductions and Custom Reduction
|
||||
LIST(REMOVE_ITEM SOURCES
|
||||
PerfTest_CustomReduction.cpp
|
||||
PerfTest_ExecSpacePartitioning.cpp
|
||||
)
|
||||
ENDIF()
|
||||
|
||||
# Per #374, we always want to build this test, but we only want to run
|
||||
@ -76,7 +84,22 @@ IF(NOT KOKKOS_CXX_COMPILER_ID STREQUAL "MSVC")
|
||||
ENDIF()
|
||||
|
||||
KOKKOS_ADD_EXECUTABLE_AND_TEST(
|
||||
PerformanceTest_TaskDag
|
||||
SOURCES test_taskdag.cpp
|
||||
PerformanceTest_Atomic
|
||||
SOURCES test_atomic.cpp
|
||||
CATEGORIES PERFORMANCE
|
||||
)
|
||||
|
||||
KOKKOS_ADD_EXECUTABLE_AND_TEST(
|
||||
PerformanceTest_Mempool
|
||||
SOURCES test_mempool.cpp
|
||||
CATEGORIES PERFORMANCE
|
||||
)
|
||||
|
||||
IF(NOT Kokkos_ENABLE_OPENMPTARGET)
|
||||
# FIXME OPENMPTARGET needs tasking
|
||||
KOKKOS_ADD_EXECUTABLE_AND_TEST(
|
||||
PerformanceTest_TaskDag
|
||||
SOURCES test_taskdag.cpp
|
||||
CATEGORIES PERFORMANCE
|
||||
)
|
||||
ENDIF()
|
||||
|
||||
@ -53,7 +53,6 @@ TEST_TARGETS += test-atomic
|
||||
|
||||
#
|
||||
|
||||
ifneq ($(KOKKOS_INTERNAL_USE_ROCM), 1)
|
||||
OBJ_MEMPOOL = test_mempool.o
|
||||
TARGETS += KokkosCore_PerformanceTest_Mempool
|
||||
TEST_TARGETS += test-mempool
|
||||
@ -63,7 +62,6 @@ TEST_TARGETS += test-mempool
|
||||
OBJ_TASKDAG = test_taskdag.o
|
||||
TARGETS += KokkosCore_PerformanceTest_TaskDAG
|
||||
TEST_TARGETS += test-taskdag
|
||||
endif
|
||||
|
||||
#
|
||||
|
||||
|
||||
@ -51,12 +51,12 @@ namespace Kokkos {
|
||||
|
||||
template <class Type>
|
||||
struct Dot {
|
||||
typedef typename Type::execution_space execution_space;
|
||||
using execution_space = typename Type::execution_space;
|
||||
|
||||
static_assert(static_cast<unsigned>(Type::Rank) == static_cast<unsigned>(1),
|
||||
"Dot static_assert Fail: Rank != 1");
|
||||
|
||||
typedef double value_type;
|
||||
using value_type = double;
|
||||
|
||||
#if 1
|
||||
typename Type::const_type X;
|
||||
@ -83,12 +83,12 @@ struct Dot {
|
||||
|
||||
template <class Type>
|
||||
struct DotSingle {
|
||||
typedef typename Type::execution_space execution_space;
|
||||
using execution_space = typename Type::execution_space;
|
||||
|
||||
static_assert(static_cast<unsigned>(Type::Rank) == static_cast<unsigned>(1),
|
||||
"DotSingle static_assert Fail: Rank != 1");
|
||||
|
||||
typedef double value_type;
|
||||
using value_type = double;
|
||||
|
||||
#if 1
|
||||
typename Type::const_type X;
|
||||
@ -116,7 +116,7 @@ struct DotSingle {
|
||||
|
||||
template <class ScalarType, class VectorType>
|
||||
struct Scale {
|
||||
typedef typename VectorType::execution_space execution_space;
|
||||
using execution_space = typename VectorType::execution_space;
|
||||
|
||||
static_assert(static_cast<unsigned>(ScalarType::Rank) ==
|
||||
static_cast<unsigned>(0),
|
||||
@ -143,7 +143,7 @@ struct Scale {
|
||||
|
||||
template <class ScalarType, class ConstVectorType, class VectorType>
|
||||
struct AXPBY {
|
||||
typedef typename VectorType::execution_space execution_space;
|
||||
using execution_space = typename VectorType::execution_space;
|
||||
|
||||
static_assert(static_cast<unsigned>(ScalarType::Rank) ==
|
||||
static_cast<unsigned>(0),
|
||||
@ -185,7 +185,7 @@ namespace Kokkos {
|
||||
template <class ConstScalarType, class ConstVectorType, class VectorType>
|
||||
void axpby(const ConstScalarType& alpha, const ConstVectorType& X,
|
||||
const ConstScalarType& beta, const VectorType& Y) {
|
||||
typedef AXPBY<ConstScalarType, ConstVectorType, VectorType> functor;
|
||||
using functor = AXPBY<ConstScalarType, ConstVectorType, VectorType>;
|
||||
|
||||
parallel_for(Y.extent(0), functor(alpha, X, beta, Y));
|
||||
}
|
||||
@ -193,7 +193,7 @@ void axpby(const ConstScalarType& alpha, const ConstVectorType& X,
|
||||
/** \brief Y *= alpha */
|
||||
template <class ConstScalarType, class VectorType>
|
||||
void scale(const ConstScalarType& alpha, const VectorType& Y) {
|
||||
typedef Scale<ConstScalarType, VectorType> functor;
|
||||
using functor = Scale<ConstScalarType, VectorType>;
|
||||
|
||||
parallel_for(Y.extent(0), functor(alpha, Y));
|
||||
}
|
||||
@ -201,14 +201,14 @@ void scale(const ConstScalarType& alpha, const VectorType& Y) {
|
||||
template <class ConstVectorType, class Finalize>
|
||||
void dot(const ConstVectorType& X, const ConstVectorType& Y,
|
||||
const Finalize& finalize) {
|
||||
typedef Dot<ConstVectorType> functor;
|
||||
using functor = Dot<ConstVectorType>;
|
||||
|
||||
parallel_reduce(X.extent(0), functor(X, Y), finalize);
|
||||
}
|
||||
|
||||
template <class ConstVectorType, class Finalize>
|
||||
void dot(const ConstVectorType& X, const Finalize& finalize) {
|
||||
typedef DotSingle<ConstVectorType> functor;
|
||||
using functor = DotSingle<ConstVectorType>;
|
||||
|
||||
parallel_reduce(X.extent(0), functor(X), finalize);
|
||||
}
|
||||
|
||||
@ -58,7 +58,7 @@ namespace Test {
|
||||
// PostProcess : R(j,j) = result ; inv = 1 / result ;
|
||||
template <class VectorView, class ValueView>
|
||||
struct InvNorm2 : public Kokkos::DotSingle<VectorView> {
|
||||
typedef typename Kokkos::DotSingle<VectorView>::value_type value_type;
|
||||
using value_type = typename Kokkos::DotSingle<VectorView>::value_type;
|
||||
|
||||
ValueView Rjj;
|
||||
ValueView inv;
|
||||
@ -69,10 +69,7 @@ struct InvNorm2 : public Kokkos::DotSingle<VectorView> {
|
||||
|
||||
KOKKOS_INLINE_FUNCTION
|
||||
void final(value_type& result) const {
|
||||
#ifndef KOKKOS_ENABLE_HIP // FIXME_HIP
|
||||
using std::sqrt;
|
||||
#endif
|
||||
result = sqrt(result);
|
||||
result = std::sqrt(result);
|
||||
Rjj() = result;
|
||||
inv() = (0 < result) ? 1.0 / result : 0;
|
||||
}
|
||||
@ -88,7 +85,7 @@ inline void invnorm2(const VectorView& x, const ValueView& r,
|
||||
// PostProcess : tmp = - ( R(j,k) = result );
|
||||
template <class VectorView, class ValueView>
|
||||
struct DotM : public Kokkos::Dot<VectorView> {
|
||||
typedef typename Kokkos::Dot<VectorView>::value_type value_type;
|
||||
using value_type = typename Kokkos::Dot<VectorView>::value_type;
|
||||
|
||||
ValueView Rjk;
|
||||
ValueView tmp;
|
||||
@ -113,16 +110,16 @@ inline void dot_neg(const VectorView& x, const VectorView& y,
|
||||
|
||||
template <typename Scalar, class DeviceType>
|
||||
struct ModifiedGramSchmidt {
|
||||
typedef DeviceType execution_space;
|
||||
typedef typename execution_space::size_type size_type;
|
||||
using execution_space = DeviceType;
|
||||
using size_type = typename execution_space::size_type;
|
||||
|
||||
typedef Kokkos::View<Scalar**, Kokkos::LayoutLeft, execution_space>
|
||||
multivector_type;
|
||||
using multivector_type =
|
||||
Kokkos::View<Scalar**, Kokkos::LayoutLeft, execution_space>;
|
||||
|
||||
typedef Kokkos::View<Scalar*, Kokkos::LayoutLeft, execution_space>
|
||||
vector_type;
|
||||
using vector_type =
|
||||
Kokkos::View<Scalar*, Kokkos::LayoutLeft, execution_space>;
|
||||
|
||||
typedef Kokkos::View<Scalar, Kokkos::LayoutLeft, execution_space> value_view;
|
||||
using value_view = Kokkos::View<Scalar, Kokkos::LayoutLeft, execution_space>;
|
||||
|
||||
multivector_type Q;
|
||||
multivector_type R;
|
||||
@ -243,9 +240,9 @@ TEST(default_exec, gramschmidt) {
|
||||
int exp_end = 20;
|
||||
int num_trials = 5;
|
||||
|
||||
if (command_line_num_args() > 1) exp_beg = atoi(command_line_arg(1));
|
||||
if (command_line_num_args() > 2) exp_end = atoi(command_line_arg(2));
|
||||
if (command_line_num_args() > 3) num_trials = atoi(command_line_arg(3));
|
||||
if (command_line_num_args() > 1) exp_beg = std::stoi(command_line_arg(1));
|
||||
if (command_line_num_args() > 2) exp_end = std::stoi(command_line_arg(2));
|
||||
if (command_line_num_args() > 3) num_trials = std::stoi(command_line_arg(3));
|
||||
|
||||
EXPECT_NO_THROW(run_test_gramschmidt<Kokkos::DefaultExecutionSpace>(
|
||||
exp_beg, exp_end, num_trials, Kokkos::DefaultExecutionSpace::name()));
|
||||
|
||||
@ -51,20 +51,20 @@ namespace Test {
|
||||
template <class DeviceType, typename CoordScalarType = double,
|
||||
typename GradScalarType = float>
|
||||
struct HexGrad {
|
||||
typedef DeviceType execution_space;
|
||||
typedef typename execution_space::size_type size_type;
|
||||
using execution_space = DeviceType;
|
||||
using size_type = typename execution_space::size_type;
|
||||
|
||||
typedef HexGrad<DeviceType, CoordScalarType, GradScalarType> self_type;
|
||||
using self_type = HexGrad<DeviceType, CoordScalarType, GradScalarType>;
|
||||
|
||||
// 3D array : ( ParallelWork , Space , Node )
|
||||
|
||||
enum { NSpace = 3, NNode = 8 };
|
||||
|
||||
typedef Kokkos::View<CoordScalarType * [NSpace][NNode], execution_space>
|
||||
elem_coord_type;
|
||||
using elem_coord_type =
|
||||
Kokkos::View<CoordScalarType * [NSpace][NNode], execution_space>;
|
||||
|
||||
typedef Kokkos::View<GradScalarType * [NSpace][NNode], execution_space>
|
||||
elem_grad_type;
|
||||
using elem_grad_type =
|
||||
Kokkos::View<GradScalarType * [NSpace][NNode], execution_space>;
|
||||
|
||||
elem_coord_type coords;
|
||||
elem_grad_type grad_op;
|
||||
@ -179,7 +179,7 @@ struct HexGrad {
|
||||
//--------------------------------------------------------------------------
|
||||
|
||||
struct Init {
|
||||
typedef typename self_type::execution_space execution_space;
|
||||
using execution_space = typename self_type::execution_space;
|
||||
|
||||
elem_coord_type coords;
|
||||
|
||||
@ -289,9 +289,9 @@ TEST(default_exec, hexgrad) {
|
||||
int exp_end = 20;
|
||||
int num_trials = 5;
|
||||
|
||||
if (command_line_num_args() > 1) exp_beg = atoi(command_line_arg(1));
|
||||
if (command_line_num_args() > 2) exp_end = atoi(command_line_arg(2));
|
||||
if (command_line_num_args() > 3) num_trials = atoi(command_line_arg(3));
|
||||
if (command_line_num_args() > 1) exp_beg = std::stoi(command_line_arg(1));
|
||||
if (command_line_num_args() > 2) exp_end = std::stoi(command_line_arg(2));
|
||||
if (command_line_num_args() > 3) num_trials = std::stoi(command_line_arg(3));
|
||||
|
||||
EXPECT_NO_THROW(run_test_hexgrad<Kokkos::DefaultExecutionSpace>(
|
||||
exp_beg, exp_end, num_trials, Kokkos::DefaultExecutionSpace::name()));
|
||||
|
||||
@ -46,13 +46,13 @@ namespace Test {
|
||||
template <class DeviceType, typename ScalarType = double,
|
||||
typename TestLayout = Kokkos::LayoutRight>
|
||||
struct MultiDimRangePerf3D {
|
||||
typedef DeviceType execution_space;
|
||||
typedef typename execution_space::size_type size_type;
|
||||
using execution_space = DeviceType;
|
||||
using size_type = typename execution_space::size_type;
|
||||
|
||||
using iterate_type = Kokkos::Iterate;
|
||||
|
||||
typedef Kokkos::View<ScalarType ***, TestLayout, DeviceType> view_type;
|
||||
typedef typename view_type::HostMirror host_view_type;
|
||||
using view_type = Kokkos::View<ScalarType ***, TestLayout, DeviceType>;
|
||||
using host_view_type = typename view_type::HostMirror;
|
||||
|
||||
view_type A;
|
||||
view_type B;
|
||||
@ -108,8 +108,8 @@ struct MultiDimRangePerf3D {
|
||||
// This test performs multidim range over all dims
|
||||
view_type Atest("Atest", icount, jcount, kcount);
|
||||
view_type Btest("Btest", icount + 2, jcount + 2, kcount + 2);
|
||||
typedef MultiDimRangePerf3D<execution_space, ScalarType, TestLayout>
|
||||
FunctorType;
|
||||
using FunctorType =
|
||||
MultiDimRangePerf3D<execution_space, ScalarType, TestLayout>;
|
||||
|
||||
double dt_min = 0;
|
||||
|
||||
@ -125,10 +125,9 @@ struct MultiDimRangePerf3D {
|
||||
policy_initB({{0, 0, 0}}, {{icount + 2, jcount + 2, kcount + 2}},
|
||||
{{Ti, Tj, Tk}});
|
||||
|
||||
typedef typename Kokkos::MDRangePolicy<
|
||||
using MDRangeType = typename Kokkos::MDRangePolicy<
|
||||
Kokkos::Rank<3, iterate_type::Right, iterate_type::Right>,
|
||||
execution_space>
|
||||
MDRangeType;
|
||||
execution_space>;
|
||||
using tile_type = typename MDRangeType::tile_type;
|
||||
using point_type = typename MDRangeType::point_type;
|
||||
|
||||
@ -216,14 +215,15 @@ struct MultiDimRangePerf3D {
|
||||
policy_initB({{0, 0, 0}}, {{icount + 2, jcount + 2, kcount + 2}},
|
||||
{{Ti, Tj, Tk}});
|
||||
|
||||
// typedef typename Kokkos::MDRangePolicy<Kokkos::Rank<3,
|
||||
// iterate_type::Left, iterate_type::Left>, execution_space > MDRangeType;
|
||||
// using MDRangeType =
|
||||
// typename Kokkos::MDRangePolicy<
|
||||
// Kokkos::Rank<3, iterate_type::Left, iterate_type::Left>,
|
||||
// execution_space >;
|
||||
// using tile_type = typename MDRangeType::tile_type;
|
||||
// using point_type = typename MDRangeType::point_type;
|
||||
// Kokkos::MDRangePolicy<Kokkos::Rank<3, iterate_type::Left,
|
||||
// iterate_type::Left>, execution_space >
|
||||
// policy(point_type{{0,0,0}},point_type{{icount,jcount,kcount}},tile_type{{Ti,Tj,Tk}}
|
||||
// );
|
||||
// MDRangeType policy(point_type{{0,0,0}},
|
||||
// point_type{{icount,jcount,kcount}},
|
||||
// tile_type{{Ti,Tj,Tk}});
|
||||
Kokkos::MDRangePolicy<
|
||||
Kokkos::Rank<3, iterate_type::Left, iterate_type::Left>,
|
||||
execution_space>
|
||||
@ -306,14 +306,14 @@ struct RangePolicyCollapseTwo {
|
||||
// RangePolicy for 3D range, but will collapse only 2 dims => like Rank<2> for
|
||||
// multi-dim; unroll 2 dims in one-dim
|
||||
|
||||
typedef DeviceType execution_space;
|
||||
typedef typename execution_space::size_type size_type;
|
||||
typedef TestLayout layout;
|
||||
using execution_space = DeviceType;
|
||||
using size_type = typename execution_space::size_type;
|
||||
using layout = TestLayout;
|
||||
|
||||
using iterate_type = Kokkos::Iterate;
|
||||
|
||||
typedef Kokkos::View<ScalarType ***, TestLayout, DeviceType> view_type;
|
||||
typedef typename view_type::HostMirror host_view_type;
|
||||
using view_type = Kokkos::View<ScalarType ***, TestLayout, DeviceType>;
|
||||
using host_view_type = typename view_type::HostMirror;
|
||||
|
||||
view_type A;
|
||||
view_type B;
|
||||
@ -388,8 +388,8 @@ struct RangePolicyCollapseTwo {
|
||||
// This test refers to collapsing two dims while using the RangePolicy
|
||||
view_type Atest("Atest", icount, jcount, kcount);
|
||||
view_type Btest("Btest", icount + 2, jcount + 2, kcount + 2);
|
||||
typedef RangePolicyCollapseTwo<execution_space, ScalarType, TestLayout>
|
||||
FunctorType;
|
||||
using FunctorType =
|
||||
RangePolicyCollapseTwo<execution_space, ScalarType, TestLayout>;
|
||||
|
||||
long collapse_index_rangeA = 0;
|
||||
long collapse_index_rangeB = 0;
|
||||
@ -480,12 +480,12 @@ template <class DeviceType, typename ScalarType = double,
|
||||
struct RangePolicyCollapseAll {
|
||||
// RangePolicy for 3D range, but will collapse all dims
|
||||
|
||||
typedef DeviceType execution_space;
|
||||
typedef typename execution_space::size_type size_type;
|
||||
typedef TestLayout layout;
|
||||
using execution_space = DeviceType;
|
||||
using size_type = typename execution_space::size_type;
|
||||
using layout = TestLayout;
|
||||
|
||||
typedef Kokkos::View<ScalarType ***, TestLayout, DeviceType> view_type;
|
||||
typedef typename view_type::HostMirror host_view_type;
|
||||
using view_type = Kokkos::View<ScalarType ***, TestLayout, DeviceType>;
|
||||
using host_view_type = typename view_type::HostMirror;
|
||||
|
||||
view_type A;
|
||||
view_type B;
|
||||
@ -552,8 +552,8 @@ struct RangePolicyCollapseAll {
|
||||
// This test refers to collapsing all dims using the RangePolicy
|
||||
view_type Atest("Atest", icount, jcount, kcount);
|
||||
view_type Btest("Btest", icount + 2, jcount + 2, kcount + 2);
|
||||
typedef RangePolicyCollapseAll<execution_space, ScalarType, TestLayout>
|
||||
FunctorType;
|
||||
using FunctorType =
|
||||
RangePolicyCollapseAll<execution_space, ScalarType, TestLayout>;
|
||||
|
||||
const long flat_index_range = icount * jcount * kcount;
|
||||
Kokkos::RangePolicy<execution_space> policy(0, flat_index_range);
|
||||
|
||||
@ -129,9 +129,9 @@ TEST(default_exec, custom_reduction) {
|
||||
int R = 1000;
|
||||
int num_trials = 1;
|
||||
|
||||
if (command_line_num_args() > 1) N = atoi(command_line_arg(1));
|
||||
if (command_line_num_args() > 2) R = atoi(command_line_arg(2));
|
||||
if (command_line_num_args() > 3) num_trials = atoi(command_line_arg(3));
|
||||
if (command_line_num_args() > 1) N = std::stoi(command_line_arg(1));
|
||||
if (command_line_num_args() > 2) R = std::stoi(command_line_arg(2));
|
||||
if (command_line_num_args() > 3) num_trials = std::stoi(command_line_arg(3));
|
||||
custom_reduction_test<double>(N, R, num_trials);
|
||||
}
|
||||
} // namespace Test
|
||||
|
||||
@ -29,7 +29,7 @@ struct SpaceInstance<Kokkos::Cuda> {
|
||||
bool value = true;
|
||||
auto local_rank_str = std::getenv("CUDA_LAUNCH_BLOCKING");
|
||||
if (local_rank_str) {
|
||||
value = (std::atoi(local_rank_str) == 0);
|
||||
value = (std::stoi(local_rank_str) == 0);
|
||||
}
|
||||
return value;
|
||||
}
|
||||
|
||||
@ -49,7 +49,7 @@
|
||||
#include <Kokkos_Core.hpp>
|
||||
#include <impl/Kokkos_Timer.hpp>
|
||||
|
||||
typedef Kokkos::DefaultExecutionSpace exec_space;
|
||||
using exec_space = Kokkos::DefaultExecutionSpace;
|
||||
|
||||
#define RESET 0
|
||||
#define BRIGHT 1
|
||||
@ -80,9 +80,9 @@ void textcolor_standard() { textcolor(RESET, BLACK, WHITE); }
|
||||
|
||||
template <class T, class DEVICE_TYPE>
|
||||
struct ZeroFunctor {
|
||||
typedef DEVICE_TYPE execution_space;
|
||||
typedef typename Kokkos::View<T, execution_space> type;
|
||||
typedef typename Kokkos::View<T, execution_space>::HostMirror h_type;
|
||||
using execution_space = DEVICE_TYPE;
|
||||
using type = typename Kokkos::View<T, execution_space>;
|
||||
using h_type = typename Kokkos::View<T, execution_space>::HostMirror;
|
||||
type data;
|
||||
KOKKOS_INLINE_FUNCTION
|
||||
void operator()(int) const { data() = 0; }
|
||||
@ -94,8 +94,8 @@ struct ZeroFunctor {
|
||||
|
||||
template <class T, class DEVICE_TYPE>
|
||||
struct AddFunctor {
|
||||
typedef DEVICE_TYPE execution_space;
|
||||
typedef Kokkos::View<T, execution_space> type;
|
||||
using execution_space = DEVICE_TYPE;
|
||||
using type = Kokkos::View<T, execution_space>;
|
||||
type data;
|
||||
|
||||
KOKKOS_INLINE_FUNCTION
|
||||
@ -123,8 +123,8 @@ T AddLoop(int loop) {
|
||||
|
||||
template <class T, class DEVICE_TYPE>
|
||||
struct AddNonAtomicFunctor {
|
||||
typedef DEVICE_TYPE execution_space;
|
||||
typedef Kokkos::View<T, execution_space> type;
|
||||
using execution_space = DEVICE_TYPE;
|
||||
using type = Kokkos::View<T, execution_space>;
|
||||
type data;
|
||||
|
||||
KOKKOS_INLINE_FUNCTION
|
||||
@ -166,8 +166,8 @@ T AddLoopSerial(int loop) {
|
||||
|
||||
template <class T, class DEVICE_TYPE>
|
||||
struct CASFunctor {
|
||||
typedef DEVICE_TYPE execution_space;
|
||||
typedef Kokkos::View<T, execution_space> type;
|
||||
using execution_space = DEVICE_TYPE;
|
||||
using type = Kokkos::View<T, execution_space>;
|
||||
type data;
|
||||
|
||||
KOKKOS_INLINE_FUNCTION
|
||||
@ -204,8 +204,8 @@ T CASLoop(int loop) {
|
||||
|
||||
template <class T, class DEVICE_TYPE>
|
||||
struct CASNonAtomicFunctor {
|
||||
typedef DEVICE_TYPE execution_space;
|
||||
typedef Kokkos::View<T, execution_space> type;
|
||||
using execution_space = DEVICE_TYPE;
|
||||
using type = Kokkos::View<T, execution_space>;
|
||||
type data;
|
||||
|
||||
KOKKOS_INLINE_FUNCTION
|
||||
@ -268,8 +268,8 @@ T CASLoopSerial(int loop) {
|
||||
|
||||
template <class T, class DEVICE_TYPE>
|
||||
struct ExchFunctor {
|
||||
typedef DEVICE_TYPE execution_space;
|
||||
typedef Kokkos::View<T, execution_space> type;
|
||||
using execution_space = DEVICE_TYPE;
|
||||
using type = Kokkos::View<T, execution_space>;
|
||||
type data, data2;
|
||||
|
||||
KOKKOS_INLINE_FUNCTION
|
||||
@ -309,8 +309,8 @@ T ExchLoop(int loop) {
|
||||
|
||||
template <class T, class DEVICE_TYPE>
|
||||
struct ExchNonAtomicFunctor {
|
||||
typedef DEVICE_TYPE execution_space;
|
||||
typedef Kokkos::View<T, execution_space> type;
|
||||
using execution_space = DEVICE_TYPE;
|
||||
using type = Kokkos::View<T, execution_space>;
|
||||
type data, data2;
|
||||
|
||||
KOKKOS_INLINE_FUNCTION
|
||||
@ -448,15 +448,15 @@ int main(int argc, char* argv[]) {
|
||||
|
||||
for (int i = 0; i < argc; i++) {
|
||||
if ((strcmp(argv[i], "--test") == 0)) {
|
||||
test = atoi(argv[++i]);
|
||||
test = std::stoi(argv[++i]);
|
||||
continue;
|
||||
}
|
||||
if ((strcmp(argv[i], "--type") == 0)) {
|
||||
type = atoi(argv[++i]);
|
||||
type = std::stoi(argv[++i]);
|
||||
continue;
|
||||
}
|
||||
if ((strcmp(argv[i], "-l") == 0) || (strcmp(argv[i], "--loop") == 0)) {
|
||||
loop = atoi(argv[++i]);
|
||||
loop = std::stoi(argv[++i]);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
@ -56,7 +56,7 @@ using MemorySpace = Kokkos::DefaultExecutionSpace::memory_space;
|
||||
using MemoryPool = Kokkos::MemoryPool<ExecSpace>;
|
||||
|
||||
struct TestFunctor {
|
||||
typedef Kokkos::View<uintptr_t*, ExecSpace> ptrs_type;
|
||||
using ptrs_type = Kokkos::View<uintptr_t*, ExecSpace>;
|
||||
|
||||
enum : unsigned { chunk = 32 };
|
||||
|
||||
@ -87,7 +87,7 @@ struct TestFunctor {
|
||||
|
||||
//----------------------------------------
|
||||
|
||||
typedef long value_type;
|
||||
using value_type = long;
|
||||
|
||||
//----------------------------------------
|
||||
|
||||
@ -107,7 +107,7 @@ struct TestFunctor {
|
||||
}
|
||||
|
||||
bool test_fill() {
|
||||
typedef Kokkos::RangePolicy<ExecSpace, TagFill> policy;
|
||||
using policy = Kokkos::RangePolicy<ExecSpace, TagFill>;
|
||||
|
||||
long result = 0;
|
||||
|
||||
@ -134,7 +134,7 @@ struct TestFunctor {
|
||||
}
|
||||
|
||||
void test_del() {
|
||||
typedef Kokkos::RangePolicy<ExecSpace, TagDel> policy;
|
||||
using policy = Kokkos::RangePolicy<ExecSpace, TagDel>;
|
||||
|
||||
Kokkos::parallel_for(policy(0, range_iter), *this);
|
||||
Kokkos::fence();
|
||||
@ -164,7 +164,7 @@ struct TestFunctor {
|
||||
}
|
||||
|
||||
bool test_alloc_dealloc() {
|
||||
typedef Kokkos::RangePolicy<ExecSpace, TagAllocDealloc> policy;
|
||||
using policy = Kokkos::RangePolicy<ExecSpace, TagAllocDealloc>;
|
||||
|
||||
long error_count = 0;
|
||||
|
||||
@ -203,22 +203,22 @@ int main(int argc, char* argv[]) {
|
||||
total_alloc_size = atol(a + strlen(alloc_size_flag));
|
||||
|
||||
if (!strncmp(a, super_size_flag, strlen(super_size_flag)))
|
||||
min_superblock_size = atoi(a + strlen(super_size_flag));
|
||||
min_superblock_size = std::stoi(a + strlen(super_size_flag));
|
||||
|
||||
if (!strncmp(a, fill_stride_flag, strlen(fill_stride_flag)))
|
||||
fill_stride = atoi(a + strlen(fill_stride_flag));
|
||||
fill_stride = std::stoi(a + strlen(fill_stride_flag));
|
||||
|
||||
if (!strncmp(a, fill_level_flag, strlen(fill_level_flag)))
|
||||
fill_level = atoi(a + strlen(fill_level_flag));
|
||||
fill_level = std::stoi(a + strlen(fill_level_flag));
|
||||
|
||||
if (!strncmp(a, chunk_span_flag, strlen(chunk_span_flag)))
|
||||
chunk_span = atoi(a + strlen(chunk_span_flag));
|
||||
chunk_span = std::stoi(a + strlen(chunk_span_flag));
|
||||
|
||||
if (!strncmp(a, repeat_outer_flag, strlen(repeat_outer_flag)))
|
||||
repeat_outer = atoi(a + strlen(repeat_outer_flag));
|
||||
repeat_outer = std::stoi(a + strlen(repeat_outer_flag));
|
||||
|
||||
if (!strncmp(a, repeat_inner_flag, strlen(repeat_inner_flag)))
|
||||
repeat_inner = atoi(a + strlen(repeat_inner_flag));
|
||||
repeat_inner = std::stoi(a + strlen(repeat_inner_flag));
|
||||
}
|
||||
|
||||
int chunk_span_bytes = 0;
|
||||
|
||||
@ -91,7 +91,7 @@ struct TestFib {
|
||||
using MemberType = typename Scheduler::member_type;
|
||||
using FutureType = Kokkos::BasicFuture<long, Scheduler>;
|
||||
|
||||
typedef long value_type;
|
||||
using value_type = long;
|
||||
|
||||
FutureType dep[2];
|
||||
const value_type n;
|
||||
@ -152,13 +152,13 @@ int main(int argc, char* argv[]) {
|
||||
total_alloc_size = atol(a + strlen(alloc_size));
|
||||
|
||||
if (!strncmp(a, super_size, strlen(super_size)))
|
||||
min_superblock_size = atoi(a + strlen(super_size));
|
||||
min_superblock_size = std::stoi(a + strlen(super_size));
|
||||
|
||||
if (!strncmp(a, repeat_outer, strlen(repeat_outer)))
|
||||
test_repeat_outer = atoi(a + strlen(repeat_outer));
|
||||
test_repeat_outer = std::stoi(a + strlen(repeat_outer));
|
||||
|
||||
if (!strncmp(a, input_value, strlen(input_value)))
|
||||
fib_input = atoi(a + strlen(input_value));
|
||||
fib_input = std::stoi(a + strlen(input_value));
|
||||
}
|
||||
|
||||
const long fib_output = eval_fib(fib_input);
|
||||
@ -182,7 +182,7 @@ int main(int argc, char* argv[]) {
|
||||
|
||||
using Scheduler = Kokkos::TaskSchedulerMultiple<ExecSpace>;
|
||||
|
||||
typedef TestFib<Scheduler> Functor;
|
||||
using Functor = TestFib<Scheduler>;
|
||||
|
||||
Kokkos::initialize(argc, argv);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user