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

Fix build and add CI coverage for LayoutLeft=OFF #965

Merged
merged 35 commits into from
May 14, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
7a87528
src/blas/impl: Fix LayoutRight link errors
e10harvey May 6, 2021
edd7547
src/blas: Fix LayoutRight link errors
e10harvey May 6, 2021
0b7f10b
src/blas: Fix LayoutRight link errors
e10harvey May 6, 2021
9e62a84
src/blas: Fix LayoutRight link errors
e10harvey May 6, 2021
f834b9f
src/blas: Fix LayoutRight link errors
e10harvey May 6, 2021
7ccea8d
src/blas: Fix LayoutRight link errors
e10harvey May 6, 2021
bf7a418
src/blas: Fix LayoutRight link errors
e10harvey May 6, 2021
521ec58
src/blas: Fix LayoutRight link errors
e10harvey May 6, 2021
06dfed3
src/blas: Fix LayoutRight link errors
e10harvey May 6, 2021
722271c
src/blas: Fix LayoutRight link errors
e10harvey May 6, 2021
77e9657
src/sparse: Fix LayoutRight link errors
e10harvey May 6, 2021
f98f7c2
src/sparse: Fix LayoutRight link errors
e10harvey May 6, 2021
a3a89cb
src/sparse: Fix LayoutRight link errors
e10harvey May 7, 2021
b4219fb
scripts: Update cm_test_all_sandia for LayoutRight testing
e10harvey May 7, 2021
c806fb3
src/common: Add default_types include
e10harvey May 7, 2021
24714bd
scripts: Add --with-spaces to cm_test_all
e10harvey May 7, 2021
366ee34
Update scripts/cm_test_all_sandia
e10harvey May 10, 2021
a80001b
unit_test/blas: Fix dot test when LayoutLeft=OFF.
e10harvey May 10, 2021
65fa4fe
unit_test/blas: Fix iamax test when LayoutLeft=OFF.
e10harvey May 10, 2021
9b3f566
unit_test/blas: Fix mult test when LayoutLeft=OFF.
e10harvey May 10, 2021
93b7eaa
unit_test/blas: Fix mult_mv test when LayoutLeft=OFF.
e10harvey May 10, 2021
8cea4ef
unit_test/blas: Fix nrm1 test when LayoutLeft=OFF.
e10harvey May 10, 2021
05a9bd1
unit_test/blas: Fix nrm2 test when LayoutLeft=OFF.
e10harvey May 10, 2021
f4491ac
unit_test/blas: Fix nrminf test when LayoutLeft=OFF.
e10harvey May 10, 2021
6c2a36b
unit_test/blas: Fix scal test when LayoutLeft=OFF.
e10harvey May 10, 2021
5814600
unit_test/blas: Fix sum test when LayoutLeft=OFF.
e10harvey May 10, 2021
b6dd181
Fix unified layouts with left and right enabled
brian-kelley May 10, 2021
b771c51
unit_test/blas: Fix gemv test.
e10harvey May 11, 2021
a2ca373
src/sparse: Fix unused ref warning on intel-18
e10harvey May 11, 2021
30e772e
unit_test/blas: Fix unused ref warnings on cuda10
e10harvey May 11, 2021
cffc476
src/sparse: Fix unused ref warning on intel-18
e10harvey May 12, 2021
15018cb
src/impl/tpls: Fix cublas gemv spec for LayoutRight
e10harvey May 13, 2021
d419296
unit_test/blas: Check cublas gemv for unsupported transpose op
e10harvey May 13, 2021
89484e5
src/sparse/impl: Fix merge conflict
e10harvey May 13, 2021
35b0f1f
src/impl/tpls: Fix hostblas gemv spec for LayoutRight
e10harvey May 13, 2021
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
26 changes: 23 additions & 3 deletions scripts/cm_test_all_sandia
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,11 @@ print_help() {
echo " Valid items:"
echo " LayoutLeft,LayoutRight"
echo ""
echo "--no-default-eti: Do not include default ETI types for Kokkos Kernels"
echo ""
echo "--with-spaces=SPACES: Set spaces to be instantiated."
echo " Options: hostspace, cudaspace, cudauvmspace"
echo ""

echo "ARGS: list of expressions matching compilers to test"
echo " supported compilers sems"
Expand Down Expand Up @@ -202,6 +207,7 @@ TEST_SCRIPT=False
TEST_SPACK=False
SKIP_HWLOC=False
SPOT_CHECK=False
NO_DEFAULT_ETI=False

PRINT_HELP=False
OPT_FLAG=""
Expand Down Expand Up @@ -352,6 +358,12 @@ do
--with-layouts*)
KOKKOSKERNELS_LAYOUTS="${key#*=}"
;;
--no-default-eti*)
NO_DEFAULT_ETI=True
;;
--with-spaces*)
KOKKOSKERNELS_SPACES="${key#*=}"
;;
--with-tpls*)
KOKKOSKERNELS_ENABLE_TPLS="${key#*=}"
;;
Expand Down Expand Up @@ -1152,6 +1164,10 @@ single_build_and_test() {
if [ ! -z "$KOKKOSKERNELS_ORDINALS" ]; then
kernels_variants="$kernels_variants ordinals=$KOKKOSKERNELS_ORDINALS"
fi
if [ ! -z "$KOKKOSKERNELS_SPACES" ]; then
kernels_variants="$kernels_variants spaces=$KOKKOSKERNELS_SPACES"
KOKKOSKERNELS_SPACES="--with-spaces=$KOKKOSKERNELS_SPACES"
fi


echo " # Load modules:" &> reload_modules.sh
Expand Down Expand Up @@ -1191,6 +1207,10 @@ single_build_and_test() {

local cxx_standard="${CXX_STANDARD}"

if [ "${NO_DEFAULT_ETI}" = "True" ]; then
local extra_args="$extra_args --no-default-eti"
fi


echo " Starting job $desc"

Expand Down Expand Up @@ -1241,13 +1261,13 @@ single_build_and_test() {

# KOKKOS_OPTIONS and KOKKOS_CUDA_OPTIONS are exported and detected by kokkos' generate_makefile.sh during install of kokkos; we pass them to the reproducer script instructions
echo " # Use generate_makefile line below to call cmake which generates makefile for this build:" &> call_generate_makefile.sh
echo " ${KOKKOSKERNELS_PATH}/cm_generate_makefile.bash --with-devices=$LOCAL_KOKKOS_DEVICES $ARCH_FLAG --compiler=$(which $compiler_exe) --cxxflags=\"$cxxflags\" --cxxstandard=\"$cxx_standard\" --ldflags=\"$ldflags\" $CUDA_ENABLE_CMD $HIP_ENABLE_CMD --kokkos-path=${KOKKOS_PATH} --kokkoskernels-path=${KOKKOSKERNELS_PATH} --with-scalars=$kk_scalars --with-ordinals=${KOKKOSKERNELS_ORDINALS} --with-offsets=${KOKKOSKERNELS_OFFSETS} --with-layouts=${KOKKOSKERNELS_LAYOUTS} ${KOKKOSKERNELS_ENABLE_TPL_CMD} ${KOKKOSKERNELS_TPL_PATH_CMD} ${KOKKOSKERNELS_TPL_LIBS_CMD} ${KOKKOSKERNELS_EXTRA_LINKER_FLAGS_CMD} --with-options=${KOKKOS_OPTIONS} --with-cuda-options=${KOKKOS_CUDA_OPTIONS} ${KOKKOS_BOUNDS_CHECK} --no-examples $extra_args" &>> call_generate_makefile.sh
echo " ${KOKKOSKERNELS_PATH}/cm_generate_makefile.bash --with-devices=$LOCAL_KOKKOS_DEVICES $ARCH_FLAG --compiler=$(which $compiler_exe) --cxxflags=\"$cxxflags\" --cxxstandard=\"$cxx_standard\" --ldflags=\"$ldflags\" $CUDA_ENABLE_CMD $HIP_ENABLE_CMD --kokkos-path=${KOKKOS_PATH} --kokkoskernels-path=${KOKKOSKERNELS_PATH} --with-scalars=$kk_scalars --with-ordinals=${KOKKOSKERNELS_ORDINALS} --with-offsets=${KOKKOSKERNELS_OFFSETS} --with-layouts=${KOKKOSKERNELS_LAYOUTS} ${KOKKOSKERNELS_ENABLE_TPL_CMD} ${KOKKOSKERNELS_TPL_PATH_CMD} ${KOKKOSKERNELS_TPL_LIBS_CMD} ${KOKKOSKERNELS_EXTRA_LINKER_FLAGS_CMD} --with-options=${KOKKOS_OPTIONS} --with-cuda-options=${KOKKOS_CUDA_OPTIONS} ${KOKKOS_BOUNDS_CHECK} ${KOKKOSKERNELS_SPACES} --no-examples $extra_args" &>> call_generate_makefile.sh
chmod +x call_generate_makefile.sh

# script command with generic path for faster copy/paste of reproducer into issues
echo " # \$KOKKOSKERNELS_PATH/cm_generate_makefile.bash --with-devices=$LOCAL_KOKKOS_DEVICES $ARCH_FLAG --compiler=$(which $compiler_exe) --cxxflags=\"$cxxflags\" --cxxstandard=\"$cxx_standard\" --ldflags=\"$ldflags\" $CUDA_ENABLE_CMD $HIP_ENABLE_CMD --kokkos-path=\$KOKKOS_PATH --kokkoskernels-path=\$KOKKOSKERNELS_PATH --with-scalars=$kk_scalars --with-ordinals=${KOKKOSKERNELS_ORDINALS} --with-offsets=${KOKKOSKERNELS_OFFSETS} --with-layouts=${KOKKOSKERNELS_LAYOUTS} ${KOKKOSKERNELS_ENABLE_TPL_CMD} ${KOKKOSKERNELS_TPL_PATH_CMD} ${KOKKOSKERNELS_TPL_LIBS_CMD} ${KOKKOSKERNELS_EXTRA_LINKER_FLAGS_CMD} --with-options=${KOKKOS_OPTIONS} --with-cuda-options=${KOKKOS_CUDA_OPTIONS} ${KOKKOS_BOUNDS_CHECK} --no-examples $extra_args" &> call_generate_makefile_genericpath.sh
echo " # \$KOKKOSKERNELS_PATH/cm_generate_makefile.bash --with-devices=$LOCAL_KOKKOS_DEVICES $ARCH_FLAG --compiler=$(which $compiler_exe) --cxxflags=\"$cxxflags\" --cxxstandard=\"$cxx_standard\" --ldflags=\"$ldflags\" $CUDA_ENABLE_CMD $HIP_ENABLE_CMD --kokkos-path=\$KOKKOS_PATH --kokkoskernels-path=\$KOKKOSKERNELS_PATH --with-scalars=$kk_scalars --with-ordinals=${KOKKOSKERNELS_ORDINALS} --with-offsets=${KOKKOSKERNELS_OFFSETS} --with-layouts=${KOKKOSKERNELS_LAYOUTS} ${KOKKOSKERNELS_ENABLE_TPL_CMD} ${KOKKOSKERNELS_TPL_PATH_CMD} ${KOKKOSKERNELS_TPL_LIBS_CMD} ${KOKKOSKERNELS_EXTRA_LINKER_FLAGS_CMD} --with-options=${KOKKOS_OPTIONS} --with-cuda-options=${KOKKOS_CUDA_OPTIONS} ${KOKKOS_BOUNDS_CHECK} ${KOKKOSKERNELS_SPACES} --no-examples $extra_args" &> call_generate_makefile_genericpath.sh

run_cmd ${KOKKOSKERNELS_PATH}/cm_generate_makefile.bash --with-devices=$LOCAL_KOKKOS_DEVICES $ARCH_FLAG --compiler=$(which $compiler_exe) --cxxflags=\"$cxxflags\" --cxxstandard=\"$cxx_standard\" --ldflags=\"$ldflags\" $CUDA_ENABLE_CMD $HIP_ENABLE_CMD --kokkos-path=${KOKKOS_PATH} --kokkoskernels-path=${KOKKOSKERNELS_PATH} --with-scalars=$kk_scalars --with-ordinals=${KOKKOSKERNELS_ORDINALS} --with-offsets=${KOKKOSKERNELS_OFFSETS} --with-layouts=${KOKKOSKERNELS_LAYOUTS} ${KOKKOSKERNELS_ENABLE_TPL_CMD} ${KOKKOSKERNELS_TPL_PATH_CMD} ${KOKKOSKERNELS_TPL_LIBS_CMD} ${KOKKOSKERNELS_EXTRA_LINKER_FLAGS_CMD} ${KOKKOS_BOUNDS_CHECK} --no-examples $extra_args &>> ${desc}.configure.log || { report_and_log_test_result 1 ${desc} configure && return 0; }
run_cmd ${KOKKOSKERNELS_PATH}/cm_generate_makefile.bash --with-devices=$LOCAL_KOKKOS_DEVICES $ARCH_FLAG --compiler=$(which $compiler_exe) --cxxflags=\"$cxxflags\" --cxxstandard=\"$cxx_standard\" --ldflags=\"$ldflags\" $CUDA_ENABLE_CMD $HIP_ENABLE_CMD --kokkos-path=${KOKKOS_PATH} --kokkoskernels-path=${KOKKOSKERNELS_PATH} --with-scalars=$kk_scalars --with-ordinals=${KOKKOSKERNELS_ORDINALS} --with-offsets=${KOKKOSKERNELS_OFFSETS} --with-layouts=${KOKKOSKERNELS_LAYOUTS} ${KOKKOSKERNELS_ENABLE_TPL_CMD} ${KOKKOSKERNELS_TPL_PATH_CMD} ${KOKKOSKERNELS_TPL_LIBS_CMD} ${KOKKOSKERNELS_EXTRA_LINKER_FLAGS_CMD} ${KOKKOS_BOUNDS_CHECK} ${KOKKOSKERNELS_SPACES} --no-examples $extra_args &>> ${desc}.configure.log || { report_and_log_test_result 1 ${desc} configure && return 0; }

local make_par_lvl=12
if [[ "$MACHINE" = white* ]]; then
Expand Down
27 changes: 13 additions & 14 deletions src/blas/KokkosBlas1_axpby.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -85,29 +85,28 @@ axpby (const AV& a, const XMV& X, const BV& b, const YMV& Y)
Kokkos::Impl::throw_runtime_exception (os.str ());
}

using UnifiedXLayout = typename
KokkosKernels::Impl::GetUnifiedLayout<XMV>::array_layout;
using UnifiedYLayout = typename
KokkosKernels::Impl::GetUnifiedLayoutPreferring<YMV, UnifiedXLayout>::array_layout;

// Create unmanaged versions of the input Views. XMV and YMV may be
// rank 1 or rank 2. AV and BV may be either rank-1 Views, or
// scalar values.
typedef typename KokkosKernels::Impl::GetUnifiedScalarViewType<
AV, XMV, true>::type AV_Internal;
typedef Kokkos::View<
typename Kokkos::Impl::if_c<
XMV::Rank == 1,
typename XMV::const_value_type*,
typename XMV::const_value_type** >::type,
typename KokkosKernels::Impl::GetUnifiedLayout<XMV>::array_layout,
typename XMV::const_data_type,
UnifiedXLayout,
typename XMV::device_type,
Kokkos::MemoryTraits<Kokkos::Unmanaged> > XMV_Internal;
typedef typename KokkosKernels::Impl::GetUnifiedScalarViewType<
BV, YMV, true>::type BV_Internal;
typedef Kokkos::View<
typename Kokkos::Impl::if_c<
YMV::Rank == 1,
typename YMV::non_const_value_type*,
typename YMV::non_const_value_type** >::type,
typename KokkosKernels::Impl::GetUnifiedLayout<YMV>::array_layout,
typename YMV::non_const_data_type,
UnifiedYLayout,
typename YMV::device_type,
Kokkos::MemoryTraits<Kokkos::Unmanaged> > YMV_Internal;
typedef typename KokkosKernels::Impl::GetUnifiedScalarViewType<
AV, XMV_Internal, true>::type AV_Internal;
typedef typename KokkosKernels::Impl::GetUnifiedScalarViewType<
BV, YMV_Internal, true>::type BV_Internal;

AV_Internal a_internal = a;
XMV_Internal X_internal = X;
Expand Down
12 changes: 8 additions & 4 deletions src/blas/KokkosBlas1_dot.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -101,11 +101,11 @@ dot (const XVector& x, const YVector& y)
using result_type =
typename KokkosBlas::Impl::DotAccumulatingScalar<dot_type>::type;
using RVector_Internal = Kokkos::View<dot_type,
Kokkos::LayoutLeft,
typename XVector_Internal::array_layout,
Kokkos::HostSpace,
Kokkos::MemoryTraits<Kokkos::Unmanaged>>;
using RVector_Result = Kokkos::View<result_type,
Kokkos::LayoutLeft,
typename XVector_Internal::array_layout,
Kokkos::HostSpace,
Kokkos::MemoryTraits<Kokkos::Unmanaged>>;

Expand Down Expand Up @@ -213,21 +213,25 @@ dot (const RV& R, const XMV& X, const YMV& Y,
}

// Create unmanaged versions of the input Views.
using UnifiedXLayout = typename
KokkosKernels::Impl::GetUnifiedLayout<XMV>::array_layout;
using UnifiedRVLayout = typename
KokkosKernels::Impl::GetUnifiedLayoutPreferring<RV, UnifiedXLayout>::array_layout;

typedef Kokkos::View<
typename Kokkos::Impl::if_c<
RV::rank == 0,
typename RV::non_const_value_type,
typename RV::non_const_value_type* >::type,
typename KokkosKernels::Impl::GetUnifiedLayout<RV>::array_layout,
UnifiedRVLayout,
typename RV::device_type,
Kokkos::MemoryTraits<Kokkos::Unmanaged> > RV_Internal;
typedef Kokkos::View<
typename Kokkos::Impl::if_c<
XMV::rank == 1,
typename XMV::const_value_type*,
typename XMV::const_value_type** >::type,
typename KokkosKernels::Impl::GetUnifiedLayout<XMV>::array_layout,
UnifiedXLayout,
typename XMV::device_type,
Kokkos::MemoryTraits<Kokkos::Unmanaged> > XMV_Internal;
typedef Kokkos::View<
Expand Down
21 changes: 13 additions & 8 deletions src/blas/KokkosBlas1_iamax.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,14 +50,14 @@

namespace KokkosBlas {

/// \brief Return the (smallest) index of the element of the maximum magnitude of the vector x.
/// \brief Return the (smallest) index of the element of the maximum magnitude of the vector x.
///
/// \tparam XVector Type of the first vector x; a 1-D Kokkos::View.
///
/// \param x [in] Input 1-D View.
///
/// \return The (smallest) index of the element of the maximum magnitude; a single value.
/// Note: Returned index is 1-based for compatibility with Fortran.
/// Note: Returned index is 1-based for compatibility with Fortran.
template<class XVector>
typename XVector::size_type iamax (const XVector& x)
{
Expand All @@ -74,7 +74,7 @@ typename XVector::size_type iamax (const XVector& x)
Kokkos::MemoryTraits<Kokkos::Unmanaged> > XVector_Internal;

typedef Kokkos::View<index_type,
Kokkos::LayoutLeft,
typename XVector_Internal::array_layout,
Kokkos::HostSpace,
Kokkos::MemoryTraits<Kokkos::Unmanaged> > RVector_Internal;

Expand Down Expand Up @@ -130,14 +130,19 @@ iamax (const RV& R, const XMV& X,
Kokkos::Impl::throw_runtime_exception (os.str ());
}

// Create unmanaged versions of the input Views. RV may be rank 0 or rank 2.
using UnifiedXLayout = typename
KokkosKernels::Impl::GetUnifiedLayout<XMV>::array_layout;
using UnifiedRVLayout = typename
KokkosKernels::Impl::GetUnifiedLayoutPreferring<RV, UnifiedXLayout>::array_layout;

// Create unmanaged versions of the input Views. RV may be rank 0 or rank 1.
// XMV may be rank 1 or rank 2.
typedef Kokkos::View<
typename std::conditional<
RV::rank == 0,
typename RV::non_const_value_type,
RV::rank == 0,
typename RV::non_const_value_type,
typename RV::non_const_value_type* >::type,
typename KokkosKernels::Impl::GetUnifiedLayout<RV>::array_layout,
UnifiedRVLayout,
typename std::conditional<
std::is_same<typename RV::device_type::memory_space, Kokkos::HostSpace>::value,
Kokkos::HostSpace,
Expand All @@ -148,7 +153,7 @@ iamax (const RV& R, const XMV& X,
XMV::rank == 1,
typename XMV::const_value_type*,
typename XMV::const_value_type** >::type,
typename KokkosKernels::Impl::GetUnifiedLayout<XMV>::array_layout,
UnifiedXLayout,
typename XMV::device_type,
Kokkos::MemoryTraits<Kokkos::Unmanaged> > XMV_Internal;

Expand Down
20 changes: 9 additions & 11 deletions src/blas/KokkosBlas1_mult.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -85,26 +85,24 @@ mult (typename YMV::const_value_type& gamma,
Kokkos::Impl::throw_runtime_exception (os.str ());
}

using YUnifiedLayout = typename KokkosKernels::Impl::GetUnifiedLayout<YMV>::array_layout;
using AUnifiedLayout = typename KokkosKernels::Impl::GetUnifiedLayoutPreferring<AV, YUnifiedLayout>::array_layout;
using XUnifiedLayout = typename KokkosKernels::Impl::GetUnifiedLayoutPreferring<XMV, YUnifiedLayout>::array_layout;

// Create unmanaged versions of the input Views.
typedef Kokkos::View<
typename Kokkos::Impl::if_c<
YMV::rank == 1,
typename YMV::non_const_value_type*,
typename YMV::non_const_value_type** >::type,
typename KokkosKernels::Impl::GetUnifiedLayout<YMV>::array_layout,
typename YMV::non_const_data_type,
YUnifiedLayout,
typename YMV::device_type,
Kokkos::MemoryTraits<Kokkos::Unmanaged> > YMV_Internal;
typedef Kokkos::View<
typename AV::const_value_type*,
typename KokkosKernels::Impl::GetUnifiedLayout<AV>::array_layout,
AUnifiedLayout,
typename AV::device_type,
Kokkos::MemoryTraits<Kokkos::Unmanaged> > AV_Internal;
typedef Kokkos::View<
typename Kokkos::Impl::if_c<
XMV::rank == 1,
typename XMV::const_value_type*,
typename XMV::const_value_type** >::type,
typename KokkosKernels::Impl::GetUnifiedLayout<XMV>::array_layout,
typename XMV::const_data_type,
XUnifiedLayout,
typename XMV::device_type,
Kokkos::MemoryTraits<Kokkos::Unmanaged> > XMV_Internal;

Expand Down
11 changes: 8 additions & 3 deletions src/blas/KokkosBlas1_nrm1.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ nrm1 (const XVector& x)
Kokkos::MemoryTraits<Kokkos::Unmanaged> > XVector_Internal;

typedef Kokkos::View<mag_type,
Kokkos::LayoutLeft,
typename XVector_Internal::array_layout,
Kokkos::HostSpace,
Kokkos::MemoryTraits<Kokkos::Unmanaged> > RVector_Internal;

Expand Down Expand Up @@ -129,22 +129,27 @@ nrm1 (const RV& R, const XMV& X,
Kokkos::Impl::throw_runtime_exception (os.str ());
}

using UnifiedXLayout = typename
KokkosKernels::Impl::GetUnifiedLayout<XMV>::array_layout;
using UnifiedRVLayout = typename
KokkosKernels::Impl::GetUnifiedLayoutPreferring<RV, UnifiedXLayout>::array_layout;

// Create unmanaged versions of the input Views. RV and XMV may be
// rank 1 or rank 2.
typedef Kokkos::View<
typename Kokkos::Impl::if_c<
RV::rank == 0,
typename RV::non_const_value_type,
typename RV::non_const_value_type* >::type,
typename KokkosKernels::Impl::GetUnifiedLayout<RV>::array_layout,
UnifiedRVLayout,
typename RV::device_type,
Kokkos::MemoryTraits<Kokkos::Unmanaged> > RV_Internal;
typedef Kokkos::View<
typename Kokkos::Impl::if_c<
XMV::rank == 1,
typename XMV::const_value_type*,
typename XMV::const_value_type** >::type,
typename KokkosKernels::Impl::GetUnifiedLayout<XMV>::array_layout,
UnifiedXLayout,
typename XMV::device_type,
Kokkos::MemoryTraits<Kokkos::Unmanaged> > XMV_Internal;

Expand Down
23 changes: 11 additions & 12 deletions src/blas/KokkosBlas1_nrm2.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ nrm2 (const XVector& x)
static_assert (Kokkos::Impl::is_view<XVector>::value,
"KokkosBlas::nrm2: XVector must be a Kokkos::View.");
static_assert (XVector::rank == 1, "KokkosBlas::nrm2: "
"Both Vector inputs must have rank 1.");
"XVector must have rank 1.");
typedef typename Kokkos::Details::InnerProductSpaceTraits<typename XVector::non_const_value_type>::mag_type mag_type;

typedef Kokkos::View<typename XVector::const_value_type*,
Expand All @@ -73,7 +73,7 @@ nrm2 (const XVector& x)
Kokkos::MemoryTraits<Kokkos::Unmanaged> > XVector_Internal;

typedef Kokkos::View<mag_type,
Kokkos::LayoutLeft,
typename XVector_Internal::array_layout,
Kokkos::HostSpace,
Kokkos::MemoryTraits<Kokkos::Unmanaged> > RVector_Internal;

Expand Down Expand Up @@ -129,22 +129,21 @@ nrm2 (const RV& R, const XMV& X,
Kokkos::Impl::throw_runtime_exception (os.str ());
}

using UnifiedXLayout = typename
KokkosKernels::Impl::GetUnifiedLayout<XMV>::array_layout;
using UnifiedRVLayout = typename
KokkosKernels::Impl::GetUnifiedLayoutPreferring<RV, UnifiedXLayout>::array_layout;

// Create unmanaged versions of the input Views. RV and XMV may be
// rank 1 or rank 2.
typedef Kokkos::View<
typename Kokkos::Impl::if_c<
RV::rank == 0,
typename RV::non_const_value_type,
typename RV::non_const_value_type* >::type,
typename KokkosKernels::Impl::GetUnifiedLayout<RV>::array_layout,
typename RV::non_const_data_type,
UnifiedRVLayout,
typename RV::device_type,
Kokkos::MemoryTraits<Kokkos::Unmanaged> > RV_Internal;
typedef Kokkos::View<
typename Kokkos::Impl::if_c<
XMV::rank == 1,
typename XMV::const_value_type*,
typename XMV::const_value_type** >::type,
typename KokkosKernels::Impl::GetUnifiedLayout<XMV>::array_layout,
typename XMV::const_data_type,
UnifiedXLayout,
typename XMV::device_type,
Kokkos::MemoryTraits<Kokkos::Unmanaged> > XMV_Internal;

Expand Down
21 changes: 10 additions & 11 deletions src/blas/KokkosBlas1_nrm2_squared.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ nrm2_squared (const XVector& x)
Kokkos::MemoryTraits<Kokkos::Unmanaged> > XVector_Internal;

typedef Kokkos::View<mag_type,
Kokkos::LayoutLeft,
typename XVector_Internal::array_layout,
Kokkos::HostSpace,
Kokkos::MemoryTraits<Kokkos::Unmanaged> > RVector_Internal;

Expand Down Expand Up @@ -129,22 +129,21 @@ nrm2_squared (const RV& R, const XMV& X,
Kokkos::Impl::throw_runtime_exception (os.str ());
}

using UnifiedXLayout = typename
KokkosKernels::Impl::GetUnifiedLayout<XMV>::array_layout;
using UnifiedRVLayout = typename
KokkosKernels::Impl::GetUnifiedLayoutPreferring<RV, UnifiedXLayout>::array_layout;

// Create unmanaged versions of the input Views. RV and XMV may be
// rank 1 or rank 2.
typedef Kokkos::View<
typename Kokkos::Impl::if_c<
RV::rank == 0,
typename RV::non_const_value_type,
typename RV::non_const_value_type* >::type,
typename KokkosKernels::Impl::GetUnifiedLayout<RV>::array_layout,
typename RV::non_const_data_type,
UnifiedRVLayout,
typename RV::device_type,
Kokkos::MemoryTraits<Kokkos::Unmanaged> > RV_Internal;
typedef Kokkos::View<
typename Kokkos::Impl::if_c<
XMV::rank == 1,
typename XMV::const_value_type*,
typename XMV::const_value_type** >::type,
typename KokkosKernels::Impl::GetUnifiedLayout<XMV>::array_layout,
typename XMV::const_data_type,
UnifiedXLayout,
typename XMV::device_type,
Kokkos::MemoryTraits<Kokkos::Unmanaged> > XMV_Internal;

Expand Down
Loading