From f4866831db77e97d5383c314ef6e08d891b1cb20 Mon Sep 17 00:00:00 2001 From: Luc Berger-Vergiat Date: Mon, 15 Sep 2025 08:55:22 -0600 Subject: [PATCH 1/7] Common - ArithTraits: moving from Kokkos to KokkosKernels This simply moves the class to a new namespace to avoid having it in the Kokkos namespace. Signed-off-by: Luc Berger-Vergiat --- common/src/Kokkos_ArithTraits.hpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/common/src/Kokkos_ArithTraits.hpp b/common/src/Kokkos_ArithTraits.hpp index 7925f4a4ba..62cc81b130 100644 --- a/common/src/Kokkos_ArithTraits.hpp +++ b/common/src/Kokkos_ArithTraits.hpp @@ -187,7 +187,7 @@ KOKKOS_FORCEINLINE_FUNCTION IntType intPowUnsigned(const IntType x, const IntTyp } // namespace -namespace Kokkos { +namespace KokkosKernels { // Macro to automate the wrapping of Kokkos Mathematical Functions #define KOKKOSKERNELS_ARITHTRAITS_REAL_FP(FUNC_QUAL) \ @@ -1644,9 +1644,15 @@ struct [[deprecated]] ArithTraits { }; #endif // HAVE_KOKKOS_QD +} // namespace KokkosKernels + +namespace Kokkos { +template +using ArithTraits [[deprecated("Use KokkosKernels::ArithTraits instead")]] = ::KokkosKernels::ArithTraits; + namespace Details { template -using ArithTraits [[deprecated("Use Kokkos::ArithTraits instead")]] = ::Kokkos::ArithTraits; +using ArithTraits [[deprecated("Use KokkosKernels::ArithTraits instead")]] = ::KokkosKernels::ArithTraits; } // namespace Details } // namespace Kokkos From bdef930c569cfa43d5406a6a8e736ca075b932c2 Mon Sep 17 00:00:00 2001 From: Luc Berger-Vergiat Date: Mon, 29 Sep 2025 14:52:21 -0600 Subject: [PATCH 2/7] Applying change of namespace to library and tests Signed-off-by: Luc Berger-Vergiat --- batched/KokkosBatched_Util.hpp | 4 +- .../impl/KokkosBatched_AddRadial_Internal.hpp | 4 +- ...tched_ApplyHouseholder_Serial_Internal.hpp | 4 +- ...d_ApplyHouseholder_TeamVector_Internal.hpp | 6 +- .../dense/impl/KokkosBatched_Dot_Internal.hpp | 10 +- ...hed_Eigendecomposition_Serial_Internal.hpp | 2 +- ...kkosBatched_Eigenvalue_Serial_Internal.hpp | 2 +- .../KokkosBatched_Francis_Serial_Internal.hpp | 4 +- ...KokkosBatched_Gemm_TeamVector_Internal.hpp | 2 +- .../dense/impl/KokkosBatched_Gesv_Impl.hpp | 38 ++--- .../KokkosBatched_Givens_Serial_Internal.hpp | 4 +- ...HessenbergQR_WithShift_Serial_Internal.hpp | 2 +- ...kkosBatched_HostLevel_Gemm_Serial_Impl.hpp | 2 +- ...kosBatched_Householder_Serial_Internal.hpp | 8 +- ...atched_Householder_TeamVector_Internal.hpp | 6 +- .../KokkosBatched_Iamax_Serial_Internal.hpp | 2 +- .../impl/KokkosBatched_LU_Serial_Internal.hpp | 2 +- .../impl/KokkosBatched_LU_Team_Internal.hpp | 2 +- ...ftEigenvectorFromSchur_Serial_Internal.hpp | 2 +- .../impl/KokkosBatched_Normalize_Internal.hpp | 8 +- .../KokkosBatched_Pbtrf_Serial_Internal.hpp | 12 +- .../KokkosBatched_Pbtrs_Serial_Internal.hpp | 4 +- .../impl/KokkosBatched_Pttrf_Serial_Impl.hpp | 2 +- .../KokkosBatched_Pttrf_Serial_Internal.hpp | 4 +- .../KokkosBatched_Pttrs_Serial_Internal.hpp | 2 +- ...WithColumnPivoting_TeamVector_Internal.hpp | 4 +- ...htEigenvectorFromSchur_Serial_Internal.hpp | 2 +- .../KokkosBatched_SVD_Serial_Internal.hpp | 18 +-- ...KokkosBatched_Schur2x2_Serial_Internal.hpp | 2 +- .../KokkosBatched_Schur_Serial_Internal.hpp | 2 +- .../KokkosBatched_Trmm_Serial_Internal.hpp | 8 +- .../KokkosBatched_Trsm_Serial_Internal.hpp | 8 +- .../KokkosBatched_Trsv_Serial_Internal.hpp | 8 +- .../impl/KokkosBatched_Vector_SIMD_Arith.hpp | 8 +- .../impl/KokkosBatched_Vector_SIMD_Math.hpp | 32 ++-- ...Batched_WilkinsonShift_Serial_Internal.hpp | 4 +- batched/dense/src/KokkosBatched_SVD_Decl.hpp | 4 +- batched/dense/src/KokkosBatched_Vector.hpp | 2 +- .../dense/src/KokkosBatched_Vector_SIMD.hpp | 2 +- .../unit_test/Test_Batched_BatchedGemm.hpp | 2 +- .../unit_test/Test_Batched_DenseUtils.hpp | 8 +- .../unit_test/Test_Batched_SerialAxpy.hpp | 2 +- .../unit_test/Test_Batched_SerialGbtrf.hpp | 4 +- .../unit_test/Test_Batched_SerialGbtrs.hpp | 4 +- .../unit_test/Test_Batched_SerialGemm.hpp | 2 +- .../unit_test/Test_Batched_SerialGer.hpp | 6 +- .../unit_test/Test_Batched_SerialGesv.hpp | 4 +- .../unit_test/Test_Batched_SerialGetrf.hpp | 4 +- .../unit_test/Test_Batched_SerialGetrs.hpp | 4 +- .../unit_test/Test_Batched_SerialIamax.hpp | 2 +- .../Test_Batched_SerialInverseLU.hpp | 2 +- .../dense/unit_test/Test_Batched_SerialLU.hpp | 2 +- .../unit_test/Test_Batched_SerialLacgv.hpp | 6 +- .../unit_test/Test_Batched_SerialLaswp.hpp | 6 +- .../unit_test/Test_Batched_SerialPbtrf.hpp | 4 +- .../unit_test/Test_Batched_SerialPbtrs.hpp | 4 +- .../unit_test/Test_Batched_SerialPttrf.hpp | 8 +- .../unit_test/Test_Batched_SerialPttrs.hpp | 8 +- .../dense/unit_test/Test_Batched_SerialQR.hpp | 10 +- .../unit_test/Test_Batched_SerialSVD.hpp | 10 +- .../unit_test/Test_Batched_SerialSolveLU.hpp | 2 +- .../unit_test/Test_Batched_SerialSyr.hpp | 10 +- .../unit_test/Test_Batched_SerialTbsv.hpp | 4 +- .../unit_test/Test_Batched_SerialTrmm.hpp | 4 +- .../unit_test/Test_Batched_SerialTrsm.hpp | 10 +- .../unit_test/Test_Batched_SerialTrsv.hpp | 6 +- .../unit_test/Test_Batched_SerialTrtri.hpp | 4 +- .../dense/unit_test/Test_Batched_TeamAxpy.hpp | 2 +- .../dense/unit_test/Test_Batched_TeamGemm.hpp | 6 +- .../dense/unit_test/Test_Batched_TeamGesv.hpp | 4 +- .../unit_test/Test_Batched_TeamInverseLU.hpp | 2 +- .../dense/unit_test/Test_Batched_TeamLU.hpp | 2 +- .../unit_test/Test_Batched_TeamSolveLU.hpp | 2 +- .../dense/unit_test/Test_Batched_TeamTrsm.hpp | 2 +- .../dense/unit_test/Test_Batched_TeamTrsv.hpp | 2 +- .../unit_test/Test_Batched_TeamVectorAxpy.hpp | 2 +- .../unit_test/Test_Batched_TeamVectorGemm.hpp | 2 +- .../unit_test/Test_Batched_TeamVectorGesv.hpp | 4 +- .../unit_test/Test_Batched_TeamVectorQR.hpp | 2 +- ...atched_TeamVectorQR_WithColumnPivoting.hpp | 2 +- .../Test_Batched_TeamVectorSolveUTV.hpp | 2 +- .../Test_Batched_TeamVectorSolveUTV2.hpp | 2 +- .../unit_test/Test_Batched_TeamVectorUTV.hpp | 2 +- .../Test_Batched_VectorArithmatic.hpp | 8 +- .../unit_test/Test_Batched_VectorLogical.hpp | 2 +- .../unit_test/Test_Batched_VectorMath.hpp | 4 +- .../unit_test/Test_Batched_VectorMisc.hpp | 2 +- .../unit_test/Test_Batched_VectorRelation.hpp | 2 +- .../unit_test/Test_Batched_VectorView.hpp | 16 +- .../impl/KokkosBatched_CG_TeamVector_Impl.hpp | 6 +- .../impl/KokkosBatched_CG_Team_Impl.hpp | 6 +- .../impl/KokkosBatched_GMRES_Serial_Impl.hpp | 6 +- .../KokkosBatched_GMRES_TeamVector_Impl.hpp | 6 +- .../impl/KokkosBatched_GMRES_Team_Impl.hpp | 6 +- .../impl/KokkosBatched_Spmv_Serial_Impl.hpp | 6 +- .../KokkosBatched_Spmv_TeamVector_Impl.hpp | 6 +- .../impl/KokkosBatched_Spmv_Team_Impl.hpp | 6 +- .../sparse/src/KokkosBatched_CrsMatrix.hpp | 14 +- .../sparse/src/KokkosBatched_JacobiPrec.hpp | 10 +- .../src/KokkosBatched_Krylov_Handle.hpp | 2 +- batched/sparse/src/KokkosBatched_Spmv.hpp | 16 +- .../unit_test/Test_Batched_SerialGMRES.hpp | 4 +- .../unit_test/Test_Batched_SerialSpmv.hpp | 2 +- .../sparse/unit_test/Test_Batched_TeamCG.hpp | 4 +- .../unit_test/Test_Batched_TeamGMRES.hpp | 4 +- .../unit_test/Test_Batched_TeamSpmv.hpp | 2 +- .../unit_test/Test_Batched_TeamVectorCG.hpp | 4 +- .../Test_Batched_TeamVectorGMRES.hpp | 4 +- .../unit_test/Test_Batched_TeamVectorSpmv.hpp | 2 +- benchmarks/blas/KokkosBlas2_ger_benchmark.cpp | 10 +- benchmarks/ode/KokkosODE_BDF.cpp | 2 +- benchmarks/sparse/KokkosSparse_par_ilut.cpp | 2 +- .../KokkosSparse_spmv_bsr_benchmark.cpp | 12 +- blas/impl/KokkosBlas1_abs_impl.hpp | 8 +- blas/impl/KokkosBlas1_axpby_impl.hpp | 14 +- blas/impl/KokkosBlas1_axpby_mv_impl.hpp | 32 ++-- blas/impl/KokkosBlas1_axpby_spec.hpp | 16 +- ...Blas1_axpby_unification_attempt_traits.hpp | 24 +-- blas/impl/KokkosBlas1_dot_impl.hpp | 2 +- blas/impl/KokkosBlas1_dot_mv_impl.hpp | 4 +- blas/impl/KokkosBlas1_dot_spec.hpp | 2 +- blas/impl/KokkosBlas1_iamax_impl.hpp | 2 +- blas/impl/KokkosBlas1_mult_impl.hpp | 12 +- blas/impl/KokkosBlas1_nrm1_impl.hpp | 10 +- blas/impl/KokkosBlas1_nrm1_spec.hpp | 2 +- blas/impl/KokkosBlas1_nrm2_impl.hpp | 8 +- blas/impl/KokkosBlas1_nrm2_spec.hpp | 2 +- blas/impl/KokkosBlas1_nrm2w_impl.hpp | 8 +- blas/impl/KokkosBlas1_nrminf_impl.hpp | 4 +- blas/impl/KokkosBlas1_reciprocal_impl.hpp | 8 +- blas/impl/KokkosBlas1_rot_spec.hpp | 6 +- blas/impl/KokkosBlas1_rotg_impl.hpp | 16 +- blas/impl/KokkosBlas1_rotg_spec.hpp | 6 +- blas/impl/KokkosBlas1_rotm_impl.hpp | 6 +- blas/impl/KokkosBlas1_rotmg_impl.hpp | 6 +- blas/impl/KokkosBlas1_scal_impl.hpp | 4 +- blas/impl/KokkosBlas1_scal_mv_impl.hpp | 8 +- blas/impl/KokkosBlas1_scal_spec.hpp | 6 +- blas/impl/KokkosBlas1_sum_impl.hpp | 6 +- blas/impl/KokkosBlas1_sum_spec.hpp | 2 +- blas/impl/KokkosBlas1_team_abs_spec.hpp | 4 +- blas/impl/KokkosBlas1_team_dot_spec.hpp | 2 +- blas/impl/KokkosBlas1_team_nrm2_spec.hpp | 6 +- blas/impl/KokkosBlas1_update_impl.hpp | 4 +- blas/impl/KokkosBlas1_update_spec.hpp | 12 +- blas/impl/KokkosBlas2_gemv_impl.hpp | 78 ++++----- blas/impl/KokkosBlas2_ger_impl.hpp | 16 +- blas/impl/KokkosBlas2_syr2_impl.hpp | 64 ++++---- blas/impl/KokkosBlas2_syr_impl.hpp | 16 +- blas/impl/KokkosBlas3_gemm_dotbased_impl.hpp | 4 +- blas/impl/KokkosBlas3_gemm_impl.hpp | 16 +- blas/impl/KokkosBlas3_trsm_impl.hpp | 4 +- blas/impl/KokkosBlas_serial_nrm2.hpp | 4 +- blas/impl/KokkosBlas_util.hpp | 8 +- blas/src/KokkosBlas1_axpby.hpp | 2 +- blas/src/KokkosBlas1_nrm2.hpp | 2 +- blas/src/KokkosBlas1_rotg.hpp | 4 +- blas/src/KokkosBlas1_rotm.hpp | 4 +- blas/src/KokkosBlas1_team_axpby.hpp | 2 +- blas/tpls/KokkosBlas1_dot_tpl_spec_decl.hpp | 8 +- blas/tpls/KokkosBlas1_nrm1_tpl_spec_decl.hpp | 30 ++-- blas/tpls/KokkosBlas1_nrm2_tpl_spec_avail.hpp | 2 +- blas/tpls/KokkosBlas1_nrm2_tpl_spec_decl.hpp | 18 +-- blas/tpls/KokkosBlas1_rot_tpl_spec_avail.hpp | 4 +- blas/tpls/KokkosBlas1_rotg_tpl_spec_avail.hpp | 6 +- blas/tpls/KokkosBlas2_gemv_tpl_spec_decl.hpp | 10 +- blas/tpls/KokkosBlas_Host_tpl.hpp | 2 +- blas/unit_test/Test_Blas1_abs.hpp | 4 +- blas/unit_test/Test_Blas1_asum.hpp | 4 +- blas/unit_test/Test_Blas1_axpby.hpp | 12 +- .../Test_Blas1_axpby_unification.hpp | 148 +++++++++--------- blas/unit_test/Test_Blas1_axpy.hpp | 12 +- blas/unit_test/Test_Blas1_dot.hpp | 4 +- blas/unit_test/Test_Blas1_iamax.hpp | 8 +- blas/unit_test/Test_Blas1_nrm1.hpp | 12 +- blas/unit_test/Test_Blas1_nrm2.hpp | 8 +- blas/unit_test/Test_Blas1_nrm2_squared.hpp | 4 +- blas/unit_test/Test_Blas1_nrm2w.hpp | 8 +- blas/unit_test/Test_Blas1_nrm2w_squared.hpp | 4 +- blas/unit_test/Test_Blas1_nrminf.hpp | 8 +- blas/unit_test/Test_Blas1_reciprocal.hpp | 20 +-- blas/unit_test/Test_Blas1_rot.hpp | 4 +- blas/unit_test/Test_Blas1_rotg.hpp | 10 +- blas/unit_test/Test_Blas1_rotm.hpp | 2 +- blas/unit_test/Test_Blas1_rotmg.hpp | 2 +- blas/unit_test/Test_Blas1_scal.hpp | 12 +- blas/unit_test/Test_Blas1_serial_setscal.hpp | 2 +- blas/unit_test/Test_Blas1_swap.hpp | 6 +- blas/unit_test/Test_Blas1_team_abs.hpp | 8 +- blas/unit_test/Test_Blas1_team_axpby.hpp | 2 +- blas/unit_test/Test_Blas1_team_mult.hpp | 8 +- blas/unit_test/Test_Blas1_team_nrm2.hpp | 4 +- blas/unit_test/Test_Blas1_team_scal.hpp | 12 +- blas/unit_test/Test_Blas1_team_setscal.hpp | 2 +- blas/unit_test/Test_Blas2_gemv.hpp | 2 +- blas/unit_test/Test_Blas2_ger.hpp | 2 +- blas/unit_test/Test_Blas2_syr.hpp | 2 +- blas/unit_test/Test_Blas2_syr2.hpp | 4 +- blas/unit_test/Test_Blas3_gemm.hpp | 14 +- blas/unit_test/Test_Blas3_trmm.hpp | 6 +- blas/unit_test/Test_Blas3_trsm.hpp | 4 +- blas/unit_test/Test_Blas_serial_axpy.hpp | 2 +- blas/unit_test/Test_Blas_serial_nrm2.hpp | 12 +- common/impl/KokkosKernels_NaN.hpp | 2 +- common/impl/KokkosKernels_SafeCompare.hpp | 4 +- common/src/KokkosKernels_IOUtils.hpp | 4 +- common/src/KokkosKernels_Predicates.hpp | 8 +- common/src/KokkosKernels_SimpleUtils.hpp | 14 +- common/src/KokkosKernels_Utils.hpp | 2 +- common/src/Kokkos_ArithTraits.hpp | 2 +- common/src/Kokkos_InnerProductSpaceTraits.hpp | 32 ++-- common/unit_test/Test_Common_ArithTraits.hpp | 108 ++++++------- common/unit_test/Test_Common_Sorting.hpp | 2 +- docs/source/API/blas/blas1_rot.rst | 2 +- docs/source/API/blas/blas1_rotg.rst | 2 +- docs/source/API/blas/blas1_rotm.rst | 4 +- docs/source/API/blas/blas1_rotmg.rst | 6 +- docs/source/API/sparse/bsr_row_view.rst | 4 +- docs/source/API/sparse/par_ilut.rst | 2 +- docs/source/API/sparse/sort_crs.rst | 10 +- example/batched_solve/team_GMRES.cpp | 2 +- example/wiki/blas/KokkosBlas1_wiki_iamax.cpp | 4 +- example/wiki/blas/KokkosBlas2_wiki_ger.cpp | 2 +- .../sparse/KokkosSparse_wiki_bsrmatrix.cpp | 2 +- .../sparse/KokkosSparse_wiki_crsmatrix.cpp | 2 +- .../sparse/KokkosSparse_wiki_gauss_seidel.cpp | 6 +- .../wiki/sparse/KokkosSparse_wiki_spmv.cpp | 4 +- lapack/impl/KokkosLapack_svd_spec.hpp | 6 +- lapack/tpls/KokkosLapack_Host_tpl.hpp | 4 +- .../tpls/KokkosLapack_gesv_tpl_spec_decl.hpp | 6 +- .../tpls/KokkosLapack_svd_tpl_spec_avail.hpp | 6 +- .../tpls/KokkosLapack_svd_tpl_spec_decl.hpp | 26 +-- lapack/unit_test/Test_Lapack_gesv.hpp | 4 +- lapack/unit_test/Test_Lapack_svd.hpp | 26 +-- lapack/unit_test/Test_Lapack_trtri.hpp | 4 +- ode/impl/KokkosODE_BDF_impl.hpp | 12 +- ode/impl/KokkosODE_Newton_impl.hpp | 14 +- ode/impl/KokkosODE_RungeKutta_impl.hpp | 2 +- ode/src/KokkosODE_BDF.hpp | 2 +- ode/unit_test/Test_ODE_BDF.hpp | 4 +- ode/unit_test/Test_ODE_Newton.hpp | 2 +- ode/unit_test/Test_ODE_RK.hpp | 2 +- ...okkosBatched_Test_BlockJacobi_Tutorial.cpp | 2 +- .../KokkosBatched_Test_BlockTridiagDirect.cpp | 2 +- .../KokkosBatched_Test_BlockTridiagJacobi.cpp | 2 +- .../KokkosBatched_Test_Gemm_Cuda.cpp | 10 +- .../KokkosBatched_Test_Gemv_Host.hpp | 4 +- .../do-not-use/KokkosBatched_Test_LU_Cuda.cpp | 8 +- .../KokkosBatched_Test_Trsm_Cuda.cpp | 8 +- .../KokkosBatched_Test_Trsm_Host.hpp | 10 +- .../sparse/CG/KokkosBatched_Test_CG.cpp | 4 +- .../sparse/GMRES/KokkosBatched_Test_GMRES.cpp | 4 +- .../sparse/SPMV/KokkosBatched_SPMV_View.hpp | 2 +- .../sparse/SPMV/KokkosBatched_Test_SPMV.cpp | 2 +- .../KokkosBatched_Test_cusolverDn.cpp | 2 +- .../KokkosBatched_Test_cusolverSp.cpp | 2 +- .../blas/blas3/KokkosBlas3_gemm_perf_test.hpp | 2 +- perf_test/graph/KokkosGraph_mis_d2.cpp | 2 +- perf_test/sparse/KokkosSparse_kk_spmv.cpp | 2 +- perf_test/sparse/KokkosSparse_mdf.cpp | 2 +- perf_test/sparse/KokkosSparse_spmv_bsr.cpp | 8 +- perf_test/sparse/KokkosSparse_spmv_merge.cpp | 2 +- perf_test/sparse/KokkosSparse_sptrsv_aux.hpp | 2 +- .../sparse/KokkosSparse_sptrsv_cholmod.cpp | 2 +- .../sparse/KokkosSparse_sptrsv_superlu.cpp | 2 +- .../sparse/KokkosSparse_sptrsv_supernode.cpp | 2 +- perf_test/sparse/spmv/Kokkos_SPMV.hpp | 2 +- .../sparse/spmv/Kokkos_SPMV_Inspector.hpp | 2 +- ...KokkosSparse_cluster_gauss_seidel_impl.hpp | 6 +- sparse/impl/KokkosSparse_crs_to_bsr_impl.hpp | 4 +- .../impl/KokkosSparse_gauss_seidel_impl.hpp | 10 +- ...kkosSparse_getDiagCopyWithOffsets_impl.hpp | 2 +- sparse/impl/KokkosSparse_gmres_impl.hpp | 2 +- sparse/impl/KokkosSparse_mdf_impl.hpp | 16 +- .../KokkosSparse_par_ilut_numeric_impl.hpp | 2 +- .../impl/KokkosSparse_sor_sequential_impl.hpp | 10 +- .../impl/KokkosSparse_spadd_numeric_impl.hpp | 6 +- .../impl/KokkosSparse_spadd_symbolic_impl.hpp | 6 +- .../impl/KokkosSparse_spiluk_numeric_impl.hpp | 2 +- .../impl/KokkosSparse_spmv_bsrmatrix_impl.hpp | 62 ++++---- sparse/impl/KokkosSparse_spmv_impl.hpp | 26 +-- sparse/impl/KokkosSparse_spmv_impl_merge.hpp | 2 +- sparse/impl/KokkosSparse_spmv_spec.hpp | 4 +- sparse/impl/KokkosSparse_spmv_struct_impl.hpp | 14 +- sparse/impl/KokkosSparse_spmv_struct_spec.hpp | 6 +- .../impl/KokkosSparse_sptrsv_solve_impl.hpp | 2 +- sparse/impl/KokkosSparse_trsv_impl.hpp | 2 +- ...okkosSparse_twostage_gauss_seidel_impl.hpp | 8 +- sparse/src/KokkosSparse_BsrMatrix.hpp | 10 +- sparse/src/KokkosSparse_IOUtils.hpp | 8 +- sparse/src/KokkosSparse_LUPrec.hpp | 2 +- sparse/src/KokkosSparse_MatrixPrec.hpp | 2 +- sparse/src/KokkosSparse_Preconditioner.hpp | 2 +- sparse/src/KokkosSparse_SortCrs.hpp | 42 ++--- sparse/src/KokkosSparse_Utils.hpp | 6 +- sparse/src/KokkosSparse_gmres_handle.hpp | 2 +- sparse/src/KokkosSparse_mdf.hpp | 6 +- sparse/src/KokkosSparse_par_ilut_handle.hpp | 2 +- sparse/src/KokkosSparse_spiluk_handle.hpp | 4 +- sparse/src/KokkosSparse_spmv.hpp | 14 +- sparse/src/KokkosSparse_sptrsv_handle.hpp | 2 +- ...kkosSparse_spadd_numeric_tpl_spec_decl.hpp | 4 +- ...kosSparse_spadd_symbolic_tpl_spec_decl.hpp | 4 +- ...kosSparse_spgemm_noreuse_tpl_spec_decl.hpp | 8 +- ...kosSparse_spgemm_numeric_tpl_spec_decl.hpp | 18 +-- ...osSparse_spgemm_symbolic_tpl_spec_decl.hpp | 14 +- ...kosSparse_spmv_bsrmatrix_tpl_spec_decl.hpp | 10 +- .../KokkosSparse_spmv_mv_tpl_spec_decl.hpp | 4 +- .../tpls/KokkosSparse_spmv_tpl_spec_decl.hpp | 12 +- sparse/unit_test/Test_Sparse_CrsMatrix.hpp | 2 +- sparse/unit_test/Test_Sparse_Utils.hpp | 2 +- .../Test_Sparse_block_gauss_seidel.hpp | 10 +- sparse/unit_test/Test_Sparse_bspgemm.hpp | 2 +- sparse/unit_test/Test_Sparse_coo2crs.hpp | 2 +- ...est_Sparse_extractCrsDiagonalBlocksRCB.hpp | 2 +- sparse/unit_test/Test_Sparse_gauss_seidel.hpp | 42 ++--- sparse/unit_test/Test_Sparse_gmres.hpp | 4 +- sparse/unit_test/Test_Sparse_mdf.hpp | 4 +- sparse/unit_test/Test_Sparse_par_ilut.hpp | 2 +- .../Test_Sparse_removeCrsMatrixZeros.hpp | 2 +- .../unit_test/Test_Sparse_replaceSumInto.hpp | 6 +- .../Test_Sparse_replaceSumIntoLonger.hpp | 8 +- sparse/unit_test/Test_Sparse_spadd.hpp | 6 +- .../unit_test/Test_Sparse_spgemm_jacobi.hpp | 2 +- sparse/unit_test/Test_Sparse_spiluk.hpp | 4 +- sparse/unit_test/Test_Sparse_spmv.hpp | 50 +++--- sparse/unit_test/Test_Sparse_spmv_bsr.hpp | 4 +- sparse/unit_test/Test_Sparse_sptrsv.hpp | 2 +- test_common/KokkosKernels_TestUtils.hpp | 8 +- test_common/KokkosKernels_TestVanilla.hpp | 8 +- 330 files changed, 1258 insertions(+), 1258 deletions(-) diff --git a/batched/KokkosBatched_Util.hpp b/batched/KokkosBatched_Util.hpp index 78e0eac21b..1401186f9e 100644 --- a/batched/KokkosBatched_Util.hpp +++ b/batched/KokkosBatched_Util.hpp @@ -154,10 +154,10 @@ struct is_vector : public std::false_type {}; template struct is_same_mag_type { static const bool is_specialized = - (Kokkos::ArithTraits::is_specialized && Kokkos::ArithTraits::is_specialized); + (KokkosKernels::ArithTraits::is_specialized && KokkosKernels::ArithTraits::is_specialized); static const bool is_mag_type_same = - std::is_same::mag_type, typename Kokkos::ArithTraits::mag_type>::value; + std::is_same::mag_type, typename KokkosKernels::ArithTraits::mag_type>::value; static const bool value = is_specialized && is_mag_type_same; }; diff --git a/batched/dense/impl/KokkosBatched_AddRadial_Internal.hpp b/batched/dense/impl/KokkosBatched_AddRadial_Internal.hpp index 7b8220dcfe..f2879abfac 100644 --- a/batched/dense/impl/KokkosBatched_AddRadial_Internal.hpp +++ b/batched/dense/impl/KokkosBatched_AddRadial_Internal.hpp @@ -37,7 +37,7 @@ struct SerialAddRadialInternal { #endif for (int i = 0; i < m; ++i) { // const auto a_real = RealPart(A[i*as]); - const auto a_real = Kokkos::ArithTraits::real(A[i * as]); + const auto a_real = KokkosKernels::ArithTraits::real(A[i * as]); A[i * as] += ValueType(minus_abs_tiny) * ValueType(a_real < 0); A[i * as] += ValueType(abs_tiny) * ValueType(a_real >= 0); } @@ -58,7 +58,7 @@ struct TeamAddRadialInternal { Kokkos::parallel_for(Kokkos::TeamThreadRange(member, m), [&](const int &i) { // const auto a_real = RealPart(A[i*as]); - const auto a_real = Kokkos::ArithTraits::real(A[i * as]); + const auto a_real = KokkosKernels::ArithTraits::real(A[i * as]); A[i * as] += ValueType(minus_abs_tiny) * ValueType(a_real < 0); A[i * as] += ValueType(abs_tiny) * ValueType(a_real >= 0); }); diff --git a/batched/dense/impl/KokkosBatched_ApplyHouseholder_Serial_Internal.hpp b/batched/dense/impl/KokkosBatched_ApplyHouseholder_Serial_Internal.hpp index 23d979dcc2..04c792d2f8 100644 --- a/batched/dense/impl/KokkosBatched_ApplyHouseholder_Serial_Internal.hpp +++ b/batched/dense/impl/KokkosBatched_ApplyHouseholder_Serial_Internal.hpp @@ -53,7 +53,7 @@ struct SerialApplyLeftHouseholderInternal { // w1t /= tau for (int j = 0; j < n; ++j) { value_type tmp = a1t[j * a1ts]; - for (int i = 0; i < m; ++i) tmp += Kokkos::ArithTraits::conj(u2[i * u2s]) * A2[i * as0 + j * as1]; + for (int i = 0; i < m; ++i) tmp += KokkosKernels::ArithTraits::conj(u2[i * u2s]) * A2[i * as0 + j * as1]; w1t[j] = tmp * inv_tau; // /= (*tau); } @@ -101,7 +101,7 @@ struct SerialApplyRightHouseholderInternal { // A2 -= w1 * u2' (ger with conjugate) for (int j = 0; j < n; ++j) - for (int i = 0; i < m; ++i) A2[i * as0 + j * as1] -= w1[i] * Kokkos::ArithTraits::conj(u2[j * u2s]); + for (int i = 0; i < m; ++i) A2[i * as0 + j * as1] -= w1[i] * KokkosKernels::ArithTraits::conj(u2[j * u2s]); return 0; } diff --git a/batched/dense/impl/KokkosBatched_ApplyHouseholder_TeamVector_Internal.hpp b/batched/dense/impl/KokkosBatched_ApplyHouseholder_TeamVector_Internal.hpp index b3cfc8b6de..6f4698b709 100644 --- a/batched/dense/impl/KokkosBatched_ApplyHouseholder_TeamVector_Internal.hpp +++ b/batched/dense/impl/KokkosBatched_ApplyHouseholder_TeamVector_Internal.hpp @@ -56,7 +56,7 @@ struct TeamVectorApplyLeftHouseholderInternal { Kokkos::parallel_reduce( Kokkos::ThreadVectorRange(member, m), [&](const int &i, value_type &val) { - val += Kokkos::ArithTraits::conj(u2[i * u2s]) * A2[i * as0 + j * as1]; + val += KokkosKernels::ArithTraits::conj(u2[i * u2s]) * A2[i * as0 + j * as1]; }, tmp); Kokkos::single(Kokkos::PerThread(member), [&]() { @@ -125,13 +125,13 @@ struct TeamVectorApplyRightHouseholderInternal { if (as0 <= as1) { Kokkos::parallel_for(Kokkos::TeamThreadRange(member, n), [&](const int &j) { Kokkos::parallel_for(Kokkos::ThreadVectorRange(member, m), [&](const int &i) { - A2[i * as0 + j * as1] -= w1[i] * Kokkos::ArithTraits::conj(u2[j * u2s]); + A2[i * as0 + j * as1] -= w1[i] * KokkosKernels::ArithTraits::conj(u2[j * u2s]); }); }); } else { Kokkos::parallel_for(Kokkos::ThreadVectorRange(member, n), [&](const int &j) { Kokkos::parallel_for(Kokkos::TeamThreadRange(member, m), [&](const int &i) { - A2[i * as0 + j * as1] -= w1[i] * Kokkos::ArithTraits::conj(u2[j * u2s]); + A2[i * as0 + j * as1] -= w1[i] * KokkosKernels::ArithTraits::conj(u2[j * u2s]); }); }); } diff --git a/batched/dense/impl/KokkosBatched_Dot_Internal.hpp b/batched/dense/impl/KokkosBatched_Dot_Internal.hpp index fce28a020d..690d2c0ed4 100644 --- a/batched/dense/impl/KokkosBatched_Dot_Internal.hpp +++ b/batched/dense/impl/KokkosBatched_Dot_Internal.hpp @@ -34,7 +34,7 @@ struct SerialDotInternal { KOKKOS_FORCEINLINE_FUNCTION static int invoke(const int m, const ValueType *KOKKOS_RESTRICT A, const int as0, const ValueType *KOKKOS_RESTRICT B, const int bs0, /* */ MagnitudeType *KOKKOS_RESTRICT C) { - using ats = Kokkos::ArithTraits; + using ats = KokkosKernels::ArithTraits; C[0] = ValueType(0); #if defined(KOKKOS_ENABLE_PRAGMA_UNROLL) #pragma unroll @@ -70,7 +70,7 @@ struct TeamDotInternal { const ValueType *KOKKOS_RESTRICT A, const int as0, const ValueType *KOKKOS_RESTRICT B, const int bs0, /* */ MagnitudeType *KOKKOS_RESTRICT C) { - using ats = Kokkos::ArithTraits; + using ats = KokkosKernels::ArithTraits; ValueType t(0); Kokkos::parallel_reduce( Kokkos::TeamThreadRange(member, m), @@ -90,7 +90,7 @@ struct TeamDotInternal { const ValueType *KOKKOS_RESTRICT A, const int as0, const int as1, const ValueType *KOKKOS_RESTRICT B, const int bs0, const int bs1, /* */ MagnitudeType *KOKKOS_RESTRICT C, const int cs) { - using ats = Kokkos::ArithTraits; + using ats = KokkosKernels::ArithTraits; Kokkos::parallel_for(Kokkos::TeamThreadRange(member, n), [&](const int &j) { ValueType t(0); const ValueType *KOKKOS_RESTRICT A_at_j = A + j * as1; @@ -117,7 +117,7 @@ struct TeamVectorDotInternal { const ValueType *KOKKOS_RESTRICT A, const int as0, const ValueType *KOKKOS_RESTRICT B, const int bs0, /* */ MagnitudeType *KOKKOS_RESTRICT C) { - using ats = Kokkos::ArithTraits; + using ats = KokkosKernels::ArithTraits; ValueType t(0); Kokkos::parallel_reduce( Kokkos::TeamVectorRange(member, m), @@ -137,7 +137,7 @@ struct TeamVectorDotInternal { const ValueType *KOKKOS_RESTRICT A, const int as0, const int as1, const ValueType *KOKKOS_RESTRICT B, const int bs0, const int bs1, /* */ MagnitudeType *KOKKOS_RESTRICT C, const int cs) { - using ats = Kokkos::ArithTraits; + using ats = KokkosKernels::ArithTraits; Kokkos::parallel_for(Kokkos::TeamThreadRange(member, n), [&](const int &j) { ValueType t(0); const ValueType *KOKKOS_RESTRICT A_at_j = A + j * as1; diff --git a/batched/dense/impl/KokkosBatched_Eigendecomposition_Serial_Internal.hpp b/batched/dense/impl/KokkosBatched_Eigendecomposition_Serial_Internal.hpp index 9badd0a38b..7648ed32a4 100644 --- a/batched/dense/impl/KokkosBatched_Eigendecomposition_Serial_Internal.hpp +++ b/batched/dense/impl/KokkosBatched_Eigendecomposition_Serial_Internal.hpp @@ -71,7 +71,7 @@ struct SerialEigendecompositionInternal { "Serial eigendecomposition on device and/or without LAPACK " "is not implemented yet"); // typedef RealType real_type; - // typedef Kokkos::ArithTraits ats; + // typedef KokkosKernels::ArithTraits ats; // const real_type one(1), zero(0), tol = 1e2*ats::epsilon(); // //const Kokkos::pair identity(one, zero); diff --git a/batched/dense/impl/KokkosBatched_Eigenvalue_Serial_Internal.hpp b/batched/dense/impl/KokkosBatched_Eigenvalue_Serial_Internal.hpp index 408ba2f2ad..62b531dbbe 100644 --- a/batched/dense/impl/KokkosBatched_Eigenvalue_Serial_Internal.hpp +++ b/batched/dense/impl/KokkosBatched_Eigenvalue_Serial_Internal.hpp @@ -66,7 +66,7 @@ struct SerialEigenvalueInternal { /* */ RealType *ei, const int eis, const bool restart = false, const int user_max_iteration = -1) { typedef RealType real_type; - typedef Kokkos::ArithTraits ats; + typedef KokkosKernels::ArithTraits ats; const real_type zero(0), nan(ats::nan()), tol = 1e2 * ats::epsilon(); const int max_iteration = user_max_iteration < 0 ? 300 : user_max_iteration; diff --git a/batched/dense/impl/KokkosBatched_Francis_Serial_Internal.hpp b/batched/dense/impl/KokkosBatched_Francis_Serial_Internal.hpp index 9a3be4ab56..9c04f67458 100644 --- a/batched/dense/impl/KokkosBatched_Francis_Serial_Internal.hpp +++ b/batched/dense/impl/KokkosBatched_Francis_Serial_Internal.hpp @@ -80,8 +80,8 @@ struct SerialFrancisInternal { t = lambda1.real() * lambda1.real() + lambda1.imag() * lambda1.imag(); } else { const value_type val = H[(m - 1) * hs]; - const auto dist_lambda1 = Kokkos::ArithTraits::abs(lambda1.real() - val); - const auto dist_lambda2 = Kokkos::ArithTraits::abs(lambda2.real() - val); + const auto dist_lambda1 = KokkosKernels::ArithTraits::abs(lambda1.real() - val); + const auto dist_lambda2 = KokkosKernels::ArithTraits::abs(lambda2.real() - val); const value_type lambda = dist_lambda1 < dist_lambda2 ? lambda1.real() : lambda2.real(); s = 2 * lambda; t = lambda * lambda; diff --git a/batched/dense/impl/KokkosBatched_Gemm_TeamVector_Internal.hpp b/batched/dense/impl/KokkosBatched_Gemm_TeamVector_Internal.hpp index 1b46270f5a..2255656537 100644 --- a/batched/dense/impl/KokkosBatched_Gemm_TeamVector_Internal.hpp +++ b/batched/dense/impl/KokkosBatched_Gemm_TeamVector_Internal.hpp @@ -102,7 +102,7 @@ KOKKOS_INLINE_FUNCTION int TeamVectorGemmInternal:: const ValueType *KOKKOS_RESTRICT pB = B + j * bs1; ValueType c = ValueType(0); - for (int p = 0; p < k; ++p) c += Kokkos::ArithTraits::conj(pA[p * as1]) * pB[p * bs0]; + for (int p = 0; p < k; ++p) c += KokkosKernels::ArithTraits::conj(pA[p * as1]) * pB[p * bs0]; C[i * cs0 + j * cs1] += alpha * c; }); }); diff --git a/batched/dense/impl/KokkosBatched_Gesv_Impl.hpp b/batched/dense/impl/KokkosBatched_Gesv_Impl.hpp index 399eeea127..22eb9b3a03 100644 --- a/batched/dense/impl/KokkosBatched_Gesv_Impl.hpp +++ b/batched/dense/impl/KokkosBatched_Gesv_Impl.hpp @@ -59,7 +59,7 @@ KOKKOS_INLINE_FUNCTION int SerialStaticPivoting::invoke(const MatrixType1 A, con // First, the algorithm loops over the rows and columns and search // for the maximal absolute value per row and column. for (size_t i = 0; i < n; ++i) { - D2(i) = Kokkos::ArithTraits::zero(); + D2(i) = KokkosKernels::ArithTraits::zero(); tmp_v_1(i) = 0; tmp_v_2(i) = 1.; for (size_t j = 0; j < n; ++j) { @@ -82,7 +82,7 @@ KOKKOS_INLINE_FUNCTION int SerialStaticPivoting::invoke(const MatrixType1 A, con // of A and Y. value_type D1_i; for (size_t i = 0; i < n; ++i) { - D1_i = Kokkos::ArithTraits::zero(); + D1_i = KokkosKernels::ArithTraits::zero(); for (size_t j = 0; j < n; ++j) { if (D1_i < Kokkos::abs(A(i, j))) D1_i = Kokkos::abs(A(i, j)); } @@ -104,8 +104,8 @@ KOKKOS_INLINE_FUNCTION int SerialStaticPivoting::invoke(const MatrixType1 A, con for (size_t i = 0; i < n; ++i) { int row_index = 0; int col_index = 0; - value_type tmp_0 = Kokkos::ArithTraits::zero(); - value_type tmp_1 = Kokkos::ArithTraits::zero(); + value_type tmp_0 = KokkosKernels::ArithTraits::zero(); + value_type tmp_1 = KokkosKernels::ArithTraits::zero(); for (size_t j = 0; j < n; ++j) { if (tmp_0 < tmp_v_1(j)) { tmp_0 = tmp_v_1(j); @@ -118,9 +118,9 @@ KOKKOS_INLINE_FUNCTION int SerialStaticPivoting::invoke(const MatrixType1 A, con col_index = j; } } - if (tmp_1 == Kokkos::ArithTraits::zero()) return 1; - tmp_v_1(row_index) = Kokkos::ArithTraits::zero(); - tmp_v_2(col_index) = Kokkos::ArithTraits::zero(); + if (tmp_1 == KokkosKernels::ArithTraits::zero()) return 1; + tmp_v_1(row_index) = KokkosKernels::ArithTraits::zero(); + tmp_v_2(col_index) = KokkosKernels::ArithTraits::zero(); for (size_t j = 0; j < n; ++j) { PDAD(col_index, j) = A(row_index, j); @@ -147,7 +147,7 @@ KOKKOS_INLINE_FUNCTION int TeamStaticPivoting::invoke(const MemberTy size_t n = A.extent(0); Kokkos::parallel_for(Kokkos::TeamThreadRange(member, n), [&](const int &i) { - D2(i) = Kokkos::ArithTraits::zero(); + D2(i) = KokkosKernels::ArithTraits::zero(); tmp_v_1(i) = 0; tmp_v_2(i) = 1.; for (size_t j = 0; j < n; ++j) { @@ -164,7 +164,7 @@ KOKKOS_INLINE_FUNCTION int TeamStaticPivoting::invoke(const MemberTy }); Kokkos::parallel_for(Kokkos::TeamThreadRange(member, n), [&](const int &i) { - value_type D1_i = Kokkos::ArithTraits::zero(); + value_type D1_i = KokkosKernels::ArithTraits::zero(); for (size_t j = 0; j < n; ++j) { if (D1_i < Kokkos::abs(A(i, j))) D1_i = Kokkos::abs(A(i, j)); } @@ -190,7 +190,7 @@ KOKKOS_INLINE_FUNCTION int TeamStaticPivoting::invoke(const MemberTy reducer_value); row_index = value.loc; value.loc = 0; - value.val = Kokkos::ArithTraits::zero(); + value.val = KokkosKernels::ArithTraits::zero(); Kokkos::parallel_reduce( Kokkos::TeamThreadRange(member, n), [&](const int &j, reducer_value_type &update) { @@ -201,9 +201,9 @@ KOKKOS_INLINE_FUNCTION int TeamStaticPivoting::invoke(const MemberTy }, reducer_value); col_index = value.loc; - if (value.val == Kokkos::ArithTraits::zero()) return 1; - tmp_v_1(row_index) = Kokkos::ArithTraits::zero(); - tmp_v_2(col_index) = Kokkos::ArithTraits::zero(); + if (value.val == KokkosKernels::ArithTraits::zero()) return 1; + tmp_v_1(row_index) = KokkosKernels::ArithTraits::zero(); + tmp_v_2(col_index) = KokkosKernels::ArithTraits::zero(); for (size_t j = 0; j < n; ++j) { PDAD(col_index, j) = A(row_index, j); @@ -228,7 +228,7 @@ KOKKOS_INLINE_FUNCTION int TeamVectorStaticPivoting::invoke(const Me const size_t n = A.extent(0); Kokkos::parallel_for(Kokkos::TeamThreadRange(member, n), [&](const int &i) { - D2(i) = Kokkos::ArithTraits::zero(); + D2(i) = KokkosKernels::ArithTraits::zero(); tmp_v_1(i) = 0; tmp_v_2(i) = 1.; reducer_value_type value; @@ -260,7 +260,7 @@ KOKKOS_INLINE_FUNCTION int TeamVectorStaticPivoting::invoke(const Me }); Kokkos::parallel_for(Kokkos::TeamThreadRange(member, n), [&](const int &i) { - value_type D1_i = Kokkos::ArithTraits::zero(); + value_type D1_i = KokkosKernels::ArithTraits::zero(); reducer_value_type value; Kokkos::MaxLoc reducer_value(value); Kokkos::parallel_reduce( @@ -292,7 +292,7 @@ KOKKOS_INLINE_FUNCTION int TeamVectorStaticPivoting::invoke(const Me reducer_value); row_index = value.loc; value.loc = 0; - value.val = Kokkos::ArithTraits::zero(); + value.val = KokkosKernels::ArithTraits::zero(); Kokkos::parallel_reduce( Kokkos::TeamVectorRange(member, n), [&](const int &j, reducer_value_type &update) { @@ -303,9 +303,9 @@ KOKKOS_INLINE_FUNCTION int TeamVectorStaticPivoting::invoke(const Me }, reducer_value); col_index = value.loc; - if (value.val == Kokkos::ArithTraits::zero()) return 1; - tmp_v_1(row_index) = Kokkos::ArithTraits::zero(); - tmp_v_2(col_index) = Kokkos::ArithTraits::zero(); + if (value.val == KokkosKernels::ArithTraits::zero()) return 1; + tmp_v_1(row_index) = KokkosKernels::ArithTraits::zero(); + tmp_v_2(col_index) = KokkosKernels::ArithTraits::zero(); Kokkos::parallel_for(Kokkos::TeamVectorRange(member, n), [&](const int &j) { PDAD(col_index, j) = A(row_index, j); }); diff --git a/batched/dense/impl/KokkosBatched_Givens_Serial_Internal.hpp b/batched/dense/impl/KokkosBatched_Givens_Serial_Internal.hpp index 2fb22d275d..e6926859af 100644 --- a/batched/dense/impl/KokkosBatched_Givens_Serial_Internal.hpp +++ b/batched/dense/impl/KokkosBatched_Givens_Serial_Internal.hpp @@ -53,11 +53,11 @@ struct SerialGivensInternal { } else { // here we do not care overflow caused by the division although it is // probable.... - r = Kokkos::ArithTraits::sqrt(chi1 * chi1 + chi2 * chi2); + r = KokkosKernels::ArithTraits::sqrt(chi1 * chi1 + chi2 * chi2); cs = chi1 / r; sn = chi2 / r; - if (Kokkos::ArithTraits::abs(chi1) > Kokkos::ArithTraits::abs(chi2) && cs < zero) { + if (KokkosKernels::ArithTraits::abs(chi1) > KokkosKernels::ArithTraits::abs(chi2) && cs < zero) { cs = -cs; sn = -sn; r = -r; diff --git a/batched/dense/impl/KokkosBatched_HessenbergQR_WithShift_Serial_Internal.hpp b/batched/dense/impl/KokkosBatched_HessenbergQR_WithShift_Serial_Internal.hpp index 92498c0ce6..d7781dea70 100644 --- a/batched/dense/impl/KokkosBatched_HessenbergQR_WithShift_Serial_Internal.hpp +++ b/batched/dense/impl/KokkosBatched_HessenbergQR_WithShift_Serial_Internal.hpp @@ -36,7 +36,7 @@ struct SerialHessenbergQR_WithShiftInternal { /* */ ValueType *HH, const int hs0, const int hs1, const ValueType shift, /* */ Kokkos::pair *GG, const bool request_schur) { typedef ValueType value_type; - // typedef Kokkos::ArithTraits ats; + // typedef KokkosKernels::ArithTraits ats; const int hs = hs0 + hs1; const value_type zero(0), one(1); diff --git a/batched/dense/impl/KokkosBatched_HostLevel_Gemm_Serial_Impl.hpp b/batched/dense/impl/KokkosBatched_HostLevel_Gemm_Serial_Impl.hpp index 11fad06065..d25a72fb90 100644 --- a/batched/dense/impl/KokkosBatched_HostLevel_Gemm_Serial_Impl.hpp +++ b/batched/dense/impl/KokkosBatched_HostLevel_Gemm_Serial_Impl.hpp @@ -160,7 +160,7 @@ class BatchedSerialGemm { // KokkosBatched::SerialDotInternal::invoke(svA_row.extent(0), svA_row.data(), svA_row.stride(0), // svB_col.data(), svB_col.stride(0), &svA_row_x_svB_col); - using ats = Kokkos::ArithTraits; + using ats = KokkosKernels::ArithTraits; // iC[0] = ValueType(0); #if defined(KOKKOS_ENABLE_PRAGMA_UNROLL) #pragma unroll diff --git a/batched/dense/impl/KokkosBatched_Householder_Serial_Internal.hpp b/batched/dense/impl/KokkosBatched_Householder_Serial_Internal.hpp index b84527a610..fd4f7a701a 100644 --- a/batched/dense/impl/KokkosBatched_Householder_Serial_Internal.hpp +++ b/batched/dense/impl/KokkosBatched_Householder_Serial_Internal.hpp @@ -35,7 +35,7 @@ struct SerialLeftHouseholderInternal { /* */ ValueType* x2, const int x2s, /* */ ValueType* tau) { typedef ValueType value_type; - typedef typename Kokkos::ArithTraits::mag_type mag_type; + typedef typename KokkosKernels::ArithTraits::mag_type mag_type; const mag_type zero(0); const mag_type half(0.5); @@ -58,13 +58,13 @@ struct SerialLeftHouseholderInternal { } /// compute magnitude of chi1, equal to norm2 of chi1 - const mag_type norm_chi1 = Kokkos::ArithTraits::abs(*chi1); + const mag_type norm_chi1 = KokkosKernels::ArithTraits::abs(*chi1); /// compute 2 norm of x using norm_chi1 and norm_x2 - const mag_type norm_x = Kokkos::ArithTraits::sqrt(norm_x2_square + norm_chi1 * norm_chi1); + const mag_type norm_x = KokkosKernels::ArithTraits::sqrt(norm_x2_square + norm_chi1 * norm_chi1); /// compute alpha - const mag_type alpha = (*chi1 < Kokkos::ArithTraits::zero() ? one : minus_one) * norm_x; + const mag_type alpha = (*chi1 < KokkosKernels::ArithTraits::zero() ? one : minus_one) * norm_x; /// overwrite x2 with u2 const value_type chi1_minus_alpha = *chi1 - alpha; diff --git a/batched/dense/impl/KokkosBatched_Householder_TeamVector_Internal.hpp b/batched/dense/impl/KokkosBatched_Householder_TeamVector_Internal.hpp index efd046e232..734c1eca61 100644 --- a/batched/dense/impl/KokkosBatched_Householder_TeamVector_Internal.hpp +++ b/batched/dense/impl/KokkosBatched_Householder_TeamVector_Internal.hpp @@ -35,7 +35,7 @@ struct TeamVectorLeftHouseholderInternal { /* */ ValueType *x2, const int x2s, /* */ ValueType *tau) { typedef ValueType value_type; - typedef typename Kokkos::ArithTraits::mag_type mag_type; + typedef typename KokkosKernels::ArithTraits::mag_type mag_type; const mag_type zero(0); const mag_type half(0.5); @@ -63,10 +63,10 @@ struct TeamVectorLeftHouseholderInternal { } /// compute magnitude of chi1, equal to norm2 of chi1 - const mag_type norm_chi1 = Kokkos::ArithTraits::abs(*chi1); + const mag_type norm_chi1 = KokkosKernels::ArithTraits::abs(*chi1); /// compute 2 norm of x using norm_chi1 and norm_x2 - const mag_type norm_x = Kokkos::ArithTraits::sqrt(norm_x2_square + norm_chi1 * norm_chi1); + const mag_type norm_x = KokkosKernels::ArithTraits::sqrt(norm_x2_square + norm_chi1 * norm_chi1); /// compute alpha const mag_type alpha = (*chi1 < 0 ? one : minus_one) * norm_x; diff --git a/batched/dense/impl/KokkosBatched_Iamax_Serial_Internal.hpp b/batched/dense/impl/KokkosBatched_Iamax_Serial_Internal.hpp index 89aed299ae..095328fe28 100644 --- a/batched/dense/impl/KokkosBatched_Iamax_Serial_Internal.hpp +++ b/batched/dense/impl/KokkosBatched_Iamax_Serial_Internal.hpp @@ -37,7 +37,7 @@ struct SerialIamaxInternal { template KOKKOS_INLINE_FUNCTION IndexType SerialIamaxInternal::invoke(const int n, const ValueType *KOKKOS_RESTRICT x, const int xs0) { - using ats = typename Kokkos::ArithTraits; + using ats = typename KokkosKernels::ArithTraits; using RealType = typename ats::mag_type; RealType amax = Kokkos::abs(x[0 * xs0]); diff --git a/batched/dense/impl/KokkosBatched_LU_Serial_Internal.hpp b/batched/dense/impl/KokkosBatched_LU_Serial_Internal.hpp index 4b7166f0b9..2b8804ac23 100644 --- a/batched/dense/impl/KokkosBatched_LU_Serial_Internal.hpp +++ b/batched/dense/impl/KokkosBatched_LU_Serial_Internal.hpp @@ -59,7 +59,7 @@ KOKKOS_INLINE_FUNCTION int SerialLU_Internal::invoke( if (tiny != 0) { ValueType &alpha11_reference = A[p * as0 + p * as1]; - const auto alpha11_real = Kokkos::ArithTraits::real(alpha11_reference); + const auto alpha11_real = KokkosKernels::ArithTraits::real(alpha11_reference); alpha11_reference += minus_abs_tiny * ValueType(alpha11_real < 0); alpha11_reference += abs_tiny * ValueType(alpha11_real >= 0); } diff --git a/batched/dense/impl/KokkosBatched_LU_Team_Internal.hpp b/batched/dense/impl/KokkosBatched_LU_Team_Internal.hpp index 1624ddcb8e..0040739eb7 100644 --- a/batched/dense/impl/KokkosBatched_LU_Team_Internal.hpp +++ b/batched/dense/impl/KokkosBatched_LU_Team_Internal.hpp @@ -65,7 +65,7 @@ KOKKOS_INLINE_FUNCTION int TeamLU_Internal::invoke( if (tiny != 0) { if (member.team_rank() == 0) { ValueType &alpha11_reference = A[p * as0 + p * as1]; - const auto alpha11_real = Kokkos::ArithTraits::real(alpha11_reference); + const auto alpha11_real = KokkosKernels::ArithTraits::real(alpha11_reference); alpha11_reference += minus_abs_tiny * ValueType(alpha11_real < 0); alpha11_reference += abs_tiny * ValueType(alpha11_real >= 0); } diff --git a/batched/dense/impl/KokkosBatched_LeftEigenvectorFromSchur_Serial_Internal.hpp b/batched/dense/impl/KokkosBatched_LeftEigenvectorFromSchur_Serial_Internal.hpp index 159317d438..a25617b5f3 100644 --- a/batched/dense/impl/KokkosBatched_LeftEigenvectorFromSchur_Serial_Internal.hpp +++ b/batched/dense/impl/KokkosBatched_LeftEigenvectorFromSchur_Serial_Internal.hpp @@ -49,7 +49,7 @@ struct SerialLeftEigenvectorFromSchurInternal { /* */ ValueType *V, const int vs0, const int vs1, /* */ ValueType *w, const int *blks) { typedef ValueType value_type; - typedef Kokkos::ArithTraits ats; + typedef KokkosKernels::ArithTraits ats; // typedef typename ats::mag_type mag_type; typedef Kokkos::complex complex_type; diff --git a/batched/dense/impl/KokkosBatched_Normalize_Internal.hpp b/batched/dense/impl/KokkosBatched_Normalize_Internal.hpp index e1e19c0194..f9d82a876e 100644 --- a/batched/dense/impl/KokkosBatched_Normalize_Internal.hpp +++ b/batched/dense/impl/KokkosBatched_Normalize_Internal.hpp @@ -30,7 +30,7 @@ struct SerialNormalizeInternal { KOKKOS_INLINE_FUNCTION static int invoke(const int m, /* */ ValueType *KOKKOS_RESTRICT v, const int vs) { typedef ValueType value_type; - typedef Kokkos::ArithTraits ats; + typedef KokkosKernels::ArithTraits ats; typedef typename ats::mag_type mag_type; mag_type norm(0); @@ -41,7 +41,7 @@ struct SerialNormalizeInternal { const auto v_at_i = v[i * vs]; norm += ats::real(v_at_i * ats::conj(v_at_i)); } - norm = Kokkos::ArithTraits::sqrt(norm); + norm = KokkosKernels::ArithTraits::sqrt(norm); #if defined(KOKKOS_ENABLE_PRAGMA_UNROLL) #pragma unroll #endif @@ -55,7 +55,7 @@ struct SerialNormalizeInternal { /* */ RealType *KOKKOS_RESTRICT vr, const int vrs, /* */ RealType *KOKKOS_RESTRICT vi, const int vis) { typedef RealType real_type; - typedef Kokkos::ArithTraits ats; + typedef KokkosKernels::ArithTraits ats; typedef typename ats::mag_type mag_type; mag_type norm(0); @@ -67,7 +67,7 @@ struct SerialNormalizeInternal { const auto vi_at_i = vi[i * vis]; norm += vr_at_i * vr_at_i + vi_at_i * vi_at_i; } - norm = Kokkos::ArithTraits::sqrt(norm); + norm = KokkosKernels::ArithTraits::sqrt(norm); #if defined(KOKKOS_ENABLE_PRAGMA_UNROLL) #pragma unroll #endif diff --git a/batched/dense/impl/KokkosBatched_Pbtrf_Serial_Internal.hpp b/batched/dense/impl/KokkosBatched_Pbtrf_Serial_Internal.hpp index ecea0a50e1..1be2ad636d 100644 --- a/batched/dense/impl/KokkosBatched_Pbtrf_Serial_Internal.hpp +++ b/batched/dense/impl/KokkosBatched_Pbtrf_Serial_Internal.hpp @@ -49,7 +49,7 @@ KOKKOS_INLINE_FUNCTION int SerialPbtrfInternalLower::inv const int kd) { // Compute the Cholesky factorization A = L*L'. for (int j = 0; j < an; ++j) { - auto a_jj = Kokkos::ArithTraits::real(AB[0 * as0 + j * as1]); + auto a_jj = KokkosKernels::ArithTraits::real(AB[0 * as0 + j * as1]); // Check if L (j, j) is positive definite #if (KOKKOSKERNELS_DEBUG_LEVEL > 0) @@ -70,9 +70,9 @@ KOKKOS_INLINE_FUNCTION int SerialPbtrfInternalLower::inv KokkosBlas::Impl::SerialScaleInternal::invoke(kn, alpha, &(AB[1 * as0 + j * as1]), 1); // syr or zher (lower) with alpha = -1.0 to diagonal elements - using op = std::conditional_t::is_complex, KokkosBlas::Impl::OpConj, + using op = std::conditional_t::is_complex, KokkosBlas::Impl::OpConj, KokkosBlas::Impl::OpID>; - using op_sym = std::conditional_t::is_complex, KokkosBlas::Impl::OpReal, + using op_sym = std::conditional_t::is_complex, KokkosBlas::Impl::OpReal, KokkosBlas::Impl::OpID>; SerialSyrInternalLower::invoke(op(), op_sym(), kn, -1.0, &(AB[1 * as0 + j * as1]), as0, &(AB[0 * as0 + (j + 1) * as1]), as0, (as1 - as0)); @@ -102,7 +102,7 @@ KOKKOS_INLINE_FUNCTION int SerialPbtrfInternalUpper::inv const int kd) { // Compute the Cholesky factorization A = U'*U. for (int j = 0; j < an; ++j) { - auto a_jj = Kokkos::ArithTraits::real(AB[kd * as0 + j * as1]); + auto a_jj = KokkosKernels::ArithTraits::real(AB[kd * as0 + j * as1]); // Check if U (j,j) is positive definite #if (KOKKOSKERNELS_DEBUG_LEVEL > 0) @@ -126,9 +126,9 @@ KOKKOS_INLINE_FUNCTION int SerialPbtrfInternalUpper::inv SerialLacgvInternal::invoke(kn, &(AB[(kd - 1) * as0 + (j + 1) * as1]), (as0 - as1)); // syr or zher (upper) with alpha = -1.0 to diagonal elements - using op = std::conditional_t::is_complex, KokkosBlas::Impl::OpConj, + using op = std::conditional_t::is_complex, KokkosBlas::Impl::OpConj, KokkosBlas::Impl::OpID>; - using op_sym = std::conditional_t::is_complex, KokkosBlas::Impl::OpReal, + using op_sym = std::conditional_t::is_complex, KokkosBlas::Impl::OpReal, KokkosBlas::Impl::OpID>; SerialSyrInternalUpper::invoke(op(), op_sym(), kn, -1.0, &(AB[(kd - 1) * as0 + (j + 1) * as1]), as0, &(AB[kd * as0 + (j + 1) * as1]), as0, (as1 - as0)); diff --git a/batched/dense/impl/KokkosBatched_Pbtrs_Serial_Internal.hpp b/batched/dense/impl/KokkosBatched_Pbtrs_Serial_Internal.hpp index 2a0e00947c..a6b581f21c 100644 --- a/batched/dense/impl/KokkosBatched_Pbtrs_Serial_Internal.hpp +++ b/batched/dense/impl/KokkosBatched_Pbtrs_Serial_Internal.hpp @@ -52,7 +52,7 @@ KOKKOS_INLINE_FUNCTION int SerialPbtrsInternalLower::inv // Solve L**T *X = B, overwriting B with X. using op = - std::conditional_t::is_complex, KokkosBlas::Impl::OpConj, KokkosBlas::Impl::OpID>; + std::conditional_t::is_complex, KokkosBlas::Impl::OpConj, KokkosBlas::Impl::OpID>; SerialTbsvInternalLowerTranspose::invoke(op(), false, an, A, as0, as1, x, xs0, kd); return 0; @@ -79,7 +79,7 @@ KOKKOS_INLINE_FUNCTION int SerialPbtrsInternalUpper::inv const int xs0, const int kd) { // Solve U**T *X = B, overwriting B with X. using op = - std::conditional_t::is_complex, KokkosBlas::Impl::OpConj, KokkosBlas::Impl::OpID>; + std::conditional_t::is_complex, KokkosBlas::Impl::OpConj, KokkosBlas::Impl::OpID>; SerialTbsvInternalUpperTranspose::invoke(op(), false, an, A, as0, as1, x, xs0, kd); // Solve U*X = B, overwriting B with X. diff --git a/batched/dense/impl/KokkosBatched_Pttrf_Serial_Impl.hpp b/batched/dense/impl/KokkosBatched_Pttrf_Serial_Impl.hpp index db4a71f97b..01d278f0aa 100644 --- a/batched/dense/impl/KokkosBatched_Pttrf_Serial_Impl.hpp +++ b/batched/dense/impl/KokkosBatched_Pttrf_Serial_Impl.hpp @@ -56,7 +56,7 @@ struct SerialPttrf { using ScalarType = typename DViewType::non_const_value_type; // Quick return if possible if (d.extent(0) == 0) return 0; - if (d.extent(0) == 1) return (d(0) < Kokkos::ArithTraits::zero() ? 1 : 0); + if (d.extent(0) == 1) return (d(0) < KokkosKernels::ArithTraits::zero() ? 1 : 0); auto info = Impl::checkPttrfInput(d, e); if (info) return info; diff --git a/batched/dense/impl/KokkosBatched_Pttrf_Serial_Internal.hpp b/batched/dense/impl/KokkosBatched_Pttrf_Serial_Internal.hpp index b0e36d25de..4afd4628c2 100644 --- a/batched/dense/impl/KokkosBatched_Pttrf_Serial_Internal.hpp +++ b/batched/dense/impl/KokkosBatched_Pttrf_Serial_Internal.hpp @@ -50,7 +50,7 @@ KOKKOS_INLINE_FUNCTION int SerialPttrfInternal::invoke( }; auto check_positive_definitiveness = [&](const int i) { - return (d[i] <= Kokkos::ArithTraits::zero()) ? (i + 1) : 0; + return (d[i] <= KokkosKernels::ArithTraits::zero()) ? (i + 1) : 0; }; // Compute the L*D*L' (or U'*D*U) factorization of A. @@ -123,7 +123,7 @@ KOKKOS_INLINE_FUNCTION int SerialPttrfInternal::invoke( }; auto check_positive_definitiveness = [&](const int i) { - return (d[i] <= Kokkos::ArithTraits::zero()) ? (i + 1) : 0; + return (d[i] <= KokkosKernels::ArithTraits::zero()) ? (i + 1) : 0; }; // Compute the L*D*L' (or U'*D*U) factorization of A. diff --git a/batched/dense/impl/KokkosBatched_Pttrs_Serial_Internal.hpp b/batched/dense/impl/KokkosBatched_Pttrs_Serial_Internal.hpp index e5fb28ff6c..ba25571c91 100644 --- a/batched/dense/impl/KokkosBatched_Pttrs_Serial_Internal.hpp +++ b/batched/dense/impl/KokkosBatched_Pttrs_Serial_Internal.hpp @@ -36,7 +36,7 @@ KOKKOS_INLINE_FUNCTION int SerialPttrsInternal::invoke( const int n, const RealType *KOKKOS_RESTRICT d, const int ds0, const ValueType *KOKKOS_RESTRICT e, const int es0, ValueType *KOKKOS_RESTRICT b, const int bs0) { using MayBeOpConj = - std::conditional_t::is_complex, KokkosBlas::Impl::OpConj, KokkosBlas::Impl::OpID>; + std::conditional_t::is_complex, KokkosBlas::Impl::OpConj, KokkosBlas::Impl::OpID>; using OpUpper = std::conditional_t, MayBeOpConj, KokkosBlas::Impl::OpID>; using OpLower = std::conditional_t, MayBeOpConj, KokkosBlas::Impl::OpID>; diff --git a/batched/dense/impl/KokkosBatched_QR_WithColumnPivoting_TeamVector_Internal.hpp b/batched/dense/impl/KokkosBatched_QR_WithColumnPivoting_TeamVector_Internal.hpp index 89e68e1757..818112a3ac 100644 --- a/batched/dense/impl/KokkosBatched_QR_WithColumnPivoting_TeamVector_Internal.hpp +++ b/batched/dense/impl/KokkosBatched_QR_WithColumnPivoting_TeamVector_Internal.hpp @@ -40,7 +40,7 @@ struct TeamVectorUpdateColumnNormsInternal { KOKKOS_INLINE_FUNCTION static int invoke(const MemberType &member, const int n, const ValueType *KOKKOS_RESTRICT a, const int as0, /* */ ValueType *KOKKOS_RESTRICT norm, const int ns0) { - using ats = Kokkos::ArithTraits; + using ats = KokkosKernels::ArithTraits; Kokkos::parallel_for(Kokkos::TeamVectorRange(member, n), [&](const int &j) { const int idx_a = j * as0, idx_n = j * ns0; norm[idx_n] -= ats::conj(a[idx_a]) * a[idx_a]; @@ -61,7 +61,7 @@ struct TeamVectorQR_WithColumnPivotingInternal { /* */ int &matrix_rank) { using value_type = ValueType; using int_type = IntType; - using ats = Kokkos::ArithTraits; + using ats = KokkosKernels::ArithTraits; /// Given a matrix A, it computes QR decomposition of the matrix /// - t is to store tau and w is for workspace diff --git a/batched/dense/impl/KokkosBatched_RightEigenvectorFromSchur_Serial_Internal.hpp b/batched/dense/impl/KokkosBatched_RightEigenvectorFromSchur_Serial_Internal.hpp index a5c2a2074e..3d61c4da82 100644 --- a/batched/dense/impl/KokkosBatched_RightEigenvectorFromSchur_Serial_Internal.hpp +++ b/batched/dense/impl/KokkosBatched_RightEigenvectorFromSchur_Serial_Internal.hpp @@ -49,7 +49,7 @@ struct SerialRightEigenvectorFromSchurInternal { /* */ ValueType *V, const int vs0, const int vs1, /* */ ValueType *w, const int *blks) { typedef ValueType value_type; - typedef Kokkos::ArithTraits ats; + typedef KokkosKernels::ArithTraits ats; // typedef typename ats::mag_type mag_type; typedef Kokkos::complex complex_type; diff --git a/batched/dense/impl/KokkosBatched_SVD_Serial_Internal.hpp b/batched/dense/impl/KokkosBatched_SVD_Serial_Internal.hpp index ab154da97f..f4a5edd218 100644 --- a/batched/dense/impl/KokkosBatched_SVD_Serial_Internal.hpp +++ b/batched/dense/impl/KokkosBatched_SVD_Serial_Internal.hpp @@ -51,10 +51,10 @@ struct SerialSVDInternal { template KOKKOS_INLINE_FUNCTION static void symEigen2x2(value_type a11, value_type a21, value_type a22, value_type& e1, value_type& e2) { - value_type a = Kokkos::ArithTraits::one(); + value_type a = KokkosKernels::ArithTraits::one(); value_type b = -a11 - a22; value_type c = a11 * a22 - a21 * a21; - value_type sqrtDet = Kokkos::sqrt(Kokkos::max(Kokkos::ArithTraits::zero(), b * b - 4 * a * c)); + value_type sqrtDet = Kokkos::sqrt(Kokkos::max(KokkosKernels::ArithTraits::zero(), b * b - 4 * a * c)); e1 = (-b + sqrtDet) / (2 * a); e2 = (-b - sqrtDet) / (2 * a); } @@ -67,7 +67,7 @@ struct SerialSVDInternal { template KOKKOS_INLINE_FUNCTION static void svdStep(value_type* B, value_type* U, value_type* Vt, int um, int vn, int n, int Bs0, int Bs1, int Us0, int Us1, int Vts0, int Vts1) { - using KAT = Kokkos::ArithTraits; + using KAT = KokkosKernels::ArithTraits; // Compute the eigenvalues of trailing 2x2 value_type dn = SVDIND(B, n - 1, n - 1); value_type dm = SVDIND(B, n - 2, n - 2); @@ -129,7 +129,7 @@ struct SerialSVDInternal { for (int j = i + 1; j < n; j++) { // Zero out B(i, j) against diagonal j, introducing nonzero in B(i, j + 1) KokkosBatched::SerialGivensInternal::invoke(SVDIND(B, j, j), SVDIND(B, i, j), &G, &SVDIND(B, j, j)); - SVDIND(B, i, j) = Kokkos::ArithTraits::zero(); + SVDIND(B, i, j) = KokkosKernels::ArithTraits::zero(); // Now, only need to apply givens to a single column (if not already at // the end), introducing the next nonzero if (j < n - 1) { @@ -151,7 +151,7 @@ struct SerialSVDInternal { for (int j = n - 2; j >= 0; j--) { KokkosBatched::SerialGivensInternal::invoke(SVDIND(B, j, j), SVDIND(B, j, n - 1), &G, &SVDIND(B, j, j)); - SVDIND(B, j, n - 1) = Kokkos::ArithTraits::zero(); + SVDIND(B, j, n - 1) = KokkosKernels::ArithTraits::zero(); if (j != 0) { KokkosBatched::SerialApplyRightGivensInternal::invoke(G, 1, &SVDIND(B, j - 1, n - 1), Bs0, &SVDIND(B, j - 1, j), Bs0); @@ -167,7 +167,7 @@ struct SerialSVDInternal { KOKKOS_INLINE_FUNCTION static void bidiagonalize(int m, int n, value_type* A, int As0, int As1, value_type* U, int Us0, int Us1, value_type* Vt, int Vts0, int Vts1, value_type* work) { - using KAT = Kokkos::ArithTraits; + using KAT = KokkosKernels::ArithTraits; value_type tau; for (int i = 0; i < n; i++) { // Eliminating column i of A below the diagonal @@ -215,8 +215,8 @@ struct SerialSVDInternal { KOKKOS_INLINE_FUNCTION static int bidiSVD(int m, int n, value_type* B, int Bs0, int Bs1, value_type* U, int Us0, int Us1, value_type* Vt, int Vts0, int Vts1, value_type* sigma, int ss, const value_type& tol, int max_iters) { - using KAT = Kokkos::ArithTraits; - const value_type eps = Kokkos::ArithTraits::epsilon(); + using KAT = KokkosKernels::ArithTraits; + const value_type eps = KokkosKernels::ArithTraits::epsilon(); int p = 0; int q = 0; for (int iters = 0; iters < max_iters; ++iters) { @@ -328,7 +328,7 @@ struct SerialSVDInternal { template KOKKOS_INLINE_FUNCTION static int invoke(int m, int n, value_type* A, int As0, int As1, value_type* U, int Us0, int Us1, value_type* Vt, int Vts0, int Vts1, value_type* sigma, int ss, - value_type* work, value_type tol = Kokkos::ArithTraits::zero(), + value_type* work, value_type tol = KokkosKernels::ArithTraits::zero(), int max_iters = 1000000000) { // First, if m < n, need to instead compute (V, s, U^T) = A^T. // This just means swapping U & Vt, and implicitly transposing A, U and Vt. diff --git a/batched/dense/impl/KokkosBatched_Schur2x2_Serial_Internal.hpp b/batched/dense/impl/KokkosBatched_Schur2x2_Serial_Internal.hpp index 369153c3c5..c0aaf8bf4b 100644 --- a/batched/dense/impl/KokkosBatched_Schur2x2_Serial_Internal.hpp +++ b/batched/dense/impl/KokkosBatched_Schur2x2_Serial_Internal.hpp @@ -34,7 +34,7 @@ struct SerialSchur2x2Internal { Kokkos::pair* G, Kokkos::complex* lambda1, Kokkos::complex* lambda2, bool* is_complex) { typedef RealType real_type; - typedef Kokkos::ArithTraits ats; + typedef KokkosKernels::ArithTraits ats; const real_type zero(0), one(1), half(0.5), minus_one(-1); /// compute G = [ gamma -sigma; /// sigma gamma ]; diff --git a/batched/dense/impl/KokkosBatched_Schur_Serial_Internal.hpp b/batched/dense/impl/KokkosBatched_Schur_Serial_Internal.hpp index c619d5da26..de3c648e65 100644 --- a/batched/dense/impl/KokkosBatched_Schur_Serial_Internal.hpp +++ b/batched/dense/impl/KokkosBatched_Schur_Serial_Internal.hpp @@ -73,7 +73,7 @@ struct SerialSchurInternal { /* */ RealType *w, const int wlen, const bool restart = false, const int user_max_iteration = -1) { typedef RealType real_type; - typedef Kokkos::ArithTraits ats; + typedef KokkosKernels::ArithTraits ats; const real_type /* one(1), */ zero(0), tol = 1e2 * ats::epsilon(); const int max_iteration = user_max_iteration < 0 ? 300 : user_max_iteration; if (wlen < m * 5) Kokkos::abort("Error: provided workspace is smaller than 3*m"); diff --git a/batched/dense/impl/KokkosBatched_Trmm_Serial_Internal.hpp b/batched/dense/impl/KokkosBatched_Trmm_Serial_Internal.hpp index 58b334f405..4c1dd0c2c4 100644 --- a/batched/dense/impl/KokkosBatched_Trmm_Serial_Internal.hpp +++ b/batched/dense/impl/KokkosBatched_Trmm_Serial_Internal.hpp @@ -71,7 +71,7 @@ KOKKOS_INLINE_FUNCTION int SerialTrmmInternalLeftLower::i const ScalarType alpha, const ValueType *KOKKOS_RESTRICT A, const int as0, const int as1, /**/ ValueType *KOKKOS_RESTRICT B, const int bs0, const int bs1) { const ScalarType one(1.0), zero(0.0); - typedef Kokkos::ArithTraits AT; + typedef KokkosKernels::ArithTraits AT; int left_m = am; int right_n = bn; // echo-TODO: See about coniditionally setting conjOp at compile time. @@ -146,7 +146,7 @@ KOKKOS_INLINE_FUNCTION int SerialTrmmInternalRightLower:: const ScalarType alpha, const ValueType *KOKKOS_RESTRICT A, const int as0, const int as1, /**/ ValueType *KOKKOS_RESTRICT B, const int bs0, const int bs1) { const ScalarType one(1.0), zero(0.0); - typedef Kokkos::ArithTraits AT; + typedef KokkosKernels::ArithTraits AT; int left_m = bm; int right_n = an; // echo-TODO: See about coniditionally setting conjOp at compile time. @@ -221,7 +221,7 @@ KOKKOS_INLINE_FUNCTION int SerialTrmmInternalLeftUpper::i const ScalarType alpha, const ValueType *KOKKOS_RESTRICT A, const int as0, const int as1, /**/ ValueType *KOKKOS_RESTRICT B, const int bs0, const int bs1) { const ScalarType one(1.0), zero(0.0); - typedef Kokkos::ArithTraits AT; + typedef KokkosKernels::ArithTraits AT; int left_m = am; int right_n = bn; // echo-TODO: See about coniditionally setting conjOp at compile time. @@ -293,7 +293,7 @@ KOKKOS_INLINE_FUNCTION int SerialTrmmInternalRightUpper:: const ScalarType alpha, const ValueType *KOKKOS_RESTRICT A, const int as0, const int as1, /**/ ValueType *KOKKOS_RESTRICT B, const int bs0, const int bs1) { const ScalarType one(1.0), zero(0.0); - typedef Kokkos::ArithTraits AT; + typedef KokkosKernels::ArithTraits AT; int left_m = bm; int right_n = an; // echo-TODO: See about coniditionally setting conjOp at compile time. diff --git a/batched/dense/impl/KokkosBatched_Trsm_Serial_Internal.hpp b/batched/dense/impl/KokkosBatched_Trsm_Serial_Internal.hpp index 621d89db44..cf400384c5 100644 --- a/batched/dense/impl/KokkosBatched_Trsm_Serial_Internal.hpp +++ b/batched/dense/impl/KokkosBatched_Trsm_Serial_Internal.hpp @@ -64,7 +64,7 @@ KOKKOS_INLINE_FUNCTION int SerialTrsmInternalLeftLower::i if (!use_unit_diag) { const ValueType alpha11 = - (do_conj ? Kokkos::ArithTraits::conj(A[p * as0 + p * as1]) : A[p * as0 + p * as1]); + (do_conj ? KokkosKernels::ArithTraits::conj(A[p * as0 + p * as1]) : A[p * as0 + p * as1]); #if defined(KOKKOS_ENABLE_PRAGMA_UNROLL) #pragma unroll @@ -78,7 +78,7 @@ KOKKOS_INLINE_FUNCTION int SerialTrsmInternalLeftLower::i #pragma unroll #endif for (int j = 0; j < jend; ++j) - B2[i * bs0 + j * bs1] -= (do_conj ? Kokkos::ArithTraits::conj(a21[i * as0]) * b1t[j * bs1] + B2[i * bs0 + j * bs1] -= (do_conj ? KokkosKernels::ArithTraits::conj(a21[i * as0]) * b1t[j * bs1] : a21[i * as0] * b1t[j * bs1]); } } @@ -170,7 +170,7 @@ KOKKOS_INLINE_FUNCTION int SerialTrsmInternalLeftUpper::i if (!use_unit_diag) { const ValueType alpha11 = - (do_conj ? Kokkos::ArithTraits::conj(A[p * as0 + p * as1]) : A[p * as0 + p * as1]); + (do_conj ? KokkosKernels::ArithTraits::conj(A[p * as0 + p * as1]) : A[p * as0 + p * as1]); #if defined(KOKKOS_ENABLE_PRAGMA_UNROLL) #pragma unroll @@ -186,7 +186,7 @@ KOKKOS_INLINE_FUNCTION int SerialTrsmInternalLeftUpper::i #pragma unroll #endif for (int j = 0; j < jend; ++j) - B0[i * bs0 + j * bs1] -= (do_conj ? Kokkos::ArithTraits::conj(a01[i * as0]) * b1t[j * bs1] + B0[i * bs0 + j * bs1] -= (do_conj ? KokkosKernels::ArithTraits::conj(a01[i * as0]) * b1t[j * bs1] : a01[i * as0] * b1t[j * bs1]); } } diff --git a/batched/dense/impl/KokkosBatched_Trsv_Serial_Internal.hpp b/batched/dense/impl/KokkosBatched_Trsv_Serial_Internal.hpp index dbee534626..15899235f9 100644 --- a/batched/dense/impl/KokkosBatched_Trsv_Serial_Internal.hpp +++ b/batched/dense/impl/KokkosBatched_Trsv_Serial_Internal.hpp @@ -71,12 +71,12 @@ KOKKOS_INLINE_FUNCTION int SerialTrsvInternalLower::invok // accessed by others op(/=) uses this pointer and changes the associated // values, which brings a compiler problem if (!use_unit_diag) - *beta1 = (do_conj ? *beta1 / Kokkos::ArithTraits::conj(A[p * as0 + p * as1]) + *beta1 = (do_conj ? *beta1 / KokkosKernels::ArithTraits::conj(A[p * as0 + p * as1]) : *beta1 / A[p * as0 + p * as1]); for (int i = 0; i < iend; ++i) b2[i * bs0] -= - (do_conj ? Kokkos::ArithTraits::conj(a21[i * as0]) * (*beta1) : a21[i * as0] * (*beta1)); + (do_conj ? KokkosKernels::ArithTraits::conj(a21[i * as0]) * (*beta1) : a21[i * as0] * (*beta1)); } } return 0; @@ -161,12 +161,12 @@ KOKKOS_INLINE_FUNCTION int SerialTrsvInternalUpper::invok // accessed by others op(/=) uses this pointer and changes the associated // values, which brings a compiler problem if (!use_unit_diag) - *beta1 = (do_conj ? *beta1 / Kokkos::ArithTraits::conj(A[p * as0 + p * as1]) + *beta1 = (do_conj ? *beta1 / KokkosKernels::ArithTraits::conj(A[p * as0 + p * as1]) : *beta1 / A[p * as0 + p * as1]); for (int i = 0; i < iend; ++i) b0[i * bs0] -= - (do_conj ? Kokkos::ArithTraits::conj(a01[i * as0]) * (*beta1) : a01[i * as0] * (*beta1)); + (do_conj ? KokkosKernels::ArithTraits::conj(a01[i * as0]) * (*beta1) : a01[i * as0] * (*beta1)); } } return 0; diff --git a/batched/dense/impl/KokkosBatched_Vector_SIMD_Arith.hpp b/batched/dense/impl/KokkosBatched_Vector_SIMD_Arith.hpp index d02b976dca..95f6a3d3d7 100644 --- a/batched/dense/impl/KokkosBatched_Vector_SIMD_Arith.hpp +++ b/batched/dense/impl/KokkosBatched_Vector_SIMD_Arith.hpp @@ -146,14 +146,14 @@ KOKKOS_FORCEINLINE_FUNCTION static KOKKOSKERNELS_SIMD_ARITH_RETURN_REFERENCE_TYP template KOKKOS_FORCEINLINE_FUNCTION static KOKKOSKERNELS_SIMD_ARITH_RETURN_TYPE(T, l) operator++(Vector, l> &a, int) { Vector, l> a0 = a; - a = a + typename Kokkos::ArithTraits::mag_type(1); + a = a + typename KokkosKernels::ArithTraits::mag_type(1); return a0; } template KOKKOS_FORCEINLINE_FUNCTION static KOKKOSKERNELS_SIMD_ARITH_RETURN_REFERENCE_TYPE(T, l) operator++( Vector, l> &a) { - a = a + typename Kokkos::ArithTraits::mag_type(1); + a = a + typename KokkosKernels::ArithTraits::mag_type(1); return a; } @@ -333,14 +333,14 @@ KOKKOS_FORCEINLINE_FUNCTION static KOKKOSKERNELS_SIMD_ARITH_RETURN_REFERENCE_TYP template KOKKOS_FORCEINLINE_FUNCTION static KOKKOSKERNELS_SIMD_ARITH_RETURN_TYPE(T, l) operator--(Vector, l> &a, int) { Vector, l> a0 = a; - a = a - typename Kokkos::ArithTraits::mag_type(1); + a = a - typename KokkosKernels::ArithTraits::mag_type(1); return a0; } template KOKKOS_FORCEINLINE_FUNCTION static KOKKOSKERNELS_SIMD_ARITH_RETURN_REFERENCE_TYPE(T, l) operator--( Vector, l> &a) { - a = a - typename Kokkos::ArithTraits::mag_type(1); + a = a - typename KokkosKernels::ArithTraits::mag_type(1); return a; } diff --git a/batched/dense/impl/KokkosBatched_Vector_SIMD_Math.hpp b/batched/dense/impl/KokkosBatched_Vector_SIMD_Math.hpp index eec5c1092f..f19ba95e3b 100644 --- a/batched/dense/impl/KokkosBatched_Vector_SIMD_Math.hpp +++ b/batched/dense/impl/KokkosBatched_Vector_SIMD_Math.hpp @@ -30,7 +30,7 @@ namespace KokkosBatched { template KOKKOS_INLINE_FUNCTION static KOKKOSKERNELS_SIMD_MATH_RETURN_TYPE(T, l) sqrt(const Vector, l> &a) { - typedef Kokkos::ArithTraits ats; + typedef KokkosKernels::ArithTraits ats; Vector, l> r_val; #if defined(KOKKOS_ENABLE_PRAGMA_IVDEP) #pragma ivdep @@ -45,7 +45,7 @@ KOKKOS_INLINE_FUNCTION static KOKKOSKERNELS_SIMD_MATH_RETURN_TYPE(T, l) sqrt(con template KOKKOS_INLINE_FUNCTION static KOKKOSKERNELS_SIMD_MATH_RETURN_TYPE(T, l) cbrt(const Vector, l> &a) { - typedef Kokkos::ArithTraits ats; + typedef KokkosKernels::ArithTraits ats; Vector, l> r_val; #if defined(KOKKOS_ENABLE_PRAGMA_IVDEP) #pragma ivdep @@ -60,7 +60,7 @@ KOKKOS_INLINE_FUNCTION static KOKKOSKERNELS_SIMD_MATH_RETURN_TYPE(T, l) cbrt(con template KOKKOS_INLINE_FUNCTION static KOKKOSKERNELS_SIMD_MATH_RETURN_TYPE(T, l) log(const Vector, l> &a) { - typedef Kokkos::ArithTraits ats; + typedef KokkosKernels::ArithTraits ats; Vector, l> r_val; #if defined(KOKKOS_ENABLE_PRAGMA_IVDEP) #pragma ivdep @@ -75,7 +75,7 @@ KOKKOS_INLINE_FUNCTION static KOKKOSKERNELS_SIMD_MATH_RETURN_TYPE(T, l) log(cons template KOKKOS_INLINE_FUNCTION static KOKKOSKERNELS_SIMD_MATH_RETURN_TYPE(T, l) log10(const Vector, l> &a) { - typedef Kokkos::ArithTraits ats; + typedef KokkosKernels::ArithTraits ats; Vector, l> r_val; #if defined(KOKKOS_ENABLE_PRAGMA_IVDEP) #pragma ivdep @@ -90,7 +90,7 @@ KOKKOS_INLINE_FUNCTION static KOKKOSKERNELS_SIMD_MATH_RETURN_TYPE(T, l) log10(co template KOKKOS_INLINE_FUNCTION static KOKKOSKERNELS_SIMD_MATH_RETURN_TYPE(T, l) exp(const Vector, l> &a) { - typedef Kokkos::ArithTraits ats; + typedef KokkosKernels::ArithTraits ats; Vector, l> r_val; #if defined(KOKKOS_ENABLE_PRAGMA_IVDEP) #pragma ivdep @@ -106,7 +106,7 @@ KOKKOS_INLINE_FUNCTION static KOKKOSKERNELS_SIMD_MATH_RETURN_TYPE(T, l) exp(cons template KOKKOS_INLINE_FUNCTION static KOKKOSKERNELS_SIMD_MATH_RETURN_TYPE(T0, l) pow(const Vector, l> &a, const Vector, l> &b) { - typedef Kokkos::ArithTraits ats; + typedef KokkosKernels::ArithTraits ats; Vector, l> r_val; #if defined(KOKKOS_ENABLE_PRAGMA_IVDEP) #pragma ivdep @@ -133,7 +133,7 @@ KOKKOS_INLINE_FUNCTION static KOKKOSKERNELS_SIMD_MATH_RETURN_TYPE(T0, l) template KOKKOS_INLINE_FUNCTION static KOKKOSKERNELS_SIMD_MATH_RETURN_FLOAT_TYPE(T, l) sin(const Vector, l> &a) { - typedef Kokkos::ArithTraits ats; + typedef KokkosKernels::ArithTraits ats; Vector, l> r_val; #if defined(KOKKOS_ENABLE_PRAGMA_IVDEP) #pragma ivdep @@ -148,7 +148,7 @@ KOKKOS_INLINE_FUNCTION static KOKKOSKERNELS_SIMD_MATH_RETURN_FLOAT_TYPE(T, l) si template KOKKOS_INLINE_FUNCTION static KOKKOSKERNELS_SIMD_MATH_RETURN_FLOAT_TYPE(T, l) cos(const Vector, l> &a) { - typedef Kokkos::ArithTraits ats; + typedef KokkosKernels::ArithTraits ats; Vector, l> r_val; #if defined(KOKKOS_ENABLE_PRAGMA_IVDEP) #pragma ivdep @@ -163,7 +163,7 @@ KOKKOS_INLINE_FUNCTION static KOKKOSKERNELS_SIMD_MATH_RETURN_FLOAT_TYPE(T, l) co template KOKKOS_INLINE_FUNCTION static KOKKOSKERNELS_SIMD_MATH_RETURN_FLOAT_TYPE(T, l) tan(const Vector, l> &a) { - typedef Kokkos::ArithTraits ats; + typedef KokkosKernels::ArithTraits ats; Vector, l> r_val; #if defined(KOKKOS_ENABLE_PRAGMA_IVDEP) #pragma ivdep @@ -178,7 +178,7 @@ KOKKOS_INLINE_FUNCTION static KOKKOSKERNELS_SIMD_MATH_RETURN_FLOAT_TYPE(T, l) ta template KOKKOS_INLINE_FUNCTION static KOKKOSKERNELS_SIMD_MATH_RETURN_FLOAT_TYPE(T, l) sinh(const Vector, l> &a) { - typedef Kokkos::ArithTraits ats; + typedef KokkosKernels::ArithTraits ats; Vector, l> r_val; #if defined(KOKKOS_ENABLE_PRAGMA_IVDEP) #pragma ivdep @@ -193,7 +193,7 @@ KOKKOS_INLINE_FUNCTION static KOKKOSKERNELS_SIMD_MATH_RETURN_FLOAT_TYPE(T, l) si template KOKKOS_INLINE_FUNCTION static KOKKOSKERNELS_SIMD_MATH_RETURN_FLOAT_TYPE(T, l) cosh(const Vector, l> &a) { - typedef Kokkos::ArithTraits ats; + typedef KokkosKernels::ArithTraits ats; Vector, l> r_val; #if defined(KOKKOS_ENABLE_PRAGMA_IVDEP) #pragma ivdep @@ -208,7 +208,7 @@ KOKKOS_INLINE_FUNCTION static KOKKOSKERNELS_SIMD_MATH_RETURN_FLOAT_TYPE(T, l) co template KOKKOS_INLINE_FUNCTION static KOKKOSKERNELS_SIMD_MATH_RETURN_FLOAT_TYPE(T, l) tanh(const Vector, l> &a) { - typedef Kokkos::ArithTraits ats; + typedef KokkosKernels::ArithTraits ats; Vector, l> r_val; #if defined(KOKKOS_ENABLE_PRAGMA_IVDEP) #pragma ivdep @@ -223,7 +223,7 @@ KOKKOS_INLINE_FUNCTION static KOKKOSKERNELS_SIMD_MATH_RETURN_FLOAT_TYPE(T, l) ta template KOKKOS_INLINE_FUNCTION static KOKKOSKERNELS_SIMD_MATH_RETURN_FLOAT_TYPE(T, l) asin(const Vector, l> &a) { - typedef Kokkos::ArithTraits ats; + typedef KokkosKernels::ArithTraits ats; Vector, l> r_val; #if defined(KOKKOS_ENABLE_PRAGMA_IVDEP) #pragma ivdep @@ -238,7 +238,7 @@ KOKKOS_INLINE_FUNCTION static KOKKOSKERNELS_SIMD_MATH_RETURN_FLOAT_TYPE(T, l) as template KOKKOS_INLINE_FUNCTION static KOKKOSKERNELS_SIMD_MATH_RETURN_FLOAT_TYPE(T, l) acos(const Vector, l> &a) { - typedef Kokkos::ArithTraits ats; + typedef KokkosKernels::ArithTraits ats; Vector, l> r_val; #if defined(KOKKOS_ENABLE_PRAGMA_IVDEP) #pragma ivdep @@ -253,7 +253,7 @@ KOKKOS_INLINE_FUNCTION static KOKKOSKERNELS_SIMD_MATH_RETURN_FLOAT_TYPE(T, l) ac template KOKKOS_INLINE_FUNCTION static KOKKOSKERNELS_SIMD_MATH_RETURN_FLOAT_TYPE(T, l) atan(const Vector, l> &a) { - typedef Kokkos::ArithTraits ats; + typedef KokkosKernels::ArithTraits ats; Vector, l> r_val; #if defined(KOKKOS_ENABLE_PRAGMA_IVDEP) #pragma ivdep @@ -269,7 +269,7 @@ KOKKOS_INLINE_FUNCTION static KOKKOSKERNELS_SIMD_MATH_RETURN_FLOAT_TYPE(T, l) at template KOKKOS_INLINE_FUNCTION static KOKKOSKERNELS_SIMD_MATH_RETURN_FLOAT_TYPE(T, l) atan2(const Vector, l> &a, const Vector, l> &b) { - // typedef Kokkos::ArithTraits ats; + // typedef KokkosKernels::ArithTraits ats; Vector, l> r_val; #if defined(KOKKOS_ENABLE_PRAGMA_IVDEP) #pragma ivdep diff --git a/batched/dense/impl/KokkosBatched_WilkinsonShift_Serial_Internal.hpp b/batched/dense/impl/KokkosBatched_WilkinsonShift_Serial_Internal.hpp index 1f726baf53..fca177d900 100644 --- a/batched/dense/impl/KokkosBatched_WilkinsonShift_Serial_Internal.hpp +++ b/batched/dense/impl/KokkosBatched_WilkinsonShift_Serial_Internal.hpp @@ -50,13 +50,13 @@ struct SerialWilkinsonShiftInternal { if (v < 0) { // complex - const value_type sqrt_v = Kokkos::ArithTraits::sqrt(-v); + const value_type sqrt_v = KokkosKernels::ArithTraits::sqrt(-v); *lambda1 = Kokkos::complex(p, sqrt_v); *lambda2 = Kokkos::complex(p, -sqrt_v); *is_complex = true; } else { // real - const value_type sqrt_v = Kokkos::ArithTraits::sqrt(v); + const value_type sqrt_v = KokkosKernels::ArithTraits::sqrt(v); *lambda1 = Kokkos::complex(p + sqrt_v); *lambda2 = Kokkos::complex(p - sqrt_v); *is_complex = false; diff --git a/batched/dense/src/KokkosBatched_SVD_Decl.hpp b/batched/dense/src/KokkosBatched_SVD_Decl.hpp index b58f1f3b66..e4a54a4a4d 100644 --- a/batched/dense/src/KokkosBatched_SVD_Decl.hpp +++ b/batched/dense/src/KokkosBatched_SVD_Decl.hpp @@ -59,14 +59,14 @@ struct SerialSVD { template KOKKOS_INLINE_FUNCTION static int invoke( SVD_USV_Tag, const AViewType &A, const UViewType &U, const SViewType &s, const VtViewType &Vt, const WViewType &W, - typename AViewType::const_value_type tol = Kokkos::ArithTraits::zero(), + typename AViewType::const_value_type tol = KokkosKernels::ArithTraits::zero(), int max_iters = 1000000000); // Version which computes only singular values template KOKKOS_INLINE_FUNCTION static int invoke( SVD_S_Tag, const AViewType &A, const SViewType &s, const WViewType &W, - typename AViewType::const_value_type tol = Kokkos::ArithTraits::zero(), + typename AViewType::const_value_type tol = KokkosKernels::ArithTraits::zero(), int max_iters = 1000000000); }; diff --git a/batched/dense/src/KokkosBatched_Vector.hpp b/batched/dense/src/KokkosBatched_Vector.hpp index 1eafbfc9ad..1fef4488df 100644 --- a/batched/dense/src/KokkosBatched_Vector.hpp +++ b/batched/dense/src/KokkosBatched_Vector.hpp @@ -242,7 +242,7 @@ struct MagnitudeScalarType>, l>> { #include "KokkosBatched_Vector_SIMD.hpp" // arith traits overload for vector types -namespace Kokkos { +namespace KokkosKernels { // do not use Vector alone as other can use the name. diff --git a/batched/dense/src/KokkosBatched_Vector_SIMD.hpp b/batched/dense/src/KokkosBatched_Vector_SIMD.hpp index 75e5e76d94..89e72624b7 100644 --- a/batched/dense/src/KokkosBatched_Vector_SIMD.hpp +++ b/batched/dense/src/KokkosBatched_Vector_SIMD.hpp @@ -36,7 +36,7 @@ class Vector, l> { public: using type = Vector, l>; using value_type = T; - using mag_type = typename Kokkos::ArithTraits::mag_type; + using mag_type = typename KokkosKernels::ArithTraits::mag_type; enum : int { vector_length = l }; diff --git a/batched/dense/unit_test/Test_Batched_BatchedGemm.hpp b/batched/dense/unit_test/Test_Batched_BatchedGemm.hpp index 1f3a0e68ec..7cddf0b143 100644 --- a/batched/dense/unit_test/Test_Batched_BatchedGemm.hpp +++ b/batched/dense/unit_test/Test_Batched_BatchedGemm.hpp @@ -33,7 +33,7 @@ void impl_test_batched_gemm_with_handle(BatchedGemmHandle* batchedGemmHandle, co using transA = typename ParamTagType::transA; using transB = typename ParamTagType::transB; using batchLayout = typename ParamTagType::batchLayout; - using ats = Kokkos::ArithTraits; + using ats = KokkosKernels::ArithTraits; int ret = 0; auto algo_type = batchedGemmHandle->get_kernel_algo_type(); diff --git a/batched/dense/unit_test/Test_Batched_DenseUtils.hpp b/batched/dense/unit_test/Test_Batched_DenseUtils.hpp index f51540cd9e..e1cf74aa28 100644 --- a/batched/dense/unit_test/Test_Batched_DenseUtils.hpp +++ b/batched/dense/unit_test/Test_Batched_DenseUtils.hpp @@ -174,11 +174,11 @@ void random_to_pds(InViewType& in, OutViewType& out) { for (int i2 = i1; i2 < BlkSize; i2++) { if (i1 == i2) { // Diagonal elements must be real - h_out(i0, i1, i2) = Kokkos::ArithTraits::real(h_in(i0, i1, i2)); + h_out(i0, i1, i2) = KokkosKernels::ArithTraits::real(h_in(i0, i1, i2)); } else { // Off-diagonal elements are complex and Hermitian h_out(i0, i1, i2) = h_in(i0, i1, i2); - h_out(i0, i2, i1) = Kokkos::ArithTraits::conj(h_in(i0, i1, i2)); + h_out(i0, i2, i1) = KokkosKernels::ArithTraits::conj(h_in(i0, i1, i2)); } } } @@ -250,7 +250,7 @@ void create_banded_pds_matrix(InViewType& in, OutViewType& out, int k = 1, bool for (int i1 = 0; i1 < BlkSize; i1++) { for (int i2 = i1; i2 < Kokkos::min(i1 + k + 1, BlkSize); i2++) { h_out(i0, i1, i2) = h_in(i0, i1, i2); - h_out(i0, i2, i1) = Kokkos::ArithTraits::conj(h_in(i0, i1, i2)); + h_out(i0, i2, i1) = KokkosKernels::ArithTraits::conj(h_in(i0, i1, i2)); } } } @@ -259,7 +259,7 @@ void create_banded_pds_matrix(InViewType& in, OutViewType& out, int k = 1, bool for (int i1 = 0; i1 < BlkSize; i1++) { for (int i2 = Kokkos::max(0, i1 - k); i2 <= i1; i2++) { h_out(i0, i1, i2) = h_in(i0, i1, i2); - h_out(i0, i2, i1) = Kokkos::ArithTraits::conj(h_in(i0, i1, i2)); + h_out(i0, i2, i1) = KokkosKernels::ArithTraits::conj(h_in(i0, i1, i2)); } } } diff --git a/batched/dense/unit_test/Test_Batched_SerialAxpy.hpp b/batched/dense/unit_test/Test_Batched_SerialAxpy.hpp index df6f0ee069..982e2ff64d 100644 --- a/batched/dense/unit_test/Test_Batched_SerialAxpy.hpp +++ b/batched/dense/unit_test/Test_Batched_SerialAxpy.hpp @@ -65,7 +65,7 @@ void impl_test_batched_axpy(const int N, const int BlkSize) { typedef typename ViewType::value_type value_type; typedef typename ViewType::const_value_type const_value_type; typedef typename alphaViewType::const_value_type alpha_const_value_type; - typedef Kokkos::ArithTraits ats; + typedef KokkosKernels::ArithTraits ats; ViewType X0("x0", N, BlkSize), X1("x1", N, BlkSize), Y0("y0", N, BlkSize), Y1("y1", N, BlkSize); diff --git a/batched/dense/unit_test/Test_Batched_SerialGbtrf.hpp b/batched/dense/unit_test/Test_Batched_SerialGbtrf.hpp index 75a6b1096b..d113e54522 100644 --- a/batched/dense/unit_test/Test_Batched_SerialGbtrf.hpp +++ b/batched/dense/unit_test/Test_Batched_SerialGbtrf.hpp @@ -164,7 +164,7 @@ struct Functor_BatchedSerialGetrf { /// For simplicity, we represent the matrix U in 5x4 form instead of 4x4 template void impl_test_batched_gbtrf_analytical(const int Nb) { - using ats = typename Kokkos::ArithTraits; + using ats = typename KokkosKernels::ArithTraits; using RealType = typename ats::mag_type; using View3DType = Kokkos::View; using PivView2DType = Kokkos::View; @@ -371,7 +371,7 @@ void impl_test_batched_gbtrf_analytical(const int Nb) { /// \param BlkSize [in] Block size of matrix A template void impl_test_batched_gbtrf(const int Nb, const int BlkSize) { - using ats = typename Kokkos::ArithTraits; + using ats = typename KokkosKernels::ArithTraits; using RealType = typename ats::mag_type; using View3DType = Kokkos::View; using PivView2DType = Kokkos::View; diff --git a/batched/dense/unit_test/Test_Batched_SerialGbtrs.hpp b/batched/dense/unit_test/Test_Batched_SerialGbtrs.hpp index a92be9d05d..aefa35595b 100644 --- a/batched/dense/unit_test/Test_Batched_SerialGbtrs.hpp +++ b/batched/dense/unit_test/Test_Batched_SerialGbtrs.hpp @@ -157,7 +157,7 @@ struct Functor_BatchedSerialGemv { /// \param N [in] Batch size of RHS template void impl_test_batched_gbtrs_analytical(const int N) { - using ats = typename Kokkos::ArithTraits; + using ats = typename KokkosKernels::ArithTraits; using RealType = typename ats::mag_type; using View2DType = Kokkos::View; using View3DType = Kokkos::View; @@ -240,7 +240,7 @@ void impl_test_batched_gbtrs_analytical(const int N) { /// \param BlkSize [in] Block size of matrix A template void impl_test_batched_gbtrs(const int N, const int k, const int BlkSize) { - using ats = typename Kokkos::ArithTraits; + using ats = typename KokkosKernels::ArithTraits; using RealType = typename ats::mag_type; using View2DType = Kokkos::View; using View3DType = Kokkos::View; diff --git a/batched/dense/unit_test/Test_Batched_SerialGemm.hpp b/batched/dense/unit_test/Test_Batched_SerialGemm.hpp index 3e43df25d9..8650b14876 100644 --- a/batched/dense/unit_test/Test_Batched_SerialGemm.hpp +++ b/batched/dense/unit_test/Test_Batched_SerialGemm.hpp @@ -85,7 +85,7 @@ void impl_test_batched_gemm(const int N, const int matAdim1, const int matAdim2, using execution_space = typename DeviceType::execution_space; using transA = typename ParamTagType::transA; using transB = typename ParamTagType::transB; - using ats = Kokkos::ArithTraits; + using ats = KokkosKernels::ArithTraits; using ViewType = Kokkos::View; /// randomized input testing views diff --git a/batched/dense/unit_test/Test_Batched_SerialGer.hpp b/batched/dense/unit_test/Test_Batched_SerialGer.hpp index eaddc7c18a..292b461b9d 100644 --- a/batched/dense/unit_test/Test_Batched_SerialGer.hpp +++ b/batched/dense/unit_test/Test_Batched_SerialGer.hpp @@ -105,7 +105,7 @@ struct Functor_BatchedSerialGer { /// \param Nb [in] Batch size of matrices template void impl_test_batched_ger_analytical(const std::size_t Nb) { - using ats = typename Kokkos::ArithTraits; + using ats = typename KokkosKernels::ArithTraits; using RealType = typename ats::mag_type; using View2DType = Kokkos::View; using StridedView2DType = Kokkos::View; @@ -285,7 +285,7 @@ void impl_test_batched_ger_analytical(const std::size_t Nb) { /// \param BlkSize [in] Block size of matrix A template void impl_test_batched_ger(const std::size_t N, const std::size_t BlkSize) { - using ats = typename Kokkos::ArithTraits; + using ats = typename KokkosKernels::ArithTraits; using RealType = typename ats::mag_type; using View2DType = Kokkos::View; using StridedView2DType = Kokkos::View; @@ -354,7 +354,7 @@ void impl_test_batched_ger(const std::size_t N, const std::size_t BlkSize) { for (std::size_t ib = 0; ib < N; ib++) { for (std::size_t j = 0; j < BlkSize; j++) { if (h_y(ib, j) != 0) { - auto temp = is_conj ? alpha * Kokkos::ArithTraits::conj(h_y(ib, j)) : alpha * h_y(ib, j); + auto temp = is_conj ? alpha * KokkosKernels::ArithTraits::conj(h_y(ib, j)) : alpha * h_y(ib, j); for (std::size_t i = 0; i < BlkSize; i++) { h_A_ref(ib, i, j) = h_A_ref(ib, i, j) + h_x(ib, i) * temp; h_A0_ref(ib, i, j) = h_x(ib, i) * temp; diff --git a/batched/dense/unit_test/Test_Batched_SerialGesv.hpp b/batched/dense/unit_test/Test_Batched_SerialGesv.hpp index 8ec0dd8189..055054631e 100644 --- a/batched/dense/unit_test/Test_Batched_SerialGesv.hpp +++ b/batched/dense/unit_test/Test_Batched_SerialGesv.hpp @@ -69,9 +69,9 @@ struct Functor_TestBatchedSerialGesv { template void impl_test_batched_gesv(const int N, const int BlkSize) { typedef typename MatrixType::value_type value_type; - typedef Kokkos::ArithTraits ats; + typedef KokkosKernels::ArithTraits ats; - using MagnitudeType = typename Kokkos::ArithTraits::mag_type; + using MagnitudeType = typename KokkosKernels::ArithTraits::mag_type; using NormViewType = Kokkos::View; NormViewType sqr_norm_j("sqr_norm_j", N); diff --git a/batched/dense/unit_test/Test_Batched_SerialGetrf.hpp b/batched/dense/unit_test/Test_Batched_SerialGetrf.hpp index 24d99594ca..fc011fd186 100644 --- a/batched/dense/unit_test/Test_Batched_SerialGetrf.hpp +++ b/batched/dense/unit_test/Test_Batched_SerialGetrf.hpp @@ -143,7 +143,7 @@ struct Functor_BatchedSerialGemm { /// \param Nb [in] Batch size of matrices template void impl_test_batched_getrf_analytical(const int Nb) { - using ats = typename Kokkos::ArithTraits; + using ats = typename KokkosKernels::ArithTraits; using RealType = typename ats::mag_type; using View3DType = Kokkos::View; using PivView2DType = Kokkos::View; @@ -316,7 +316,7 @@ void impl_test_batched_getrf_analytical(const int Nb) { /// \param BlkSize [in] Block size of matrix A template void impl_test_batched_getrf(const int N, const int BlkSize) { - using ats = typename Kokkos::ArithTraits; + using ats = typename KokkosKernels::ArithTraits; using RealType = typename ats::mag_type; using RealView2DType = Kokkos::View; using View3DType = Kokkos::View; diff --git a/batched/dense/unit_test/Test_Batched_SerialGetrs.hpp b/batched/dense/unit_test/Test_Batched_SerialGetrs.hpp index 9cfef9d8a0..736db35307 100644 --- a/batched/dense/unit_test/Test_Batched_SerialGetrs.hpp +++ b/batched/dense/unit_test/Test_Batched_SerialGetrs.hpp @@ -145,7 +145,7 @@ struct Functor_BatchedSerialGemv { /// \param BlkSize [in] Block size of matrix A template void impl_test_batched_getrs_analytical(const int N) { - using ats = typename Kokkos::ArithTraits; + using ats = typename KokkosKernels::ArithTraits; using RealType = typename ats::mag_type; using View2DType = Kokkos::View; using View3DType = Kokkos::View; @@ -203,7 +203,7 @@ void impl_test_batched_getrs_analytical(const int N) { /// \param BlkSize [in] Block size of matrix A template void impl_test_batched_getrs(const int N, const int BlkSize) { - using ats = typename Kokkos::ArithTraits; + using ats = typename KokkosKernels::ArithTraits; using RealType = typename ats::mag_type; using View2DType = Kokkos::View; using View3DType = Kokkos::View; diff --git a/batched/dense/unit_test/Test_Batched_SerialIamax.hpp b/batched/dense/unit_test/Test_Batched_SerialIamax.hpp index 38e9e78e04..ac0be93ea9 100644 --- a/batched/dense/unit_test/Test_Batched_SerialIamax.hpp +++ b/batched/dense/unit_test/Test_Batched_SerialIamax.hpp @@ -162,7 +162,7 @@ void impl_test_batched_iamax_analytical(const std::size_t N) { /// \param BlkSize [in] Block size of matrix A template void impl_test_batched_iamax(const std::size_t N, const std::size_t BlkSize) { - using ats = typename Kokkos::ArithTraits; + using ats = typename KokkosKernels::ArithTraits; using RealType = typename ats::mag_type; using View2DType = Kokkos::View; using StridedView2DType = Kokkos::View; diff --git a/batched/dense/unit_test/Test_Batched_SerialInverseLU.hpp b/batched/dense/unit_test/Test_Batched_SerialInverseLU.hpp index 915272e47c..fae510c04c 100644 --- a/batched/dense/unit_test/Test_Batched_SerialInverseLU.hpp +++ b/batched/dense/unit_test/Test_Batched_SerialInverseLU.hpp @@ -137,7 +137,7 @@ struct Functor_TestBatchedSerialInverseLU { template void impl_test_batched_inverselu(const int N, const int BlkSize) { typedef typename AViewType::value_type value_type; - typedef Kokkos::ArithTraits ats; + typedef KokkosKernels::ArithTraits ats; /// randomized input testing views AViewType a0("a0", N, BlkSize, BlkSize); diff --git a/batched/dense/unit_test/Test_Batched_SerialLU.hpp b/batched/dense/unit_test/Test_Batched_SerialLU.hpp index c15f793ec4..087c7858f7 100644 --- a/batched/dense/unit_test/Test_Batched_SerialLU.hpp +++ b/batched/dense/unit_test/Test_Batched_SerialLU.hpp @@ -62,7 +62,7 @@ struct Functor_TestBatchedSerialLU { template void impl_test_batched_lu(const int N, const int BlkSize) { typedef typename ViewType::value_type value_type; - typedef Kokkos::ArithTraits ats; + typedef KokkosKernels::ArithTraits ats; /// randomized input testing views ViewType a0("a0", N, BlkSize, BlkSize), a1("a1", N, BlkSize, BlkSize); diff --git a/batched/dense/unit_test/Test_Batched_SerialLacgv.hpp b/batched/dense/unit_test/Test_Batched_SerialLacgv.hpp index 47de7d4023..61a75250c8 100644 --- a/batched/dense/unit_test/Test_Batched_SerialLacgv.hpp +++ b/batched/dense/unit_test/Test_Batched_SerialLacgv.hpp @@ -59,7 +59,7 @@ struct Functor_BatchedSerialLacgv { /// conj(x): [1 - 1j, -3-2j, -2+2j, 0-1j] template void impl_test_batched_lacgv_analytical(const std::size_t Nb) { - using ats = typename Kokkos::ArithTraits; + using ats = typename KokkosKernels::ArithTraits; using RealType = typename ats::mag_type; using View2DType = Kokkos::View; using StridedView2DType = Kokkos::View; @@ -76,7 +76,7 @@ void impl_test_batched_lacgv_analytical(const std::size_t Nb) { auto h_x = Kokkos::create_mirror_view(x); auto h_x_ref = Kokkos::create_mirror_view(x_ref); - constexpr bool is_complex = Kokkos::ArithTraits::is_complex; + constexpr bool is_complex = KokkosKernels::ArithTraits::is_complex; for (std::size_t ib = 0; ib < Nb; ib++) { if constexpr (is_complex) { @@ -139,7 +139,7 @@ void impl_test_batched_lacgv_analytical(const std::size_t Nb) { /// \param BlkSize [in] Length of vector X template void impl_test_batched_lacgv(const std::size_t Nb, const std::size_t BlkSize) { - using ats = typename Kokkos::ArithTraits; + using ats = typename KokkosKernels::ArithTraits; using RealType = typename ats::mag_type; using View2DType = Kokkos::View; using StridedView2DType = Kokkos::View; diff --git a/batched/dense/unit_test/Test_Batched_SerialLaswp.hpp b/batched/dense/unit_test/Test_Batched_SerialLaswp.hpp index c515ad4088..18c076513e 100644 --- a/batched/dense/unit_test/Test_Batched_SerialLaswp.hpp +++ b/batched/dense/unit_test/Test_Batched_SerialLaswp.hpp @@ -101,7 +101,7 @@ struct Functor_BatchedSerialLaswp { /// \param N [in] Batch size of matrices template void impl_test_batched_laswp_analytical(const std::size_t N) { - using ats = typename Kokkos::ArithTraits; + using ats = typename KokkosKernels::ArithTraits; using RealType = typename ats::mag_type; using View2DType = Kokkos::View; using View3DType = Kokkos::View; @@ -333,7 +333,7 @@ void impl_test_batched_laswp_analytical(const std::size_t N) { /// \param BlkSize [in] Length of vector b template void impl_test_batched_laswp_vector(const std::size_t N, const std::size_t BlkSize) { - using ats = typename Kokkos::ArithTraits; + using ats = typename KokkosKernels::ArithTraits; using RealType = typename ats::mag_type; using View2DType = Kokkos::View; using StridedView2DType = Kokkos::View; @@ -448,7 +448,7 @@ void impl_test_batched_laswp_vector(const std::size_t N, const std::size_t BlkSi /// \param BlkSize [in] Row size of matrix A template void impl_test_batched_laswp_matrix(const std::size_t N, const std::size_t BlkSize) { - using ats = typename Kokkos::ArithTraits; + using ats = typename KokkosKernels::ArithTraits; using RealType = typename ats::mag_type; using View3DType = Kokkos::View; using StridedView3DType = Kokkos::View; diff --git a/batched/dense/unit_test/Test_Batched_SerialPbtrf.hpp b/batched/dense/unit_test/Test_Batched_SerialPbtrf.hpp index c683e1e5ac..e530d67c53 100644 --- a/batched/dense/unit_test/Test_Batched_SerialPbtrf.hpp +++ b/batched/dense/unit_test/Test_Batched_SerialPbtrf.hpp @@ -116,7 +116,7 @@ struct Functor_BatchedSerialGemm { /// \param N [in] Batch size of AB template void impl_test_batched_pbtrf_analytical(const int N) { - using ats = typename Kokkos::ArithTraits; + using ats = typename KokkosKernels::ArithTraits; using RealType = typename ats::mag_type; using View3DType = Kokkos::View; @@ -236,7 +236,7 @@ void impl_test_batched_pbtrf(const int N, const int k, const int BlkSize) { } // this eps is about 10^-14 - using ats = typename Kokkos::ArithTraits; + using ats = typename KokkosKernels::ArithTraits; using RealType = typename ats::mag_type; RealType eps = 1.0e3 * ats::epsilon(); diff --git a/batched/dense/unit_test/Test_Batched_SerialPbtrs.hpp b/batched/dense/unit_test/Test_Batched_SerialPbtrs.hpp index 6642a65352..ca5e068648 100644 --- a/batched/dense/unit_test/Test_Batched_SerialPbtrs.hpp +++ b/batched/dense/unit_test/Test_Batched_SerialPbtrs.hpp @@ -145,7 +145,7 @@ struct Functor_BatchedSerialGemv { /// \param BlkSize [in] Block size of matrix A template void impl_test_batched_pbtrs_analytical(const int N) { - using ats = typename Kokkos::ArithTraits; + using ats = typename KokkosKernels::ArithTraits; using RealType = typename ats::mag_type; using View2DType = Kokkos::View; using View3DType = Kokkos::View; @@ -213,7 +213,7 @@ void impl_test_batched_pbtrs_analytical(const int N) { /// \param BlkSize [in] Block size of matrix A template void impl_test_batched_pbtrs(const int N, const int k, const int BlkSize) { - using ats = typename Kokkos::ArithTraits; + using ats = typename KokkosKernels::ArithTraits; using RealType = typename ats::mag_type; using View2DType = Kokkos::View; using View3DType = Kokkos::View; diff --git a/batched/dense/unit_test/Test_Batched_SerialPttrf.hpp b/batched/dense/unit_test/Test_Batched_SerialPttrf.hpp index 6abe3dbb43..3f3abaaad5 100644 --- a/batched/dense/unit_test/Test_Batched_SerialPttrf.hpp +++ b/batched/dense/unit_test/Test_Batched_SerialPttrf.hpp @@ -96,7 +96,7 @@ struct Functor_BatchedSerialGemm { /// \param BlkSize [in] Block size of matrix A template void impl_test_batched_pttrf(const int N, const int BlkSize) { - using ats = typename Kokkos::ArithTraits; + using ats = typename KokkosKernels::ArithTraits; using RealType = typename ats::mag_type; using RealView2DType = Kokkos::View; using View2DType = Kokkos::View; @@ -128,7 +128,7 @@ void impl_test_batched_pttrf(const int N, const int BlkSize) { for (int ib = 0; ib < N; ib++) { for (int i = 0; i < BlkSize - 1; i++) { // Fill the lower diagonal with conjugate of the upper diagonal - h_e_lower(ib, i) = Kokkos::ArithTraits::conj(h_e_upper(ib, i)); + h_e_lower(ib, i) = KokkosKernels::ArithTraits::conj(h_e_upper(ib, i)); } } @@ -209,7 +209,7 @@ void impl_test_batched_pttrf(const int N, const int BlkSize) { /// \param BlkSize [in] Block size of matrix A template void impl_test_batched_pttrf_quick_return(const int N, const int BlkSize) { - using ats = typename Kokkos::ArithTraits; + using ats = typename KokkosKernels::ArithTraits; using RealType = typename ats::mag_type; using RealView2DType = Kokkos::View; using View2DType = Kokkos::View; @@ -276,7 +276,7 @@ void impl_test_batched_pttrf_quick_return(const int N, const int BlkSize) { /// \param N [in] Batch size of matrix A template void impl_test_batched_pttrf_analytical(const int N) { - using ats = typename Kokkos::ArithTraits; + using ats = typename KokkosKernels::ArithTraits; using RealType = typename ats::mag_type; using RealView2DType = Kokkos::View; using View2DType = Kokkos::View; diff --git a/batched/dense/unit_test/Test_Batched_SerialPttrs.hpp b/batched/dense/unit_test/Test_Batched_SerialPttrs.hpp index 8d3dc89d95..4948edc563 100644 --- a/batched/dense/unit_test/Test_Batched_SerialPttrs.hpp +++ b/batched/dense/unit_test/Test_Batched_SerialPttrs.hpp @@ -179,7 +179,7 @@ struct Functor_BatchedSerialGemm { /// \param N [in] Batch size of matrix A and RHS template void impl_test_batched_pttrs_analytical(const int N) { - using ats = typename Kokkos::ArithTraits; + using ats = typename KokkosKernels::ArithTraits; using RealType = typename ats::mag_type; using RealView2DType = Kokkos::View; using View2DType = Kokkos::View; @@ -246,7 +246,7 @@ void impl_test_batched_pttrs_analytical(const int N) { /// \param BlkSize [in] Block size of matrix A template void impl_test_batched_pttrs(const int N, const int BlkSize) { - using ats = typename Kokkos::ArithTraits; + using ats = typename KokkosKernels::ArithTraits; using RealType = typename ats::mag_type; using RealView2DType = Kokkos::View; using View2DType = Kokkos::View; @@ -279,7 +279,7 @@ void impl_test_batched_pttrs(const int N, const int BlkSize) { for (int ib = 0; ib < N; ib++) { for (int i = 0; i < BlkSize - 1; i++) { // Fill the lower diagonal with conjugate of the upper diagonal - h_e_lower(ib, i) = Kokkos::ArithTraits::conj(h_e_upper(ib, i)); + h_e_lower(ib, i) = KokkosKernels::ArithTraits::conj(h_e_upper(ib, i)); } } @@ -359,7 +359,7 @@ void impl_test_batched_pttrs(const int N, const int BlkSize) { /// \param BlkSize [in] Block size of matrix A template void impl_test_batched_pttrs_quick_return(const int N, const int BlkSize) { - using ats = typename Kokkos::ArithTraits; + using ats = typename KokkosKernels::ArithTraits; using RealType = typename ats::mag_type; using RealView2DType = Kokkos::View; using View2DType = Kokkos::View; diff --git a/batched/dense/unit_test/Test_Batched_SerialQR.hpp b/batched/dense/unit_test/Test_Batched_SerialQR.hpp index 91a3bdf172..ecb94cca9d 100644 --- a/batched/dense/unit_test/Test_Batched_SerialQR.hpp +++ b/batched/dense/unit_test/Test_Batched_SerialQR.hpp @@ -54,8 +54,8 @@ struct qrFunctor { auto I = Kokkos::subview(Is, matIdx, Kokkos::ALL, Kokkos::ALL); auto B = Kokkos::subview(Bs, matIdx, Kokkos::ALL, Kokkos::ALL); - const Scalar SC_one = Kokkos::ArithTraits::one(); - const Scalar tol = Kokkos::ArithTraits::eps() * max_rows_cols * max_rows_cols * max_val; + const Scalar SC_one = KokkosKernels::ArithTraits::one(); + const Scalar tol = KokkosKernels::ArithTraits::eps() * max_rows_cols * max_rows_cols * max_val; int error_lcl = 0; @@ -117,7 +117,7 @@ struct qrFunctor { // Store identity in Q for (int rowIdx = 0; rowIdx < Q.extent_int(0); ++rowIdx) { for (int colIdx = 0; colIdx < Q.extent_int(1); ++colIdx) { - Q(rowIdx, colIdx) = (rowIdx == colIdx) ? SC_one : Kokkos::ArithTraits::zero(); + Q(rowIdx, colIdx) = (rowIdx == colIdx) ? SC_one : KokkosKernels::ArithTraits::zero(); } } @@ -174,7 +174,7 @@ void test_QR_square() { using ColVectorViewType = Kokkos::View; using ColWorkViewType = Kokkos::View; - const Scalar tol = 20 * Kokkos::ArithTraits::eps(); + const Scalar tol = 20 * KokkosKernels::ArithTraits::eps(); constexpr int m = 3, n = 3; MatrixViewType A("A", m, n), B("B", m, n), Q("Q", m, m); @@ -310,7 +310,7 @@ void test_QR_rectangular() { using ColVectorViewType = Kokkos::View; using ColWorkViewType = Kokkos::View; - const Scalar tol = 10 * Kokkos::ArithTraits::eps(); + const Scalar tol = 10 * KokkosKernels::ArithTraits::eps(); constexpr int m = 3, n = 2; MatrixViewType A("A", m, n), B("B", m, n), Q("Q", m, m); diff --git a/batched/dense/unit_test/Test_Batched_SerialSVD.hpp b/batched/dense/unit_test/Test_Batched_SerialSVD.hpp index 55190874df..e335ecb630 100644 --- a/batched/dense/unit_test/Test_Batched_SerialSVD.hpp +++ b/batched/dense/unit_test/Test_Batched_SerialSVD.hpp @@ -66,7 +66,7 @@ void verifyOrthogonal(const Mat& X, const double epsilon = -1) { Test::EXPECT_NEAR_KK(len, 1.0, tol); for (int j = 0; j < i; j++) { auto col2 = Kokkos::subview(X, Kokkos::ALL(), j); - double d = Kokkos::ArithTraits::abs(simpleDot(col1, col2)); + double d = KokkosKernels::ArithTraits::abs(simpleDot(col1, col2)); Test::EXPECT_NEAR_KK(d, 0.0, tol); } } @@ -75,7 +75,7 @@ void verifyOrthogonal(const Mat& X, const double epsilon = -1) { template void verifySVD(const AView& A, const UView& U, const VtView& Vt, const SigmaView& sigma, const double epsilon = -1) { using Scalar = typename AView::non_const_value_type; - using KAT = Kokkos::ArithTraits; + using KAT = KokkosKernels::ArithTraits; // Check that U/V columns are unit length and orthogonal // and that: U * diag(sigma) * V^T == A int m = A.extent(0); @@ -112,7 +112,7 @@ struct SerialSVDFunctor_Full { SerialSVDFunctor_Full(const Matrix& A_, const Matrix& U_, const Matrix& Vt_, const Vector& sigma_, const Vector& work_) : A(A_), U(U_), Vt(Vt_), sigma(sigma_), work(work_) { - tol = Kokkos::ArithTraits::zero(); + tol = KokkosKernels::ArithTraits::zero(); } SerialSVDFunctor_Full(const Matrix& A_, const Matrix& U_, const Matrix& Vt_, const Vector& sigma_, @@ -258,7 +258,7 @@ template void testSerialSVDZeroLastRow(int n) { // Generate a bidiagonal matrix using Matrix = Kokkos::View; - using KAT = Kokkos::ArithTraits; + using KAT = KokkosKernels::ArithTraits; Matrix B = randomMatrixWithRank(n, n); // Zero out entries to make B bidiagonal for (int i = 0; i < n; i++) { @@ -306,7 +306,7 @@ template void testSerialSVDZeroDiagonal(int n, int row) { // Generate a bidiagonal matrix using Matrix = Kokkos::View; - using KAT = Kokkos::ArithTraits; + using KAT = KokkosKernels::ArithTraits; int m = n + 2; // Make U somewhat bigger to make sure the Givens transforms // are applied correctly Matrix B = randomMatrixWithRank(m, n); diff --git a/batched/dense/unit_test/Test_Batched_SerialSolveLU.hpp b/batched/dense/unit_test/Test_Batched_SerialSolveLU.hpp index 9eb573e6d2..d8b68521f4 100644 --- a/batched/dense/unit_test/Test_Batched_SerialSolveLU.hpp +++ b/batched/dense/unit_test/Test_Batched_SerialSolveLU.hpp @@ -138,7 +138,7 @@ struct Functor_TestBatchedSerialSolveLU { template void impl_test_batched_solvelu(const int N, const int BlkSize) { typedef typename ViewType::value_type value_type; - typedef Kokkos::ArithTraits ats; + typedef KokkosKernels::ArithTraits ats; /// randomized input testing views ViewType a0("a0", N, BlkSize, BlkSize); diff --git a/batched/dense/unit_test/Test_Batched_SerialSyr.hpp b/batched/dense/unit_test/Test_Batched_SerialSyr.hpp index 9c2cd325cb..e32a4222cc 100644 --- a/batched/dense/unit_test/Test_Batched_SerialSyr.hpp +++ b/batched/dense/unit_test/Test_Batched_SerialSyr.hpp @@ -93,7 +93,7 @@ struct Functor_BatchedSerialSyr { /// \param Nb [in] Batch size of matrices template void impl_test_batched_syr_analytical(const std::size_t Nb) { - using ats = typename Kokkos::ArithTraits; + using ats = typename KokkosKernels::ArithTraits; using RealType = typename ats::mag_type; using View2DType = Kokkos::View; using StridedView2DType = Kokkos::View; @@ -219,7 +219,7 @@ void impl_test_batched_syr_analytical(const std::size_t Nb) { /// \param BlkSize [in] Block size of matrix A template void impl_test_batched_syr(const std::size_t Nb, const std::size_t BlkSize) { - using ats = typename Kokkos::ArithTraits; + using ats = typename KokkosKernels::ArithTraits; using RealType = typename ats::mag_type; using View2DType = Kokkos::View; using StridedView2DType = Kokkos::View; @@ -285,7 +285,7 @@ void impl_test_batched_syr(const std::size_t Nb, const std::size_t BlkSize) { for (std::size_t ib = 0; ib < Nb; ib++) { for (std::size_t j = 0; j < BlkSize; j++) { if (h_x(ib, j) != 0) { - auto temp = is_conj ? alpha * Kokkos::ArithTraits::conj(h_x(ib, j)) : alpha * h_x(ib, j); + auto temp = is_conj ? alpha * KokkosKernels::ArithTraits::conj(h_x(ib, j)) : alpha * h_x(ib, j); if (std::is_same_v) { for (std::size_t i = 0; i < j + 1; i++) { @@ -298,8 +298,8 @@ void impl_test_batched_syr(const std::size_t Nb, const std::size_t BlkSize) { h_A0_ref(ib, i, j) = h_x(ib, i) * temp; } } - h_A_ref(ib, j, j) = is_conj ? Kokkos::ArithTraits::real(h_A_ref(ib, j, j)) : h_A_ref(ib, j, j); - h_A0_ref(ib, j, j) = is_conj ? Kokkos::ArithTraits::real(h_A0_ref(ib, j, j)) : h_A0_ref(ib, j, j); + h_A_ref(ib, j, j) = is_conj ? KokkosKernels::ArithTraits::real(h_A_ref(ib, j, j)) : h_A_ref(ib, j, j); + h_A0_ref(ib, j, j) = is_conj ? KokkosKernels::ArithTraits::real(h_A0_ref(ib, j, j)) : h_A0_ref(ib, j, j); } } } diff --git a/batched/dense/unit_test/Test_Batched_SerialTbsv.hpp b/batched/dense/unit_test/Test_Batched_SerialTbsv.hpp index 68728c4c87..0ff4d7d859 100644 --- a/batched/dense/unit_test/Test_Batched_SerialTbsv.hpp +++ b/batched/dense/unit_test/Test_Batched_SerialTbsv.hpp @@ -134,7 +134,7 @@ void impl_test_batched_tbsv(const int N, const int k, const int BlkSize) { Kokkos::fence(); // this eps is about 10^-14 - using ats = typename Kokkos::ArithTraits; + using ats = typename KokkosKernels::ArithTraits; using mag_type = typename ats::mag_type; mag_type eps = 1.0e3 * ats::epsilon(); @@ -244,7 +244,7 @@ void impl_test_batched_tbsv_analytical(const std::size_t N) { Kokkos::fence(); // Check x0 = x_ref - using ats = typename Kokkos::ArithTraits; + using ats = typename KokkosKernels::ArithTraits; using mag_type = typename ats::mag_type; mag_type eps = 1.0e3 * ats::epsilon(); diff --git a/batched/dense/unit_test/Test_Batched_SerialTrmm.hpp b/batched/dense/unit_test/Test_Batched_SerialTrmm.hpp index bc0f1b3cc4..2ee027475e 100644 --- a/batched/dense/unit_test/Test_Batched_SerialTrmm.hpp +++ b/batched/dense/unit_test/Test_Batched_SerialTrmm.hpp @@ -60,7 +60,7 @@ struct VanillaGEMM { typedef typename ViewTypeA::value_type ScalarA; typedef typename ViewTypeB::value_type ScalarB; typedef typename ViewTypeC::value_type ScalarC; - typedef Kokkos::ArithTraits APT; + typedef KokkosKernels::ArithTraits APT; typedef typename APT::mag_type mag_type; ScalarA alpha; ScalarC beta; @@ -142,7 +142,7 @@ template ats; + typedef KokkosKernels::ArithTraits ats; ScalarType alpha(1.0); ScalarType beta(0.0); diff --git a/batched/dense/unit_test/Test_Batched_SerialTrsm.hpp b/batched/dense/unit_test/Test_Batched_SerialTrsm.hpp index 541ec97142..f067486283 100644 --- a/batched/dense/unit_test/Test_Batched_SerialTrsm.hpp +++ b/batched/dense/unit_test/Test_Batched_SerialTrsm.hpp @@ -106,7 +106,7 @@ struct Functor_BatchedSerialGemm { template void impl_test_batched_trsm_blocking(const int N, const int BlkSize, const int NumCols) { - using ats = Kokkos::ArithTraits; + using ats = KokkosKernels::ArithTraits; using ViewType = Kokkos::View; /// randomized input testing views @@ -218,7 +218,7 @@ void impl_test_batched_trsm_blocking(const int N, const int BlkSize, const int N template void impl_test_batched_trsm_analytical(const std::size_t N) { - using ats = typename Kokkos::ArithTraits; + using ats = typename KokkosKernels::ArithTraits; using RealType = typename ats::mag_type; using View3DType = Kokkos::View; @@ -404,7 +404,7 @@ void impl_test_batched_trsm_analytical(const std::size_t N) { template void impl_test_batched_trsm(const std::size_t N, const std::size_t m, const std::size_t n) { - using ats = typename Kokkos::ArithTraits; + using ats = typename KokkosKernels::ArithTraits; using RealType = typename ats::mag_type; using View3DType = Kokkos::View; @@ -442,7 +442,7 @@ void impl_test_batched_trsm(const std::size_t N, const std::size_t m, const std: for (std::size_t ib = 0; ib < N; ib++) { for (std::size_t i = 0; i < m; i++) { for (std::size_t j = 0; j < m; j++) { - h_Atri(ib, i, j) = Kokkos::ArithTraits::conj(h_Atri(ib, i, j)); + h_Atri(ib, i, j) = KokkosKernels::ArithTraits::conj(h_Atri(ib, i, j)); } } } @@ -466,7 +466,7 @@ void impl_test_batched_trsm(const std::size_t N, const std::size_t m, const std: for (std::size_t ib = 0; ib < N; ib++) { for (std::size_t i = 0; i < m; i++) { for (std::size_t j = 0; j < m; j++) { - h_Atri(ib, i, j) = Kokkos::ArithTraits::conj(h_Atri(ib, i, j)); + h_Atri(ib, i, j) = KokkosKernels::ArithTraits::conj(h_Atri(ib, i, j)); } } } diff --git a/batched/dense/unit_test/Test_Batched_SerialTrsv.hpp b/batched/dense/unit_test/Test_Batched_SerialTrsv.hpp index 9f6a56c916..7b853d3a7e 100644 --- a/batched/dense/unit_test/Test_Batched_SerialTrsv.hpp +++ b/batched/dense/unit_test/Test_Batched_SerialTrsv.hpp @@ -110,7 +110,7 @@ struct Functor_BatchedSerialGemv { template void impl_test_batched_trsv_blocking(const int N, const int BlkSize) { - using ats = Kokkos::ArithTraits; + using ats = KokkosKernels::ArithTraits; using View2DType = Kokkos::View; using View3DType = Kokkos::View; @@ -195,7 +195,7 @@ void impl_test_batched_trsv_blocking(const int N, const int BlkSize) { template void impl_test_batched_trsv_analytical(const std::size_t N) { - using ats = typename Kokkos::ArithTraits; + using ats = typename KokkosKernels::ArithTraits; using RealType = typename ats::mag_type; using View2DType = Kokkos::View; @@ -304,7 +304,7 @@ void impl_test_batched_trsv_analytical(const std::size_t N) { template void impl_test_batched_trsv(const std::size_t N, const std::size_t BlkSize) { - using ats = typename Kokkos::ArithTraits; + using ats = typename KokkosKernels::ArithTraits; using RealType = typename ats::mag_type; using View2DType = Kokkos::View; diff --git a/batched/dense/unit_test/Test_Batched_SerialTrtri.hpp b/batched/dense/unit_test/Test_Batched_SerialTrtri.hpp index 379f8c9433..81fb33db50 100644 --- a/batched/dense/unit_test/Test_Batched_SerialTrtri.hpp +++ b/batched/dense/unit_test/Test_Batched_SerialTrtri.hpp @@ -62,7 +62,7 @@ struct VanillaGEMM { typedef typename ViewTypeA::value_type ScalarA; typedef typename ViewTypeB::value_type ScalarB; typedef typename ViewTypeC::value_type ScalarC; - typedef Kokkos::ArithTraits APT; + typedef KokkosKernels::ArithTraits APT; typedef typename APT::mag_type mag_type; ScalarA alpha; ScalarC beta; @@ -137,7 +137,7 @@ template ats; + typedef KokkosKernels::ArithTraits ats; ScalarType alpha(1.0); ScalarType beta(0.0); diff --git a/batched/dense/unit_test/Test_Batched_TeamAxpy.hpp b/batched/dense/unit_test/Test_Batched_TeamAxpy.hpp index d33f833146..d9421fbbcd 100644 --- a/batched/dense/unit_test/Test_Batched_TeamAxpy.hpp +++ b/batched/dense/unit_test/Test_Batched_TeamAxpy.hpp @@ -72,7 +72,7 @@ void impl_test_batched_axpy(const int N, const int BlkSize, const int N_team) { typedef typename ViewType::value_type value_type; typedef typename ViewType::const_value_type const_value_type; typedef typename alphaViewType::const_value_type alpha_const_value_type; - typedef Kokkos::ArithTraits ats; + typedef KokkosKernels::ArithTraits ats; ViewType X0("x0", N, BlkSize), X1("x1", N, BlkSize), Y0("y0", N, BlkSize), Y1("y1", N, BlkSize); diff --git a/batched/dense/unit_test/Test_Batched_TeamGemm.hpp b/batched/dense/unit_test/Test_Batched_TeamGemm.hpp index 93719783eb..650faa6e22 100644 --- a/batched/dense/unit_test/Test_Batched_TeamGemm.hpp +++ b/batched/dense/unit_test/Test_Batched_TeamGemm.hpp @@ -108,7 +108,7 @@ template ; + using ats = KokkosKernels::ArithTraits; using mag_type = typename ats::mag_type; const int nb = C.extent_int(0); const int m = C.extent_int(1); @@ -170,9 +170,9 @@ void impl_test_batched_teamgemm(const int N, const int matAdim1, const int matAd using transA = typename ParamTagType::transA; using transB = typename ParamTagType::transB; using execution_space = typename DeviceType::execution_space; - using ats = Kokkos::ArithTraits; + using ats = KokkosKernels::ArithTraits; using ViewType = Kokkos::View; - using FP64Type = std::conditional_t::is_complex, Kokkos::complex, double>; + using FP64Type = std::conditional_t::is_complex, Kokkos::complex, double>; using ViewFP64Type = Kokkos::View; using ErrorViewFP64Type = Kokkos::View; diff --git a/batched/dense/unit_test/Test_Batched_TeamGesv.hpp b/batched/dense/unit_test/Test_Batched_TeamGesv.hpp index d119308862..3972f8d7de 100644 --- a/batched/dense/unit_test/Test_Batched_TeamGesv.hpp +++ b/batched/dense/unit_test/Test_Batched_TeamGesv.hpp @@ -77,9 +77,9 @@ struct Functor_TestBatchedTeamGesv { template void impl_test_batched_gesv(const int N, const int BlkSize) { typedef typename MatrixType::value_type value_type; - typedef Kokkos::ArithTraits ats; + typedef KokkosKernels::ArithTraits ats; - using MagnitudeType = typename Kokkos::ArithTraits::mag_type; + using MagnitudeType = typename KokkosKernels::ArithTraits::mag_type; using NormViewType = Kokkos::View; NormViewType sqr_norm_j("sqr_norm_j", N); diff --git a/batched/dense/unit_test/Test_Batched_TeamInverseLU.hpp b/batched/dense/unit_test/Test_Batched_TeamInverseLU.hpp index 06599d5d8d..e62f5a1b9f 100644 --- a/batched/dense/unit_test/Test_Batched_TeamInverseLU.hpp +++ b/batched/dense/unit_test/Test_Batched_TeamInverseLU.hpp @@ -152,7 +152,7 @@ struct Functor_TestBatchedTeamInverseLU { template void impl_test_batched_inverselu(const int N, const int BlkSize) { typedef typename AViewType::value_type value_type; - typedef Kokkos::ArithTraits ats; + typedef KokkosKernels::ArithTraits ats; /// randomized input testing views AViewType a0("a0", N, BlkSize, BlkSize); diff --git a/batched/dense/unit_test/Test_Batched_TeamLU.hpp b/batched/dense/unit_test/Test_Batched_TeamLU.hpp index e1b7473641..dde20a36cc 100644 --- a/batched/dense/unit_test/Test_Batched_TeamLU.hpp +++ b/batched/dense/unit_test/Test_Batched_TeamLU.hpp @@ -71,7 +71,7 @@ struct Functor_TestBatchedTeamLU { template void impl_test_batched_lu(const int N, const int BlkSize) { typedef typename ViewType::value_type value_type; - typedef Kokkos::ArithTraits ats; + typedef KokkosKernels::ArithTraits ats; /// randomized input testing views ViewType a0("a0", N, BlkSize, BlkSize), a1("a1", N, BlkSize, BlkSize); diff --git a/batched/dense/unit_test/Test_Batched_TeamSolveLU.hpp b/batched/dense/unit_test/Test_Batched_TeamSolveLU.hpp index 7d7373e2dc..1919bcc7b9 100644 --- a/batched/dense/unit_test/Test_Batched_TeamSolveLU.hpp +++ b/batched/dense/unit_test/Test_Batched_TeamSolveLU.hpp @@ -149,7 +149,7 @@ struct Functor_TestBatchedTeamSolveLU { template void impl_test_batched_solvelu(const int N, const int BlkSize) { typedef typename ViewType::value_type value_type; - typedef Kokkos::ArithTraits ats; + typedef KokkosKernels::ArithTraits ats; /// randomized input testing views ViewType a0("a0", N, BlkSize, BlkSize); diff --git a/batched/dense/unit_test/Test_Batched_TeamTrsm.hpp b/batched/dense/unit_test/Test_Batched_TeamTrsm.hpp index 1349fd2c79..c98837fba0 100644 --- a/batched/dense/unit_test/Test_Batched_TeamTrsm.hpp +++ b/batched/dense/unit_test/Test_Batched_TeamTrsm.hpp @@ -81,7 +81,7 @@ struct Functor_TestBatchedTeamTrsm { template void impl_test_batched_trsm(const int N, const int BlkSize, const int NumCols) { typedef typename ViewType::value_type value_type; - typedef Kokkos::ArithTraits ats; + typedef KokkosKernels::ArithTraits ats; /// randomized input testing views ScalarType alpha(1.0); diff --git a/batched/dense/unit_test/Test_Batched_TeamTrsv.hpp b/batched/dense/unit_test/Test_Batched_TeamTrsv.hpp index 55aff198e4..aa625a2283 100644 --- a/batched/dense/unit_test/Test_Batched_TeamTrsv.hpp +++ b/batched/dense/unit_test/Test_Batched_TeamTrsv.hpp @@ -77,7 +77,7 @@ struct Functor_TestBatchedTeamTrsv { template void impl_test_batched_trsv(const int N, const int BlkSize) { typedef typename ViewType::value_type value_type; - typedef Kokkos::ArithTraits ats; + typedef KokkosKernels::ArithTraits ats; /// randomized input testing views ScalarType alpha(1.5); diff --git a/batched/dense/unit_test/Test_Batched_TeamVectorAxpy.hpp b/batched/dense/unit_test/Test_Batched_TeamVectorAxpy.hpp index cd378745ef..c510317479 100644 --- a/batched/dense/unit_test/Test_Batched_TeamVectorAxpy.hpp +++ b/batched/dense/unit_test/Test_Batched_TeamVectorAxpy.hpp @@ -72,7 +72,7 @@ void impl_test_batched_axpy(const int N, const int BlkSize, const int N_team) { typedef typename ViewType::value_type value_type; typedef typename ViewType::const_value_type const_value_type; typedef typename alphaViewType::const_value_type alpha_const_value_type; - typedef Kokkos::ArithTraits ats; + typedef KokkosKernels::ArithTraits ats; ViewType X0("x0", N, BlkSize), X1("x1", N, BlkSize), Y0("y0", N, BlkSize), Y1("y1", N, BlkSize); diff --git a/batched/dense/unit_test/Test_Batched_TeamVectorGemm.hpp b/batched/dense/unit_test/Test_Batched_TeamVectorGemm.hpp index d1d6f82543..928a5cf51f 100644 --- a/batched/dense/unit_test/Test_Batched_TeamVectorGemm.hpp +++ b/batched/dense/unit_test/Test_Batched_TeamVectorGemm.hpp @@ -77,7 +77,7 @@ void impl_test_batched_teamvectorgemm(const int N, const int matAdim1, const int using transB = typename ParamTagType::transB; using execution_space = typename DeviceType::execution_space; using value_type = typename ViewType::value_type; - using ats = Kokkos::ArithTraits; + using ats = KokkosKernels::ArithTraits; /// randomized input testing views ScalarType alpha = ScalarType(1.5), beta = ScalarType(3.0); diff --git a/batched/dense/unit_test/Test_Batched_TeamVectorGesv.hpp b/batched/dense/unit_test/Test_Batched_TeamVectorGesv.hpp index dba452da53..97f3151ea4 100644 --- a/batched/dense/unit_test/Test_Batched_TeamVectorGesv.hpp +++ b/batched/dense/unit_test/Test_Batched_TeamVectorGesv.hpp @@ -78,9 +78,9 @@ struct Functor_TestBatchedTeamVectorGesv { template void impl_test_batched_gesv(const int N, const int BlkSize) { typedef typename MatrixType::value_type value_type; - typedef Kokkos::ArithTraits ats; + typedef KokkosKernels::ArithTraits ats; - using MagnitudeType = typename Kokkos::ArithTraits::mag_type; + using MagnitudeType = typename KokkosKernels::ArithTraits::mag_type; using NormViewType = Kokkos::View; NormViewType sqr_norm_j("sqr_norm_j", N); diff --git a/batched/dense/unit_test/Test_Batched_TeamVectorQR.hpp b/batched/dense/unit_test/Test_Batched_TeamVectorQR.hpp index de53c91046..4be042f358 100644 --- a/batched/dense/unit_test/Test_Batched_TeamVectorQR.hpp +++ b/batched/dense/unit_test/Test_Batched_TeamVectorQR.hpp @@ -105,7 +105,7 @@ template void impl_test_batched_qr(const int N, const int BlkSize) { typedef typename MatrixViewType::non_const_value_type value_type; - typedef Kokkos::ArithTraits ats; + typedef KokkosKernels::ArithTraits ats; const value_type one(1); /// randomized input testing views MatrixViewType a("a", N, BlkSize, BlkSize); diff --git a/batched/dense/unit_test/Test_Batched_TeamVectorQR_WithColumnPivoting.hpp b/batched/dense/unit_test/Test_Batched_TeamVectorQR_WithColumnPivoting.hpp index e3ebc919b4..c3fe8ec723 100644 --- a/batched/dense/unit_test/Test_Batched_TeamVectorQR_WithColumnPivoting.hpp +++ b/batched/dense/unit_test/Test_Batched_TeamVectorQR_WithColumnPivoting.hpp @@ -115,7 +115,7 @@ template void impl_test_batched_qr_with_columnpivoting(const int N, const int BlkSize) { typedef typename MatrixViewType::non_const_value_type value_type; - typedef Kokkos::ArithTraits ats; + typedef KokkosKernels::ArithTraits ats; // const value_type one(1); /// randomized input testing views MatrixViewType a("a", N, BlkSize, BlkSize); diff --git a/batched/dense/unit_test/Test_Batched_TeamVectorSolveUTV.hpp b/batched/dense/unit_test/Test_Batched_TeamVectorSolveUTV.hpp index fdf482b4ab..8400319dcf 100644 --- a/batched/dense/unit_test/Test_Batched_TeamVectorSolveUTV.hpp +++ b/batched/dense/unit_test/Test_Batched_TeamVectorSolveUTV.hpp @@ -124,7 +124,7 @@ template void impl_test_batched_solve_utv(const int N, const int BlkSize) { typedef typename MatrixViewType::non_const_value_type value_type; - typedef Kokkos::ArithTraits ats; + typedef KokkosKernels::ArithTraits ats; // const value_type one(1); /// randomized input testing views MatrixViewType r("r", N, BlkSize, 3); diff --git a/batched/dense/unit_test/Test_Batched_TeamVectorSolveUTV2.hpp b/batched/dense/unit_test/Test_Batched_TeamVectorSolveUTV2.hpp index b38fb318e6..bc7558c7c9 100644 --- a/batched/dense/unit_test/Test_Batched_TeamVectorSolveUTV2.hpp +++ b/batched/dense/unit_test/Test_Batched_TeamVectorSolveUTV2.hpp @@ -126,7 +126,7 @@ template void impl_test_batched_solve_utv2(const int N, const int BlkSize) { typedef typename MatrixViewType::non_const_value_type value_type; - typedef Kokkos::ArithTraits ats; + typedef KokkosKernels::ArithTraits ats; // const value_type one(1); /// randomized input testing views MatrixViewType r("r", N, BlkSize, 3); diff --git a/batched/dense/unit_test/Test_Batched_TeamVectorUTV.hpp b/batched/dense/unit_test/Test_Batched_TeamVectorUTV.hpp index 44f6ec394a..64af940650 100644 --- a/batched/dense/unit_test/Test_Batched_TeamVectorUTV.hpp +++ b/batched/dense/unit_test/Test_Batched_TeamVectorUTV.hpp @@ -155,7 +155,7 @@ template void impl_test_batched_utv(const int N, const int BlkSize) { typedef typename MatrixViewType::non_const_value_type value_type; - typedef Kokkos::ArithTraits ats; + typedef KokkosKernels::ArithTraits ats; // const value_type one(1); /// randomized input testing views MatrixViewType r("r", N, BlkSize, 3); diff --git a/batched/dense/unit_test/Test_Batched_VectorArithmatic.hpp b/batched/dense/unit_test/Test_Batched_VectorArithmatic.hpp index 654d199117..0d8a71c5cc 100644 --- a/batched/dense/unit_test/Test_Batched_VectorArithmatic.hpp +++ b/batched/dense/unit_test/Test_Batched_VectorArithmatic.hpp @@ -50,10 +50,10 @@ void impl_test_complex_real_imag_value() { a[k].imag() = k * 5 + 4; } - const auto a_real = Kokkos::ArithTraits::real(a); - const auto a_imag = Kokkos::ArithTraits::imag(a); + const auto a_real = KokkosKernels::ArithTraits::real(a); + const auto a_imag = KokkosKernels::ArithTraits::imag(a); - typedef Kokkos::ArithTraits ats; + typedef KokkosKernels::ArithTraits ats; const typename ats::mag_type eps = 1.0e3 * ats::epsilon(); for (int k = 0; k < vector_length; ++k) { EXPECT_NEAR(a[k].real(), a_real[k], eps); @@ -69,7 +69,7 @@ void impl_test_batched_vector_arithmatic() { typedef typename vector_type::value_type value_type; const int vector_length = vector_type::vector_length; - typedef Kokkos::ArithTraits ats; + typedef KokkosKernels::ArithTraits ats; typedef typename ats::mag_type mag_type; vector_type a, b, c; diff --git a/batched/dense/unit_test/Test_Batched_VectorLogical.hpp b/batched/dense/unit_test/Test_Batched_VectorLogical.hpp index 0427982a42..7db9dbe5a9 100644 --- a/batched/dense/unit_test/Test_Batched_VectorLogical.hpp +++ b/batched/dense/unit_test/Test_Batched_VectorLogical.hpp @@ -43,7 +43,7 @@ void impl_test_batched_vector_logical() { typedef ValueType value_type; const int vector_length = VectorLength; - typedef Kokkos::ArithTraits ats; + typedef KokkosKernels::ArithTraits ats; typedef typename ats::mag_type mag_type; vector_int_type a, b; diff --git a/batched/dense/unit_test/Test_Batched_VectorMath.hpp b/batched/dense/unit_test/Test_Batched_VectorMath.hpp index 2cd9f02a49..208c7ee200 100644 --- a/batched/dense/unit_test/Test_Batched_VectorMath.hpp +++ b/batched/dense/unit_test/Test_Batched_VectorMath.hpp @@ -44,7 +44,7 @@ void impl_test_batched_vector_math() { typedef typename vector_type::value_type value_type; const int vector_length = vector_type::vector_length; - typedef Kokkos::ArithTraits ats; + typedef KokkosKernels::ArithTraits ats; typedef typename ats::mag_type mag_type; vector_type a, b, aref, bref; @@ -129,7 +129,7 @@ int test_batched_vector_math() { // template // int test_complex_pow() { -// typedef Kokkos::ArithTraits > ats; +// typedef KokkosKernels::ArithTraits > ats; // typedef typename ats::mag_type mag_type; // const mag_type eps = 1.0e3 * ats::epsilon(); diff --git a/batched/dense/unit_test/Test_Batched_VectorMisc.hpp b/batched/dense/unit_test/Test_Batched_VectorMisc.hpp index 98d7f4e87e..899e992446 100644 --- a/batched/dense/unit_test/Test_Batched_VectorMisc.hpp +++ b/batched/dense/unit_test/Test_Batched_VectorMisc.hpp @@ -44,7 +44,7 @@ void impl_test_batched_vector_misc() { typedef typename vector_type::value_type value_type; const int vector_length = vector_type::vector_length; - typedef Kokkos::ArithTraits ats; + typedef KokkosKernels::ArithTraits ats; typedef typename ats::mag_type mag_type; vector_type a, b, c; diff --git a/batched/dense/unit_test/Test_Batched_VectorRelation.hpp b/batched/dense/unit_test/Test_Batched_VectorRelation.hpp index e5c3139c5c..d39a6997ba 100644 --- a/batched/dense/unit_test/Test_Batched_VectorRelation.hpp +++ b/batched/dense/unit_test/Test_Batched_VectorRelation.hpp @@ -44,7 +44,7 @@ void impl_test_batched_vector_relation() { typedef typename vector_type::value_type value_type; const int vector_length = vector_type::vector_length; - // typedef Kokkos::ArithTraits ats; + // typedef KokkosKernels::ArithTraits ats; // typedef typename ats::mag_type mag_type; vector_type a, b; diff --git a/batched/dense/unit_test/Test_Batched_VectorView.hpp b/batched/dense/unit_test/Test_Batched_VectorView.hpp index 5d9047e57c..c2580129dc 100644 --- a/batched/dense/unit_test/Test_Batched_VectorView.hpp +++ b/batched/dense/unit_test/Test_Batched_VectorView.hpp @@ -63,7 +63,7 @@ template void impl_verify_vector_view(const VectorViewType& a, const SimdViewAccess >& b) { typedef typename VectorViewType::value_type vector_type; constexpr int vl = vector_type::vector_length; - typedef Kokkos::ArithTraits ats; + typedef KokkosKernels::ArithTraits ats; const typename ats::mag_type eps = 1.0e3 * ats::epsilon(); TEST_LOOP EXPECT_NEAR_KK(a.access(i0 / vl, i1, i2, i3, i4, i5, i6, i7)[i0 % vl], b(i0, i1, i2, i3, i4, i5, i6, i7), eps); @@ -72,7 +72,7 @@ template void impl_verify_vector_view(const VectorViewType& a, const SimdViewAccess >& b) { typedef typename VectorViewType::value_type vector_type; constexpr int vl = vector_type::vector_length; - typedef Kokkos::ArithTraits ats; + typedef KokkosKernels::ArithTraits ats; const typename ats::mag_type eps = 1.0e3 * ats::epsilon(); TEST_LOOP EXPECT_NEAR_KK(a.access(i0, i1 / vl, i2, i3, i4, i5, i6, i7)[i1 % vl], b(i0, i1, i2, i3, i4, i5, i6, i7), eps); @@ -81,7 +81,7 @@ template void impl_verify_vector_view(const VectorViewType& a, const SimdViewAccess >& b) { typedef typename VectorViewType::value_type vector_type; constexpr int vl = vector_type::vector_length; - typedef Kokkos::ArithTraits ats; + typedef KokkosKernels::ArithTraits ats; const typename ats::mag_type eps = 1.0e3 * ats::epsilon(); TEST_LOOP EXPECT_NEAR_KK(a.access(i0, i1, i2 / vl, i3, i4, i5, i6, i7)[i2 % vl], b(i0, i1, i2, i3, i4, i5, i6, i7), eps); @@ -90,7 +90,7 @@ template void impl_verify_vector_view(const VectorViewType& a, const SimdViewAccess >& b) { typedef typename VectorViewType::value_type vector_type; constexpr int vl = vector_type::vector_length; - typedef Kokkos::ArithTraits ats; + typedef KokkosKernels::ArithTraits ats; const typename ats::mag_type eps = 1.0e3 * ats::epsilon(); TEST_LOOP EXPECT_NEAR_KK(a.access(i0, i1, i2, i3 / vl, i4, i5, i6, i7)[i3 % vl], b(i0, i1, i2, i3, i4, i5, i6, i7), eps); @@ -99,7 +99,7 @@ template void impl_verify_vector_view(const VectorViewType& a, const SimdViewAccess >& b) { typedef typename VectorViewType::value_type vector_type; constexpr int vl = vector_type::vector_length; - typedef Kokkos::ArithTraits ats; + typedef KokkosKernels::ArithTraits ats; const typename ats::mag_type eps = 1.0e3 * ats::epsilon(); TEST_LOOP EXPECT_NEAR_KK(a.access(i0, i1, i2, i3, i4 / vl, i5, i6, i7)[i4 % vl], b(i0, i1, i2, i3, i4, i5, i6, i7), eps); @@ -108,7 +108,7 @@ template void impl_verify_vector_view(const VectorViewType& a, const SimdViewAccess >& b) { typedef typename VectorViewType::value_type vector_type; constexpr int vl = vector_type::vector_length; - typedef Kokkos::ArithTraits ats; + typedef KokkosKernels::ArithTraits ats; const typename ats::mag_type eps = 1.0e3 * ats::epsilon(); TEST_LOOP EXPECT_NEAR_KK(a.access(i0, i1, i2, i3, i4, i5 / vl, i6, i7)[i5 % vl], b(i0, i1, i2, i3, i4, i5, i6, i7), eps); @@ -117,7 +117,7 @@ template void impl_verify_vector_view(const VectorViewType& a, const SimdViewAccess >& b) { typedef typename VectorViewType::value_type vector_type; constexpr int vl = vector_type::vector_length; - typedef Kokkos::ArithTraits ats; + typedef KokkosKernels::ArithTraits ats; const typename ats::mag_type eps = 1.0e3 * ats::epsilon(); TEST_LOOP EXPECT_NEAR_KK(a.access(i0, i1, i2, i3, i4, i5, i6 / vl, i7)[i6 % vl], b(i0, i1, i2, i3, i4, i5, i6, i7), eps); @@ -126,7 +126,7 @@ template void impl_verify_vector_view(const VectorViewType& a, const SimdViewAccess >& b) { typedef typename VectorViewType::value_type vector_type; constexpr int vl = vector_type::vector_length; - typedef Kokkos::ArithTraits ats; + typedef KokkosKernels::ArithTraits ats; const typename ats::mag_type eps = 1.0e3 * ats::epsilon(); TEST_LOOP EXPECT_NEAR_KK(a.access(i0, i1, i2, i3, i4, i5, i6, i7 / vl)[i7 % vl], b(i0, i1, i2, i3, i4, i5, i6, i7), eps); diff --git a/batched/sparse/impl/KokkosBatched_CG_TeamVector_Impl.hpp b/batched/sparse/impl/KokkosBatched_CG_TeamVector_Impl.hpp index e1d99cbd4d..bce72520ac 100644 --- a/batched/sparse/impl/KokkosBatched_CG_TeamVector_Impl.hpp +++ b/batched/sparse/impl/KokkosBatched_CG_TeamVector_Impl.hpp @@ -42,7 +42,7 @@ KOKKOS_INLINE_FUNCTION int TeamVectorCG::invoke(const MemberType& me const KrylovHandleType& handle, const TMPViewType& TMPView, const TMPNormViewType& TMPNormView) { typedef int OrdinalType; - typedef typename Kokkos::ArithTraits::mag_type MagnitudeType; + typedef typename KokkosKernels::ArithTraits::mag_type MagnitudeType; const size_t maximum_iteration = handle.get_max_iteration(); const MagnitudeType tolerance = handle.get_tolerance(); @@ -162,7 +162,7 @@ KOKKOS_INLINE_FUNCTION int TeamVectorCG::invoke(const MemberType& me Kokkos::View; using ScratchPadNormViewType = - Kokkos::View::mag_type**, + Kokkos::View::mag_type**, typename VectorViewType::execution_space::scratch_memory_space>; const int numMatrices = X.extent(0); @@ -179,7 +179,7 @@ KOKKOS_INLINE_FUNCTION int TeamVectorCG::invoke(const MemberType& me const int last_matrix = handle.last_index(member.league_rank()); using ScratchPadNormViewType = - Kokkos::View::mag_type**, + Kokkos::View::mag_type**, typename VectorViewType::execution_space::scratch_memory_space>; const int numMatrices = X.extent(0); diff --git a/batched/sparse/impl/KokkosBatched_CG_Team_Impl.hpp b/batched/sparse/impl/KokkosBatched_CG_Team_Impl.hpp index ddd1d199d9..105c8ae533 100644 --- a/batched/sparse/impl/KokkosBatched_CG_Team_Impl.hpp +++ b/batched/sparse/impl/KokkosBatched_CG_Team_Impl.hpp @@ -41,7 +41,7 @@ KOKKOS_INLINE_FUNCTION int TeamCG::invoke(const MemberType& member, const KrylovHandle& handle, const TMPViewType& TMPView, const TMPNormViewType& TMPNormView) { typedef int OrdinalType; - typedef typename Kokkos::ArithTraits::mag_type MagnitudeType; + typedef typename KokkosKernels::ArithTraits::mag_type MagnitudeType; size_t maximum_iteration = handle.get_max_iteration(); const MagnitudeType tolerance = handle.get_tolerance(); @@ -161,7 +161,7 @@ KOKKOS_INLINE_FUNCTION int TeamCG::invoke(const MemberType& member, Kokkos::View; using ScratchPadNormViewType = - Kokkos::View::mag_type**, + Kokkos::View::mag_type**, typename VectorViewType::execution_space::scratch_memory_space>; const int numMatrices = X.extent(0); @@ -178,7 +178,7 @@ KOKKOS_INLINE_FUNCTION int TeamCG::invoke(const MemberType& member, const int last_matrix = handle.last_index(member.league_rank()); using ScratchPadNormViewType = - Kokkos::View::mag_type**, + Kokkos::View::mag_type**, typename VectorViewType::execution_space::scratch_memory_space>; const int numMatrices = X.extent(0); diff --git a/batched/sparse/impl/KokkosBatched_GMRES_Serial_Impl.hpp b/batched/sparse/impl/KokkosBatched_GMRES_Serial_Impl.hpp index 5b0675eb37..378d04b1da 100644 --- a/batched/sparse/impl/KokkosBatched_GMRES_Serial_Impl.hpp +++ b/batched/sparse/impl/KokkosBatched_GMRES_Serial_Impl.hpp @@ -41,8 +41,8 @@ KOKKOS_INLINE_FUNCTION int SerialGMRES::invoke(const OperatorType& A, const Vect const PrecOperatorType& P, const KrylovHandleType& handle, const int GMRES_id) { typedef int OrdinalType; - typedef typename Kokkos::ArithTraits::mag_type MagnitudeType; - typedef Kokkos::ArithTraits ATM; + typedef typename KokkosKernels::ArithTraits::mag_type MagnitudeType; + typedef KokkosKernels::ArithTraits ATM; using SerialCopy1D = SerialCopy; using SerialCopy2D = SerialCopy; @@ -206,7 +206,7 @@ KOKKOS_INLINE_FUNCTION int SerialGMRES::invoke(const OperatorType& A, const Vect G(l, j + 1) = 0.; } - auto res_norm = Kokkos::ArithTraits::abs(G(l, j + 1)) / G(l, 0); + auto res_norm = KokkosKernels::ArithTraits::abs(G(l, j + 1)) / G(l, 0); handle.set_norm(GMRES_id, l, j + 1, res_norm); diff --git a/batched/sparse/impl/KokkosBatched_GMRES_TeamVector_Impl.hpp b/batched/sparse/impl/KokkosBatched_GMRES_TeamVector_Impl.hpp index 0bc6b3ffd6..13cb42d743 100644 --- a/batched/sparse/impl/KokkosBatched_GMRES_TeamVector_Impl.hpp +++ b/batched/sparse/impl/KokkosBatched_GMRES_TeamVector_Impl.hpp @@ -48,8 +48,8 @@ KOKKOS_INLINE_FUNCTION int TeamVectorGMRES::invoke(const MemberType& const ArnoldiViewType& ArnoldiView, const TMPViewType& TMPView) { typedef int OrdinalType; - typedef typename Kokkos::ArithTraits::mag_type MagnitudeType; - typedef Kokkos::ArithTraits ATM; + typedef typename KokkosKernels::ArithTraits::mag_type MagnitudeType; + typedef KokkosKernels::ArithTraits ATM; using TeamVectorCopy1D = TeamVectorCopy; @@ -219,7 +219,7 @@ KOKKOS_INLINE_FUNCTION int TeamVectorGMRES::invoke(const MemberType& G(l, j + 1) = 0.; } - auto res_norm = Kokkos::ArithTraits::abs(G(l, j + 1)) / G(l, 0); + auto res_norm = KokkosKernels::ArithTraits::abs(G(l, j + 1)) / G(l, 0); handle.set_norm(member.league_rank(), l, j + 1, res_norm); diff --git a/batched/sparse/impl/KokkosBatched_GMRES_Team_Impl.hpp b/batched/sparse/impl/KokkosBatched_GMRES_Team_Impl.hpp index 22a7c6fdf3..4110f4d57f 100644 --- a/batched/sparse/impl/KokkosBatched_GMRES_Team_Impl.hpp +++ b/batched/sparse/impl/KokkosBatched_GMRES_Team_Impl.hpp @@ -46,8 +46,8 @@ KOKKOS_INLINE_FUNCTION int TeamGMRES::invoke(const MemberType& membe const ArnoldiViewType& ArnoldiView, const TMPViewType& TMPView) { typedef int OrdinalType; - typedef typename Kokkos::ArithTraits::mag_type MagnitudeType; - typedef Kokkos::ArithTraits ATM; + typedef typename KokkosKernels::ArithTraits::mag_type MagnitudeType; + typedef KokkosKernels::ArithTraits ATM; using TeamCopy1D = TeamCopy; @@ -217,7 +217,7 @@ KOKKOS_INLINE_FUNCTION int TeamGMRES::invoke(const MemberType& membe G(l, j + 1) = 0.; } - auto res_norm = Kokkos::ArithTraits::abs(G(l, j + 1)) / G(l, 0); + auto res_norm = KokkosKernels::ArithTraits::abs(G(l, j + 1)) / G(l, 0); handle.set_norm(member.league_rank(), l, j + 1, res_norm); diff --git a/batched/sparse/impl/KokkosBatched_Spmv_Serial_Impl.hpp b/batched/sparse/impl/KokkosBatched_Spmv_Serial_Impl.hpp index dabc7d90fc..e7bf4ff584 100644 --- a/batched/sparse/impl/KokkosBatched_Spmv_Serial_Impl.hpp +++ b/batched/sparse/impl/KokkosBatched_Spmv_Serial_Impl.hpp @@ -173,9 +173,9 @@ struct SerialSpmv { template KOKKOS_INLINE_FUNCTION static int invoke( - const typename Kokkos::ArithTraits::mag_type& alpha, + const typename KokkosKernels::ArithTraits::mag_type& alpha, const ValuesViewType& values, const IntView& row_ptr, const IntView& colIndices, const xViewType& X, - const typename Kokkos::ArithTraits::mag_type& beta, + const typename KokkosKernels::ArithTraits::mag_type& beta, const yViewType& Y) { #if (KOKKOSKERNELS_DEBUG_LEVEL > 0) static_assert(Kokkos::is_view::value, "KokkosBatched::spmv: ValuesViewType is not a Kokkos::View."); @@ -221,7 +221,7 @@ struct SerialSpmv { #endif return SerialSpmvInternal::template invoke< - typename Kokkos::ArithTraits::mag_type, + typename KokkosKernels::ArithTraits::mag_type, typename ValuesViewType::non_const_value_type, typename IntView::non_const_value_type, typename ValuesViewType::array_layout, dobeta>(X.extent(0), X.extent(1), alpha, values.data(), values.stride(0), values.stride(1), row_ptr.data(), row_ptr.stride(0), diff --git a/batched/sparse/impl/KokkosBatched_Spmv_TeamVector_Impl.hpp b/batched/sparse/impl/KokkosBatched_Spmv_TeamVector_Impl.hpp index d9f7d79c23..e3157e41c6 100644 --- a/batched/sparse/impl/KokkosBatched_Spmv_TeamVector_Impl.hpp +++ b/batched/sparse/impl/KokkosBatched_Spmv_TeamVector_Impl.hpp @@ -332,9 +332,9 @@ struct TeamVectorSpmv { template KOKKOS_INLINE_FUNCTION static int invoke( const MemberType& member, - const typename Kokkos::ArithTraits::mag_type& alpha, + const typename KokkosKernels::ArithTraits::mag_type& alpha, const ValuesViewType& values, const IntView& row_ptr, const IntView& colIndices, const xViewType& X, - const typename Kokkos::ArithTraits::mag_type& beta, + const typename KokkosKernels::ArithTraits::mag_type& beta, const yViewType& Y) { #if (KOKKOSKERNELS_DEBUG_LEVEL > 0) static_assert(Kokkos::is_view::value, "KokkosBatched::spmv: ValuesViewType is not a Kokkos::View."); @@ -385,7 +385,7 @@ struct TeamVectorSpmv { } return TeamVectorSpmvInternal::template invoke< - MemberType, typename Kokkos::ArithTraits::mag_type, + MemberType, typename KokkosKernels::ArithTraits::mag_type, typename ValuesViewType::non_const_value_type, typename IntView::non_const_value_type, typename ValuesViewType::array_layout, dobeta, N_team>( member, X.extent(0), X.extent(1), alpha, values.data(), values.stride(0), values.stride(1), row_ptr.data(), diff --git a/batched/sparse/impl/KokkosBatched_Spmv_Team_Impl.hpp b/batched/sparse/impl/KokkosBatched_Spmv_Team_Impl.hpp index a9e216eaa1..44ccb65692 100644 --- a/batched/sparse/impl/KokkosBatched_Spmv_Team_Impl.hpp +++ b/batched/sparse/impl/KokkosBatched_Spmv_Team_Impl.hpp @@ -207,9 +207,9 @@ struct TeamSpmv { template KOKKOS_INLINE_FUNCTION static int invoke( const MemberType& member, - const typename Kokkos::ArithTraits::mag_type& alpha, + const typename KokkosKernels::ArithTraits::mag_type& alpha, const ValuesViewType& values, const IntView& row_ptr, const IntView& colIndices, const xViewType& X, - const typename Kokkos::ArithTraits::mag_type& beta, + const typename KokkosKernels::ArithTraits::mag_type& beta, const yViewType& Y) { #if (KOKKOSKERNELS_DEBUG_LEVEL > 0) static_assert(Kokkos::is_view::value, "KokkosBatched::spmv: ValuesViewType is not a Kokkos::View."); @@ -260,7 +260,7 @@ struct TeamSpmv { } return TeamSpmvInternal::template invoke< - MemberType, typename Kokkos::ArithTraits::mag_type, + MemberType, typename KokkosKernels::ArithTraits::mag_type, typename ValuesViewType::non_const_value_type, typename IntView::non_const_value_type, typename ValuesViewType::array_layout, dobeta>( member, X.extent(0), X.extent(1), alpha, values.data(), values.stride(0), values.stride(1), row_ptr.data(), diff --git a/batched/sparse/src/KokkosBatched_CrsMatrix.hpp b/batched/sparse/src/KokkosBatched_CrsMatrix.hpp index b2477d7efc..850e3c9c7b 100644 --- a/batched/sparse/src/KokkosBatched_CrsMatrix.hpp +++ b/batched/sparse/src/KokkosBatched_CrsMatrix.hpp @@ -30,7 +30,7 @@ template class CrsMatrix { public: using ScalarType = typename ValuesViewType::non_const_value_type; - using MagnitudeType = typename Kokkos::ArithTraits::mag_type; + using MagnitudeType = typename KokkosKernels::ArithTraits::mag_type; private: ValuesViewType values; @@ -78,9 +78,9 @@ class CrsMatrix { template KOKKOS_INLINE_FUNCTION void apply(const MemberType &member, const XViewType &X, const YViewType &Y, - MagnitudeType alpha = Kokkos::ArithTraits::one(), - MagnitudeType beta = Kokkos::ArithTraits::zero()) const { - if (beta == Kokkos::ArithTraits::zero()) { + MagnitudeType alpha = KokkosKernels::ArithTraits::one(), + MagnitudeType beta = KokkosKernels::ArithTraits::zero()) const { + if (beta == KokkosKernels::ArithTraits::zero()) { if (member.team_size() == 1 && n_operators == 8) KokkosBatched::TeamVectorSpmv::template invoke( @@ -103,9 +103,9 @@ class CrsMatrix { template KOKKOS_INLINE_FUNCTION void apply(const XViewType &X, const YViewType &Y, - MagnitudeType alpha = Kokkos::ArithTraits::one(), - MagnitudeType beta = Kokkos::ArithTraits::zero()) const { - if (beta == Kokkos::ArithTraits::zero()) + MagnitudeType alpha = KokkosKernels::ArithTraits::one(), + MagnitudeType beta = KokkosKernels::ArithTraits::zero()) const { + if (beta == KokkosKernels::ArithTraits::zero()) KokkosBatched::SerialSpmv::template invoke( alpha, values, row_ptr, colIndices, X, beta, Y); else diff --git a/batched/sparse/src/KokkosBatched_JacobiPrec.hpp b/batched/sparse/src/KokkosBatched_JacobiPrec.hpp index 2afdcee07e..218fcef44f 100644 --- a/batched/sparse/src/KokkosBatched_JacobiPrec.hpp +++ b/batched/sparse/src/KokkosBatched_JacobiPrec.hpp @@ -30,7 +30,7 @@ template class JacobiPrec { public: using ScalarType = typename ValuesViewType::non_const_value_type; - using MagnitudeType = typename Kokkos::ArithTraits::mag_type; + using MagnitudeType = typename KokkosKernels::ArithTraits::mag_type; private: ValuesViewType diag_values; @@ -54,8 +54,8 @@ class JacobiPrec { template KOKKOS_INLINE_FUNCTION void computeInverse(const MemberType &member) const { - auto one = Kokkos::ArithTraits::one(); - auto epsilon = Kokkos::ArithTraits::epsilon(); + auto one = KokkosKernels::ArithTraits::one(); + auto epsilon = KokkosKernels::ArithTraits::epsilon(); int tooSmall = 0; if (std::is_same::value) { for (int i = 0; i < n_operators; ++i) @@ -111,8 +111,8 @@ class JacobiPrec { } KOKKOS_INLINE_FUNCTION void computeInverse() const { - auto one = Kokkos::ArithTraits::one(); - auto epsilon = Kokkos::ArithTraits::epsilon(); + auto one = KokkosKernels::ArithTraits::one(); + auto epsilon = KokkosKernels::ArithTraits::epsilon(); int tooSmall = 0; for (int i = 0; i < n_operators; ++i) diff --git a/batched/sparse/src/KokkosBatched_Krylov_Handle.hpp b/batched/sparse/src/KokkosBatched_Krylov_Handle.hpp index 89d36c1046..7a0848acc3 100644 --- a/batched/sparse/src/KokkosBatched_Krylov_Handle.hpp +++ b/batched/sparse/src/KokkosBatched_Krylov_Handle.hpp @@ -85,7 +85,7 @@ class KrylovHandle { batched_size(_batched_size), N_team_(N_team), monitor_residual(_monitor_residual) { - tolerance = Kokkos::ArithTraits::epsilon(); + tolerance = KokkosKernels::ArithTraits::epsilon(); max_tolerance = 1e-30; if (std::is_same::value) max_tolerance = 1e-50; if (monitor_residual) { diff --git a/batched/sparse/src/KokkosBatched_Spmv.hpp b/batched/sparse/src/KokkosBatched_Spmv.hpp index 72b923eeb8..a2d5efe1b6 100644 --- a/batched/sparse/src/KokkosBatched_Spmv.hpp +++ b/batched/sparse/src/KokkosBatched_Spmv.hpp @@ -72,9 +72,9 @@ struct SerialSpmv { template KOKKOS_INLINE_FUNCTION static int invoke( - const typename Kokkos::ArithTraits::mag_type &alpha, + const typename KokkosKernels::ArithTraits::mag_type &alpha, const ValuesViewType &values, const IntView &row_ptr, const IntView &colIndices, const xViewType &X, - const typename Kokkos::ArithTraits::mag_type &beta, + const typename KokkosKernels::ArithTraits::mag_type &beta, const yViewType &Y); }; @@ -130,9 +130,9 @@ struct TeamSpmv { template KOKKOS_INLINE_FUNCTION static int invoke( const MemberType &member, - const typename Kokkos::ArithTraits::mag_type &alpha, + const typename KokkosKernels::ArithTraits::mag_type &alpha, const ValuesViewType &values, const IntView &row_ptr, const IntView &colIndices, const xViewType &x, - const typename Kokkos::ArithTraits::mag_type &beta, + const typename KokkosKernels::ArithTraits::mag_type &beta, const yViewType &y); }; @@ -189,9 +189,9 @@ struct TeamVectorSpmv { template KOKKOS_INLINE_FUNCTION static int invoke( const MemberType &member, - const typename Kokkos::ArithTraits::mag_type &alpha, + const typename KokkosKernels::ArithTraits::mag_type &alpha, const ValuesViewType &values, const IntView &row_ptr, const IntView &colIndices, const xViewType &x, - const typename Kokkos::ArithTraits::mag_type &beta, + const typename KokkosKernels::ArithTraits::mag_type &beta, const yViewType &y); }; @@ -252,9 +252,9 @@ struct Spmv { template KOKKOS_INLINE_FUNCTION static int invoke( const MemberType &member, - const typename Kokkos::ArithTraits::mag_type &alpha, + const typename KokkosKernels::ArithTraits::mag_type &alpha, const ValuesViewType &values, const IntView &row_ptr, const IntView &colIndices, const xViewType &x, - const typename Kokkos::ArithTraits::mag_type &beta, + const typename KokkosKernels::ArithTraits::mag_type &beta, const yViewType &y) { int r_val = 0; if (std::is_same::value) { diff --git a/batched/sparse/unit_test/Test_Batched_SerialGMRES.hpp b/batched/sparse/unit_test/Test_Batched_SerialGMRES.hpp index f0892ffcb4..60ba967ade 100644 --- a/batched/sparse/unit_test/Test_Batched_SerialGMRES.hpp +++ b/batched/sparse/unit_test/Test_Batched_SerialGMRES.hpp @@ -94,7 +94,7 @@ struct Functor_TestBatchedSerialGMRES { template void impl_test_batched_GMRES(const int N, const int BlkSize, const int N_team) { typedef typename ValuesViewType::value_type value_type; - typedef Kokkos::ArithTraits ats; + typedef KokkosKernels::ArithTraits ats; const int nnz = (BlkSize - 2) * 3 + 2 * 2; @@ -110,7 +110,7 @@ void impl_test_batched_GMRES(const int N, const int BlkSize, const int N_team) { using Layout = typename ValuesViewType::array_layout; using EXSP = typename ValuesViewType::execution_space; - using MagnitudeType = typename Kokkos::ArithTraits::mag_type; + using MagnitudeType = typename KokkosKernels::ArithTraits::mag_type; using NormViewType = Kokkos::View; using Norm2DViewType = Kokkos::View; diff --git a/batched/sparse/unit_test/Test_Batched_SerialSpmv.hpp b/batched/sparse/unit_test/Test_Batched_SerialSpmv.hpp index 2f32b6294a..e06726ca82 100644 --- a/batched/sparse/unit_test/Test_Batched_SerialSpmv.hpp +++ b/batched/sparse/unit_test/Test_Batched_SerialSpmv.hpp @@ -83,7 +83,7 @@ template void impl_test_batched_spmv(const int N, const int BlkSize) { typedef typename ValuesViewType::value_type value_type; - typedef Kokkos::ArithTraits ats; + typedef KokkosKernels::ArithTraits ats; const int nnz = (BlkSize - 2) * 3 + 2 * 2; diff --git a/batched/sparse/unit_test/Test_Batched_TeamCG.hpp b/batched/sparse/unit_test/Test_Batched_TeamCG.hpp index c05472a64a..21974108e4 100644 --- a/batched/sparse/unit_test/Test_Batched_TeamCG.hpp +++ b/batched/sparse/unit_test/Test_Batched_TeamCG.hpp @@ -83,7 +83,7 @@ struct Functor_TestBatchedTeamCG { template void impl_test_batched_CG(const int N, const int BlkSize, const int N_team) { typedef typename ValuesViewType::value_type value_type; - typedef Kokkos::ArithTraits ats; + typedef KokkosKernels::ArithTraits ats; const int nnz = (BlkSize - 2) * 3 + 2 * 2; @@ -98,7 +98,7 @@ void impl_test_batched_CG(const int N, const int BlkSize, const int N_team) { using Layout = typename ValuesViewType::array_layout; using EXSP = typename ValuesViewType::execution_space; - using MagnitudeType = typename Kokkos::ArithTraits::mag_type; + using MagnitudeType = typename KokkosKernels::ArithTraits::mag_type; using NormViewType = Kokkos::View; using Norm2DViewType = Kokkos::View; diff --git a/batched/sparse/unit_test/Test_Batched_TeamGMRES.hpp b/batched/sparse/unit_test/Test_Batched_TeamGMRES.hpp index 03b55a802e..84a6824ef2 100644 --- a/batched/sparse/unit_test/Test_Batched_TeamGMRES.hpp +++ b/batched/sparse/unit_test/Test_Batched_TeamGMRES.hpp @@ -115,7 +115,7 @@ struct Functor_TestBatchedTeamGMRES { template void impl_test_batched_GMRES(const int N, const int BlkSize, const int N_team) { typedef typename ValuesViewType::value_type value_type; - typedef Kokkos::ArithTraits ats; + typedef KokkosKernels::ArithTraits ats; const int nnz = (BlkSize - 2) * 3 + 2 * 2; @@ -131,7 +131,7 @@ void impl_test_batched_GMRES(const int N, const int BlkSize, const int N_team) { using Layout = typename ValuesViewType::array_layout; using EXSP = typename ValuesViewType::execution_space; - using MagnitudeType = typename Kokkos::ArithTraits::mag_type; + using MagnitudeType = typename KokkosKernels::ArithTraits::mag_type; using NormViewType = Kokkos::View; using Norm2DViewType = Kokkos::View; diff --git a/batched/sparse/unit_test/Test_Batched_TeamSpmv.hpp b/batched/sparse/unit_test/Test_Batched_TeamSpmv.hpp index 228bd01afa..d1b7048bff 100644 --- a/batched/sparse/unit_test/Test_Batched_TeamSpmv.hpp +++ b/batched/sparse/unit_test/Test_Batched_TeamSpmv.hpp @@ -91,7 +91,7 @@ template void impl_test_batched_spmv(const int N, const int BlkSize, const int N_team) { typedef typename ValuesViewType::value_type value_type; - typedef Kokkos::ArithTraits ats; + typedef KokkosKernels::ArithTraits ats; const int nnz = (BlkSize - 2) * 3 + 2 * 2; diff --git a/batched/sparse/unit_test/Test_Batched_TeamVectorCG.hpp b/batched/sparse/unit_test/Test_Batched_TeamVectorCG.hpp index 71d58cf104..ebbfeca0a8 100644 --- a/batched/sparse/unit_test/Test_Batched_TeamVectorCG.hpp +++ b/batched/sparse/unit_test/Test_Batched_TeamVectorCG.hpp @@ -83,7 +83,7 @@ struct Functor_TestBatchedTeamVectorCG { template void impl_test_batched_CG(const int N, const int BlkSize, const int N_team) { typedef typename ValuesViewType::value_type value_type; - typedef Kokkos::ArithTraits ats; + typedef KokkosKernels::ArithTraits ats; const int nnz = (BlkSize - 2) * 3 + 2 * 2; @@ -98,7 +98,7 @@ void impl_test_batched_CG(const int N, const int BlkSize, const int N_team) { using Layout = typename ValuesViewType::array_layout; using EXSP = typename ValuesViewType::execution_space; - using MagnitudeType = typename Kokkos::ArithTraits::mag_type; + using MagnitudeType = typename KokkosKernels::ArithTraits::mag_type; using NormViewType = Kokkos::View; using Norm2DViewType = Kokkos::View; diff --git a/batched/sparse/unit_test/Test_Batched_TeamVectorGMRES.hpp b/batched/sparse/unit_test/Test_Batched_TeamVectorGMRES.hpp index 299f089cef..8358c5a5ac 100644 --- a/batched/sparse/unit_test/Test_Batched_TeamVectorGMRES.hpp +++ b/batched/sparse/unit_test/Test_Batched_TeamVectorGMRES.hpp @@ -115,7 +115,7 @@ struct Functor_TestBatchedTeamVectorGMRES { template void impl_test_batched_GMRES(const int N, const int BlkSize, const int N_team) { typedef typename ValuesViewType::value_type value_type; - typedef Kokkos::ArithTraits ats; + typedef KokkosKernels::ArithTraits ats; const int nnz = (BlkSize - 2) * 3 + 2 * 2; @@ -131,7 +131,7 @@ void impl_test_batched_GMRES(const int N, const int BlkSize, const int N_team) { using Layout = typename ValuesViewType::array_layout; using EXSP = typename ValuesViewType::execution_space; - using MagnitudeType = typename Kokkos::ArithTraits::mag_type; + using MagnitudeType = typename KokkosKernels::ArithTraits::mag_type; using NormViewType = Kokkos::View; using Norm2DViewType = Kokkos::View; diff --git a/batched/sparse/unit_test/Test_Batched_TeamVectorSpmv.hpp b/batched/sparse/unit_test/Test_Batched_TeamVectorSpmv.hpp index 83a78228b3..4f992e61aa 100644 --- a/batched/sparse/unit_test/Test_Batched_TeamVectorSpmv.hpp +++ b/batched/sparse/unit_test/Test_Batched_TeamVectorSpmv.hpp @@ -98,7 +98,7 @@ template void impl_test_batched_spmv(const int N, const int BlkSize, const int N_team) { typedef typename ValuesViewType::value_type value_type; - typedef Kokkos::ArithTraits ats; + typedef KokkosKernels::ArithTraits ats; const int nnz = (BlkSize - 2) * 3 + 2 * 2; diff --git a/benchmarks/blas/KokkosBlas2_ger_benchmark.cpp b/benchmarks/blas/KokkosBlas2_ger_benchmark.cpp index 45ed24c231..2d132a8f1e 100644 --- a/benchmarks/blas/KokkosBlas2_ger_benchmark.cpp +++ b/benchmarks/blas/KokkosBlas2_ger_benchmark.cpp @@ -114,12 +114,12 @@ static void KokkosBlas2_GER(benchmark::State& state) { const auto m = state.range(1); const auto n = state.range(2); const auto yIsTranspose = state.range(3); - tScalar a(Kokkos::ArithTraits::zero()); + tScalar a(KokkosKernels::ArithTraits::zero()); if (verbosity > 0) { std::cout << "Entering KokkosBlas2_GER()" << ": m = " << m << ", n = " << n << ", yIsTranspose = " << yIsTranspose - << ", tScalar = " << Kokkos::ArithTraits::name() << ", tLayout = " << typeid(tLayout).name() + << ", tScalar = " << KokkosKernels::ArithTraits::name() << ", tLayout = " << typeid(tLayout).name() << std::endl; } @@ -135,11 +135,11 @@ static void KokkosBlas2_GER(benchmark::State& state) { char yMode('t'); if (!yIsTranspose) yMode = 'H'; - tScalar rangeValue(Kokkos::ArithTraits::zero()); - if constexpr (Kokkos::ArithTraits::isOrdinal) { + tScalar rangeValue(KokkosKernels::ArithTraits::zero()); + if constexpr (KokkosKernels::ArithTraits::isOrdinal) { rangeValue = 10; a = 3; - } else if constexpr (Kokkos::ArithTraits::is_complex) { + } else if constexpr (KokkosKernels::ArithTraits::is_complex) { rangeValue.real() = 10.; rangeValue.imag() = 10.; a = tScalar(2.5, 3.6); diff --git a/benchmarks/ode/KokkosODE_BDF.cpp b/benchmarks/ode/KokkosODE_BDF.cpp index 771b46e9dd..21993224f1 100644 --- a/benchmarks/ode/KokkosODE_BDF.cpp +++ b/benchmarks/ode/KokkosODE_BDF.cpp @@ -103,7 +103,7 @@ struct bdf_input_parameters { template void run_ode_chem(benchmark::State& state, const bdf_input_parameters& inputs) { using scalar_type = double; - using KAT = Kokkos::ArithTraits; + using KAT = KokkosKernels::ArithTraits; using vec_type = Kokkos::View; using mat_type = Kokkos::View; diff --git a/benchmarks/sparse/KokkosSparse_par_ilut.cpp b/benchmarks/sparse/KokkosSparse_par_ilut.cpp index a33a938428..274b0e7fff 100644 --- a/benchmarks/sparse/KokkosSparse_par_ilut.cpp +++ b/benchmarks/sparse/KokkosSparse_par_ilut.cpp @@ -68,7 +68,7 @@ using ValuesType = Kokkos::View; using sp_matrix_type = KokkosSparse::CrsMatrix; using KernelHandle = KokkosKernels::Experimental::KokkosKernelsHandle; -using float_t = typename Kokkos::ArithTraits::mag_type; +using float_t = typename KokkosKernels::ArithTraits::mag_type; /////////////////////////////////////////////////////////////////////////////// void run_par_ilut_test(benchmark::State& state, KernelHandle& kh, const sp_matrix_type& A, int& num_iters) diff --git a/benchmarks/sparse/KokkosSparse_spmv_bsr_benchmark.cpp b/benchmarks/sparse/KokkosSparse_spmv_bsr_benchmark.cpp index 0245ac7670..21cc642550 100644 --- a/benchmarks/sparse/KokkosSparse_spmv_bsr_benchmark.cpp +++ b/benchmarks/sparse/KokkosSparse_spmv_bsr_benchmark.cpp @@ -128,9 +128,9 @@ void check_correctness(benchmark::State &state, const View &y_exp, const View &y const Alpha &alpha, const Beta &beta, const DieOnError &die, const SkipOnError &skip) { using execution_space = typename View::execution_space; using scalar_type = typename View::non_const_value_type; - using AT = Kokkos::ArithTraits; + using AT = KokkosKernels::ArithTraits; using mag_type = typename AT::mag_type; - using ATM = Kokkos::ArithTraits; + using ATM = KokkosKernels::ArithTraits; // max value in A mag_type maxA = 0; @@ -318,8 +318,8 @@ void register_expand_type(const fs::path &path) { for (size_t bs : {4, 7, 10, 16}) { // block sizes for (size_t k : ks) { // multivector sizes std::string name = std::string("MatrixMarketExpanded") + "/" + std::string(path.stem()) + "/" + - Kokkos::ArithTraits::name() + "/" + Kokkos::ArithTraits::name() + "/" + - Kokkos::ArithTraits::name() + "/" + std::to_string(bs) + "/" + std::to_string(k) + + KokkosKernels::ArithTraits::name() + "/" + KokkosKernels::ArithTraits::name() + "/" + + KokkosKernels::ArithTraits::name() + "/" + std::to_string(bs) + "/" + std::to_string(k) + "/" + Spmv::name() + "/" + Device::name(); benchmark::RegisterBenchmark(name.c_str(), read_expand_run, path, bs, k)->UseRealTime(); } @@ -333,8 +333,8 @@ void register_convert_type(const fs::path &path, size_t bs) { for (size_t k : ks) { // multivector sizes std::string name = std::string("MatrixMarketConvert") + "/" + std::string(path.stem()) + "/" + - Kokkos::ArithTraits::name() + "/" + Kokkos::ArithTraits::name() + "/" + - Kokkos::ArithTraits::name() + "/" + std::to_string(bs) + "/" + std::to_string(k) + "/" + + KokkosKernels::ArithTraits::name() + "/" + KokkosKernels::ArithTraits::name() + "/" + + KokkosKernels::ArithTraits::name() + "/" + std::to_string(bs) + "/" + std::to_string(k) + "/" + Spmv::name() + "/" + Device::name(); benchmark::RegisterBenchmark(name.c_str(), read_convert_run, path, bs, k)->UseRealTime(); } diff --git a/blas/impl/KokkosBlas1_abs_impl.hpp b/blas/impl/KokkosBlas1_abs_impl.hpp index 181708e94f..5091e709ca 100644 --- a/blas/impl/KokkosBlas1_abs_impl.hpp +++ b/blas/impl/KokkosBlas1_abs_impl.hpp @@ -31,7 +31,7 @@ namespace Impl { template struct MV_Abs_Functor { typedef SizeType size_type; - typedef Kokkos::ArithTraits ATS; + typedef KokkosKernels::ArithTraits ATS; const size_type numCols; RMV R_; @@ -67,7 +67,7 @@ struct MV_Abs_Functor { template struct MV_AbsSelf_Functor { typedef SizeType size_type; - typedef Kokkos::ArithTraits ATS; + typedef KokkosKernels::ArithTraits ATS; const size_type numCols; RMV R_; @@ -96,7 +96,7 @@ struct MV_AbsSelf_Functor { template struct V_Abs_Functor { typedef SizeType size_type; - typedef Kokkos::ArithTraits ATS; + typedef KokkosKernels::ArithTraits ATS; RV R_; XV X_; @@ -125,7 +125,7 @@ struct V_Abs_Functor { template struct V_AbsSelf_Functor { typedef SizeType size_type; - typedef Kokkos::ArithTraits ATS; + typedef KokkosKernels::ArithTraits ATS; RV R_; diff --git a/blas/impl/KokkosBlas1_axpby_impl.hpp b/blas/impl/KokkosBlas1_axpby_impl.hpp index 6baed662cf..400fbe5a39 100644 --- a/blas/impl/KokkosBlas1_axpby_impl.hpp +++ b/blas/impl/KokkosBlas1_axpby_impl.hpp @@ -60,7 +60,7 @@ template ATS; + typedef KokkosKernels::ArithTraits ATS; XV m_x; YV m_y; @@ -115,8 +115,8 @@ struct Axpby_Functor { } else if constexpr (scalar_y == 1) { // Nothing to do: m_y(i) = m_y(i); } else if constexpr (scalar_y == 2) { - if (m_b(0) == Kokkos::ArithTraits::zero()) { - m_y(i) = Kokkos::ArithTraits::zero(); + if (m_b(0) == KokkosKernels::ArithTraits::zero()) { + m_y(i) = KokkosKernels::ArithTraits::zero(); } else { m_y(i) = m_b(0) * m_y(i); } @@ -133,7 +133,7 @@ struct Axpby_Functor { } else if constexpr (scalar_y == 1) { m_y(i) = -m_x(i) + m_y(i); } else if constexpr (scalar_y == 2) { - if (m_b(0) == Kokkos::ArithTraits::zero()) { + if (m_b(0) == KokkosKernels::ArithTraits::zero()) { m_y(i) = -m_x(i); } else { m_y(i) = -m_x(i) + m_b(0) * m_y(i); @@ -151,7 +151,7 @@ struct Axpby_Functor { } else if constexpr (scalar_y == 1) { m_y(i) = m_x(i) + m_y(i); } else if constexpr (scalar_y == 2) { - if (m_b(0) == Kokkos::ArithTraits::zero()) { + if (m_b(0) == KokkosKernels::ArithTraits::zero()) { m_y(i) = m_x(i); } else { m_y(i) = m_x(i) + m_b(0) * m_y(i); @@ -169,7 +169,7 @@ struct Axpby_Functor { } else if constexpr (scalar_y == 1) { m_y(i) = m_a(0) * m_x(i) + m_y(i); } else if constexpr (scalar_y == 2) { - if (m_b(0) == Kokkos::ArithTraits::zero()) { + if (m_b(0) == KokkosKernels::ArithTraits::zero()) { m_y(i) = m_a(0) * m_x(i); } else { m_y(i) = m_a(0) * m_x(i) + m_b(0) * m_y(i); @@ -200,7 +200,7 @@ struct Axpby_Functor { typedef typename YV::execution_space execution_space; typedef SizeType size_type; - typedef Kokkos::ArithTraits ATS; + typedef KokkosKernels::ArithTraits ATS; XV m_x; YV m_y; diff --git a/blas/impl/KokkosBlas1_axpby_mv_impl.hpp b/blas/impl/KokkosBlas1_axpby_mv_impl.hpp index 81c05fe7df..519fc15b65 100644 --- a/blas/impl/KokkosBlas1_axpby_mv_impl.hpp +++ b/blas/impl/KokkosBlas1_axpby_mv_impl.hpp @@ -44,7 +44,7 @@ template struct Axpby_MV_Functor { typedef SizeType size_type; - typedef Kokkos::ArithTraits ATS; + typedef KokkosKernels::ArithTraits ATS; const size_type numCols; XMV m_x; @@ -121,7 +121,7 @@ struct Axpby_MV_Functor { // Nothing to do: Y(i,j) := Y(i,j) } else if constexpr (scalar_y == 2) { if (m_b.extent(0) == 1) { - if (m_b(0) == Kokkos::ArithTraits::zero()) { + if (m_b(0) == KokkosKernels::ArithTraits::zero()) { #ifdef KOKKOS_ENABLE_PRAGMA_IVDEP #pragma ivdep #endif @@ -129,7 +129,7 @@ struct Axpby_MV_Functor { #pragma vector always #endif for (size_type k = 0; k < numCols; ++k) { - m_y(i, k) = Kokkos::ArithTraits::zero(); + m_y(i, k) = KokkosKernels::ArithTraits::zero(); } } else { #ifdef KOKKOS_ENABLE_PRAGMA_IVDEP @@ -191,7 +191,7 @@ struct Axpby_MV_Functor { } } else if constexpr (scalar_y == 2) { if (m_b.extent(0) == 1) { - if (m_b(0) == Kokkos::ArithTraits::zero()) { + if (m_b(0) == KokkosKernels::ArithTraits::zero()) { #ifdef KOKKOS_ENABLE_PRAGMA_IVDEP #pragma ivdep #endif @@ -261,7 +261,7 @@ struct Axpby_MV_Functor { } } else if constexpr (scalar_y == 2) { if (m_b.extent(0) == 1) { - if (m_b(0) == Kokkos::ArithTraits::zero()) { + if (m_b(0) == KokkosKernels::ArithTraits::zero()) { #ifdef KOKKOS_ENABLE_PRAGMA_IVDEP #pragma ivdep #endif @@ -368,7 +368,7 @@ struct Axpby_MV_Functor { } else if constexpr (scalar_y == 2) { if (m_a.extent(0) == 1) { if (m_b.extent(0) == 1) { - if (m_b(0) == Kokkos::ArithTraits::zero()) { + if (m_b(0) == KokkosKernels::ArithTraits::zero()) { #ifdef KOKKOS_ENABLE_PRAGMA_IVDEP #pragma ivdep #endif @@ -402,7 +402,7 @@ struct Axpby_MV_Functor { } } else { if (m_b.extent(0) == 1) { - if (m_b(0) == Kokkos::ArithTraits::zero()) { + if (m_b(0) == KokkosKernels::ArithTraits::zero()) { #ifdef KOKKOS_ENABLE_PRAGMA_IVDEP #pragma ivdep #endif @@ -462,7 +462,7 @@ template struct Axpby_MV_Functor { typedef SizeType size_type; - typedef Kokkos::ArithTraits ATS; + typedef KokkosKernels::ArithTraits ATS; const size_type numCols; XMV m_x; @@ -684,7 +684,7 @@ struct Axpby_MV_Functor struct Axpby_MV_Unroll_Functor { typedef SizeType size_type; - typedef Kokkos::ArithTraits ATS; + typedef KokkosKernels::ArithTraits ATS; XMV m_x; YMV m_y; @@ -763,12 +763,12 @@ struct Axpby_MV_Unroll_Functor { // Nothing to do: Y(i,j) := Y(i,j) } else if constexpr (scalar_y == 2) { if (m_b.extent(0) == 1) { - if (m_b(0) == Kokkos::ArithTraits::zero()) { + if (m_b(0) == KokkosKernels::ArithTraits::zero()) { #ifdef KOKKOS_ENABLE_PRAGMA_UNROLL #pragma unroll #endif for (int k = 0; k < UNROLL; ++k) { - m_y(i, k) = Kokkos::ArithTraits::zero(); + m_y(i, k) = KokkosKernels::ArithTraits::zero(); } } else { #ifdef KOKKOS_ENABLE_PRAGMA_UNROLL @@ -815,7 +815,7 @@ struct Axpby_MV_Unroll_Functor { } } else if constexpr (scalar_y == 2) { if (m_b.extent(0) == 1) { - if (m_b(0) == Kokkos::ArithTraits::zero()) { + if (m_b(0) == KokkosKernels::ArithTraits::zero()) { #ifdef KOKKOS_ENABLE_PRAGMA_UNROLL #pragma unroll #endif @@ -867,7 +867,7 @@ struct Axpby_MV_Unroll_Functor { } } else if constexpr (scalar_y == 2) { if (m_b.extent(0) == 1) { - if (m_b(0) == Kokkos::ArithTraits::zero()) { + if (m_b(0) == KokkosKernels::ArithTraits::zero()) { #ifdef KOKKOS_ENABLE_PRAGMA_UNROLL #pragma unroll #endif @@ -947,7 +947,7 @@ struct Axpby_MV_Unroll_Functor { } else if constexpr (scalar_y == 2) { if (m_a.extent(0) == 1) { if (m_b.extent(0) == 1) { - if (m_b(0) == Kokkos::ArithTraits::zero()) { + if (m_b(0) == KokkosKernels::ArithTraits::zero()) { #ifdef KOKKOS_ENABLE_PRAGMA_UNROLL #pragma unroll #endif @@ -972,7 +972,7 @@ struct Axpby_MV_Unroll_Functor { } } else { if (m_b.extent(0) == 1) { - if (m_b(0) == Kokkos::ArithTraits::zero()) { + if (m_b(0) == KokkosKernels::ArithTraits::zero()) { #ifdef KOKKOS_ENABLE_PRAGMA_UNROLL #pragma unroll #endif @@ -1008,7 +1008,7 @@ template { typedef SizeType size_type; - typedef Kokkos::ArithTraits ATS; + typedef KokkosKernels::ArithTraits ATS; XMV m_x; YMV m_y; diff --git a/blas/impl/KokkosBlas1_axpby_spec.hpp b/blas/impl/KokkosBlas1_axpby_spec.hpp index 37d3ccd562..017435ca69 100644 --- a/blas/impl/KokkosBlas1_axpby_spec.hpp +++ b/blas/impl/KokkosBlas1_axpby_spec.hpp @@ -200,7 +200,7 @@ struct Axpby; + using ATA = KokkosKernels::ArithTraits; if (av == ATA::zero()) { scalar_x = 0; } else if (av == -ATA::one()) { @@ -218,7 +218,7 @@ struct Axpby; + using ATB = KokkosKernels::ArithTraits; if (bv == ATB::zero()) { scalar_y = 0; } else if (bv == -ATB::one()) { @@ -260,8 +260,8 @@ struct Axpby; - using ATB = Kokkos::ArithTraits; + using ATA = KokkosKernels::ArithTraits; + using ATB = KokkosKernels::ArithTraits; static void axpby(const execution_space& space, const AV& alpha, const XMV& X, const BV& beta, const YMV& Y) { static_assert(Kokkos::is_view::value, @@ -360,7 +360,7 @@ struct Axpby; + using ATA = KokkosKernels::ArithTraits; if (av == ATA::zero()) { scalar_x = 0; } else if (av == -ATA::one()) { @@ -378,7 +378,7 @@ struct Axpby; + using ATB = KokkosKernels::ArithTraits; if (bv == ATB::zero()) { scalar_y = 0; } else if (bv == -ATB::one()) { @@ -413,8 +413,8 @@ struct Axpby; - using ATB = Kokkos::ArithTraits; + using ATA = KokkosKernels::ArithTraits; + using ATB = KokkosKernels::ArithTraits; static void axpby(const execution_space& space, const AV& alpha, const XV& X, const BV& beta, const YV& Y) { static_assert(Kokkos::is_view::value, diff --git a/blas/impl/KokkosBlas1_axpby_unification_attempt_traits.hpp b/blas/impl/KokkosBlas1_axpby_unification_attempt_traits.hpp index a0baedb674..e84bbab0c1 100644 --- a/blas/impl/KokkosBlas1_axpby_unification_attempt_traits.hpp +++ b/blas/impl/KokkosBlas1_axpby_unification_attempt_traits.hpp @@ -191,8 +191,8 @@ struct AxpbyUnificationAttemptTraits { using InternalLayoutA = std::conditional_t<(a_is_r1d || a_is_r1s) && atInputLayoutA_isStride, AtInputLayoutA, InternalLayoutX>; - static constexpr bool atInputScalarTypeA_mustRemain = Kokkos::ArithTraits::is_complex && - !Kokkos::ArithTraits::is_complex; + static constexpr bool atInputScalarTypeA_mustRemain = KokkosKernels::ArithTraits::is_complex && + !KokkosKernels::ArithTraits::is_complex; using InternalScalarTypeA = std::conditional_t; - static constexpr bool atInputScalarTypeB_mustRemain = Kokkos::ArithTraits::is_complex && - !Kokkos::ArithTraits::is_complex; + static constexpr bool atInputScalarTypeB_mustRemain = KokkosKernels::ArithTraits::is_complex && + !KokkosKernels::ArithTraits::is_complex; using InternalScalarTypeB = std::conditional_t::is_complex) { - static_assert((!Kokkos::ArithTraits::is_complex) && - (!Kokkos::ArithTraits::is_complex) && - (!Kokkos::ArithTraits::is_complex), + if constexpr (!KokkosKernels::ArithTraits::is_complex) { + static_assert((!KokkosKernels::ArithTraits::is_complex) && + (!KokkosKernels::ArithTraits::is_complex) && + (!KokkosKernels::ArithTraits::is_complex), "KokkosBlas::Impl::AxpbyUnificationAttemptTraits::performChecks()" ": if Y is not complex, then A, X and B cannot be complex"); } @@ -659,7 +659,7 @@ struct AxpbyUnificationAttemptTraits { // typeid(AV::non_const_data_type).name() << ", AtInputScalarTypeA = " << typeid(AtInputScalarTypeA).name() << ", isConst = " << std::is_const_v << ", isComplex = " - << Kokkos::ArithTraits::is_complex + << KokkosKernels::ArithTraits::is_complex << ", AtInputScalarTypeA_nonConst = " << typeid(AtInputScalarTypeA_nonConst).name() << ", InternalTypeA = " << typeid(InternalTypeA).name() << "\n" << ", InternalTypeA_managed = " << typeid(InternalTypeA_managed).name() << "\n" @@ -670,7 +670,7 @@ struct AxpbyUnificationAttemptTraits { << "XMV::non_const_data_type = " << typeid(typename XMV::non_const_data_type).name() << "\n" << "AtInputScalarTypeX = " << typeid(AtInputScalarTypeX).name() << "\n" << "isConst = " << std::is_const_v << "\n" - << "isComplex = " << Kokkos::ArithTraits::is_complex << "\n" + << "isComplex = " << KokkosKernels::ArithTraits::is_complex << "\n" << "AtInputScalarTypeX_nonConst = " << typeid(AtInputScalarTypeX_nonConst).name() << "\n" << "InternalTypeX = " << typeid(InternalTypeX).name() << "\n" << "\n" @@ -681,7 +681,7 @@ struct AxpbyUnificationAttemptTraits { // typeid(BV::non_const_data_type).name() << ", AtInputScalarTypeB = " << typeid(AtInputScalarTypeB).name() << ", isConst = " << std::is_const_v << ", isComplex = " - << Kokkos::ArithTraits::is_complex + << KokkosKernels::ArithTraits::is_complex << ", AtInputScalarTypeB_nonConst = " << typeid(AtInputScalarTypeB_nonConst).name() << ", InternalTypeB = " << typeid(InternalTypeB).name() << "\n" << ", InternalTypeB_managed = " << typeid(InternalTypeB_managed).name() << "\n" @@ -692,7 +692,7 @@ struct AxpbyUnificationAttemptTraits { << "YMV::non_const_data_type = " << typeid(typename YMV::non_const_data_type).name() << "\n" << "AtInputScalarTypeY = " << typeid(AtInputScalarTypeY).name() << "\n" << "isConst = " << std::is_const_v << "\n" - << "isComplex = " << Kokkos::ArithTraits::is_complex << "\n" + << "isComplex = " << KokkosKernels::ArithTraits::is_complex << "\n" << "AtInputScalarTypeY_nonConst = " << typeid(AtInputScalarTypeY_nonConst).name() << "\n" << "InternalTypeY = " << typeid(InternalTypeY).name() << "\n" << std::endl; diff --git a/blas/impl/KokkosBlas1_dot_impl.hpp b/blas/impl/KokkosBlas1_dot_impl.hpp index 64c2e67e93..a4a4652c06 100644 --- a/blas/impl/KokkosBlas1_dot_impl.hpp +++ b/blas/impl/KokkosBlas1_dot_impl.hpp @@ -52,7 +52,7 @@ struct DotFunctor { Kokkos::Details::updateDot(sum, m_x(i), m_y(i)); // sum += m_x(i) * m_y(i) } - KOKKOS_INLINE_FUNCTION void init(value_type& update) const { update = Kokkos::ArithTraits::zero(); } + KOKKOS_INLINE_FUNCTION void init(value_type& update) const { update = KokkosKernels::ArithTraits::zero(); } KOKKOS_INLINE_FUNCTION void join(value_type& update, const value_type& source) const { update += source; } }; diff --git a/blas/impl/KokkosBlas1_dot_mv_impl.hpp b/blas/impl/KokkosBlas1_dot_mv_impl.hpp index 15db366ceb..c14da4d0d5 100644 --- a/blas/impl/KokkosBlas1_dot_mv_impl.hpp +++ b/blas/impl/KokkosBlas1_dot_mv_impl.hpp @@ -30,7 +30,7 @@ struct Dot_MV_Functor { using Scalar = typename RV::non_const_value_type; using IPT = Kokkos::Details::InnerProductSpaceTraits; using dot_type = typename IPT::dot_type; - using KAT = Kokkos::ArithTraits; + using KAT = KokkosKernels::ArithTraits; using TeamMem = typename Kokkos::TeamPolicy::member_type; @@ -94,7 +94,7 @@ void MV_Dot_Invoke( throw std::runtime_error(oss.str()); } // Zero out the result vector - Kokkos::deep_copy(space, r, Kokkos::ArithTraits::zero()); + Kokkos::deep_copy(space, r, KokkosKernels::ArithTraits::zero()); size_type teamsPerDot; KokkosBlas::Impl::multipleReductionWorkDistribution(x.extent(0), numDots, teamsPerDot); size_type numTeams = numDots * teamsPerDot; diff --git a/blas/impl/KokkosBlas1_dot_spec.hpp b/blas/impl/KokkosBlas1_dot_spec.hpp index 54370de0c2..05a936ee22 100644 --- a/blas/impl/KokkosBlas1_dot_spec.hpp +++ b/blas/impl/KokkosBlas1_dot_spec.hpp @@ -341,7 +341,7 @@ struct Dot::one()) { + if (numDots == KokkosKernels::ArithTraits::one()) { auto R0 = Kokkos::subview(R, 0); auto X0 = getFirstColumn(X); auto Y0 = getFirstColumn(Y); diff --git a/blas/impl/KokkosBlas1_iamax_impl.hpp b/blas/impl/KokkosBlas1_iamax_impl.hpp index 118a84f691..60db194941 100644 --- a/blas/impl/KokkosBlas1_iamax_impl.hpp +++ b/blas/impl/KokkosBlas1_iamax_impl.hpp @@ -75,7 +75,7 @@ struct V_Iamax_Functor { /// View) X, and store the result in the 0-D View r. template void V_Iamax_Invoke(const execution_space& space, const RV& r, const XV& X) { - using AT = Kokkos::ArithTraits; + using AT = KokkosKernels::ArithTraits; using mag_type = typename AT::mag_type; const SizeType numRows = static_cast(X.extent(0)); diff --git a/blas/impl/KokkosBlas1_mult_impl.hpp b/blas/impl/KokkosBlas1_mult_impl.hpp index 3584240e70..4b2c882984 100644 --- a/blas/impl/KokkosBlas1_mult_impl.hpp +++ b/blas/impl/KokkosBlas1_mult_impl.hpp @@ -37,7 +37,7 @@ namespace Impl { template struct MV_MultFunctor { typedef SizeType size_type; - typedef Kokkos::ArithTraits ATS; + typedef KokkosKernels::ArithTraits ATS; const size_type m_n; typename CMV::const_value_type m_c; @@ -103,7 +103,7 @@ struct MV_MultFunctor { template struct V_MultFunctor { typedef SizeType size_type; - typedef Kokkos::ArithTraits ATS; + typedef KokkosKernels::ArithTraits ATS; typename CV::const_value_type m_c; CV m_C; @@ -147,8 +147,8 @@ void V_Mult_Generic(const execution_space& space, typename CV::const_value_type& typename AV::const_value_type& ab, const AV& A, const BV& B) { using Kokkos::ALL; using Kokkos::subview; - typedef Kokkos::ArithTraits ATA; - typedef Kokkos::ArithTraits ATC; + typedef KokkosKernels::ArithTraits ATA; + typedef KokkosKernels::ArithTraits ATC; const SizeType numRows = C.extent(0); Kokkos::RangePolicy policy(space, 0, numRows); @@ -190,8 +190,8 @@ void V_Mult_Generic(const execution_space& space, typename CV::const_value_type& template void MV_Mult_Generic(const execution_space& space, typename CMV::const_value_type& c, const CMV& C, typename AV::const_value_type& ab, const AV& A, const BMV& B) { - typedef Kokkos::ArithTraits ATA; - typedef Kokkos::ArithTraits ATC; + typedef KokkosKernels::ArithTraits ATA; + typedef KokkosKernels::ArithTraits ATC; if (C.extent(1) == 1) { auto C_0 = Kokkos::subview(C, Kokkos::ALL(), 0); diff --git a/blas/impl/KokkosBlas1_nrm1_impl.hpp b/blas/impl/KokkosBlas1_nrm1_impl.hpp index 8ba857c9e9..1dd82aec09 100644 --- a/blas/impl/KokkosBlas1_nrm1_impl.hpp +++ b/blas/impl/KokkosBlas1_nrm1_impl.hpp @@ -37,9 +37,9 @@ template struct V_Nrm1_Functor { using size_type = SizeType; using xvalue_type = typename XV::non_const_value_type; - using XAT = Kokkos::ArithTraits; + using XAT = KokkosKernels::ArithTraits; using value_type = typename XAT::mag_type; - using MAT = Kokkos::ArithTraits; + using MAT = KokkosKernels::ArithTraits; typename XV::const_type m_x; @@ -70,9 +70,9 @@ template struct Nrm1_MV_Functor { using rvalue_type = typename RV::non_const_value_type; using xvalue_type = typename XV::non_const_value_type; - using XAT = Kokkos::ArithTraits; + using XAT = KokkosKernels::ArithTraits; using value_type = typename XAT::mag_type; - using MAT = Kokkos::ArithTraits; + using MAT = KokkosKernels::ArithTraits; using TeamMem = typename Kokkos::TeamPolicy::member_type; @@ -132,7 +132,7 @@ void MV_Nrm1_Invoke( throw std::runtime_error(oss.str()); } // Zero out the result vector - Kokkos::deep_copy(space, r, Kokkos::ArithTraits::zero()); + Kokkos::deep_copy(space, r, KokkosKernels::ArithTraits::zero()); size_type teamsPerVec; KokkosBlas::Impl::multipleReductionWorkDistribution(x.extent(0), x.extent(1), teamsPerVec); diff --git a/blas/impl/KokkosBlas1_nrm1_spec.hpp b/blas/impl/KokkosBlas1_nrm1_spec.hpp index 25eeae5ee2..0ca30ab549 100644 --- a/blas/impl/KokkosBlas1_nrm1_spec.hpp +++ b/blas/impl/KokkosBlas1_nrm1_spec.hpp @@ -159,7 +159,7 @@ struct Nrm1::one()) { + if (numCols == KokkosKernels::ArithTraits::one()) { auto R0 = Kokkos::subview(R, 0); auto X0 = Kokkos::subview(X, Kokkos::ALL(), 0); if (numRows < static_cast(INT_MAX)) { diff --git a/blas/impl/KokkosBlas1_nrm2_impl.hpp b/blas/impl/KokkosBlas1_nrm2_impl.hpp index e840d0bfd4..814ab13f28 100644 --- a/blas/impl/KokkosBlas1_nrm2_impl.hpp +++ b/blas/impl/KokkosBlas1_nrm2_impl.hpp @@ -38,7 +38,7 @@ struct V_Nrm2_Functor { typedef SizeType size_type; typedef typename XV::non_const_value_type xvalue_type; typedef Kokkos::Details::InnerProductSpaceTraits IPT; - typedef Kokkos::ArithTraits AT; + typedef KokkosKernels::ArithTraits AT; typedef typename IPT::mag_type value_type; typename XV::const_type m_x; @@ -71,7 +71,7 @@ struct V_Nrm2_Functor { KOKKOS_INLINE_FUNCTION void join(value_type& update, const value_type& source) const { update += source; } KOKKOS_INLINE_FUNCTION void final(value_type& update) const { - if (m_take_sqrt) update = Kokkos::ArithTraits::sqrt(update); + if (m_take_sqrt) update = KokkosKernels::ArithTraits::sqrt(update); } }; @@ -86,7 +86,7 @@ struct Nrm2_MV_Functor { typedef typename RV::non_const_value_type rvalue_type; typedef typename XV::non_const_value_type xvalue_type; typedef Kokkos::Details::InnerProductSpaceTraits IPT; - typedef Kokkos::ArithTraits AT; + typedef KokkosKernels::ArithTraits AT; typedef typename IPT::mag_type value_type; using TeamMem = typename Kokkos::TeamPolicy::member_type; @@ -149,7 +149,7 @@ void MV_Nrm2_Invoke( throw std::runtime_error(oss.str()); } // Zero out the result vector - Kokkos::deep_copy(space, r, Kokkos::ArithTraits::zero()); + Kokkos::deep_copy(space, r, KokkosKernels::ArithTraits::zero()); size_type teamsPerVec; KokkosBlas::Impl::multipleReductionWorkDistribution(x.extent(0), x.extent(1), teamsPerVec); diff --git a/blas/impl/KokkosBlas1_nrm2_spec.hpp b/blas/impl/KokkosBlas1_nrm2_spec.hpp index b13290cc1e..07cc2336c6 100644 --- a/blas/impl/KokkosBlas1_nrm2_spec.hpp +++ b/blas/impl/KokkosBlas1_nrm2_spec.hpp @@ -159,7 +159,7 @@ struct Nrm2::one()) { + if (numCols == KokkosKernels::ArithTraits::one()) { auto R0 = Kokkos::subview(R, 0); auto X0 = Kokkos::subview(X, Kokkos::ALL(), 0); if (numRows < static_cast(INT_MAX)) { diff --git a/blas/impl/KokkosBlas1_nrm2w_impl.hpp b/blas/impl/KokkosBlas1_nrm2w_impl.hpp index 1017439993..39957a11cb 100644 --- a/blas/impl/KokkosBlas1_nrm2w_impl.hpp +++ b/blas/impl/KokkosBlas1_nrm2w_impl.hpp @@ -40,7 +40,7 @@ struct V_Nrm2w_Functor { typedef SizeType size_type; typedef typename XV::non_const_value_type xvalue_type; typedef Kokkos::Details::InnerProductSpaceTraits IPT; - typedef Kokkos::ArithTraits AT; + typedef KokkosKernels::ArithTraits AT; typedef typename IPT::mag_type value_type; typename XV::const_type m_x, m_w; @@ -73,7 +73,7 @@ struct V_Nrm2w_Functor { KOKKOS_INLINE_FUNCTION void join(value_type& update, const value_type& source) const { update += source; } KOKKOS_INLINE_FUNCTION void final(value_type& update) const { - if (m_take_sqrt) update = Kokkos::ArithTraits::sqrt(update); + if (m_take_sqrt) update = KokkosKernels::ArithTraits::sqrt(update); } }; @@ -82,7 +82,7 @@ struct Nrm2w_MV_Functor { typedef typename RV::non_const_value_type rvalue_type; typedef typename XV::non_const_value_type xvalue_type; typedef Kokkos::Details::InnerProductSpaceTraits IPT; - typedef Kokkos::ArithTraits AT; + typedef KokkosKernels::ArithTraits AT; typedef typename IPT::mag_type value_type; using TeamMem = typename Kokkos::TeamPolicy::member_type; @@ -146,7 +146,7 @@ void MV_Nrm2w_Invoke( throw std::runtime_error(oss.str()); } // Zero out the result vector - Kokkos::deep_copy(space, r, Kokkos::ArithTraits::zero()); + Kokkos::deep_copy(space, r, KokkosKernels::ArithTraits::zero()); size_type teamsPerVec; KokkosBlas::Impl::multipleReductionWorkDistribution(x.extent(0), x.extent(1), teamsPerVec); diff --git a/blas/impl/KokkosBlas1_nrminf_impl.hpp b/blas/impl/KokkosBlas1_nrminf_impl.hpp index e7479e6697..ad17004a41 100644 --- a/blas/impl/KokkosBlas1_nrminf_impl.hpp +++ b/blas/impl/KokkosBlas1_nrminf_impl.hpp @@ -38,7 +38,7 @@ struct V_NrmInf_Functor { typedef SizeType size_type; typedef typename XV::non_const_value_type xvalue_type; typedef Kokkos::Details::InnerProductSpaceTraits IPT; - typedef Kokkos::ArithTraits AT; + typedef KokkosKernels::ArithTraits AT; typedef typename IPT::mag_type value_type; typename XV::const_type m_x; @@ -70,7 +70,7 @@ struct V_NrmInf_Functor { /// View) X, and store the result in the 0-D View r. template void V_NrmInf_Invoke(const execution_space& space, const RV& r, const XV& X) { - typedef Kokkos::ArithTraits AT; + typedef KokkosKernels::ArithTraits AT; const SizeType numRows = static_cast(X.extent(0)); diff --git a/blas/impl/KokkosBlas1_reciprocal_impl.hpp b/blas/impl/KokkosBlas1_reciprocal_impl.hpp index 1c30520e8c..81bf222236 100644 --- a/blas/impl/KokkosBlas1_reciprocal_impl.hpp +++ b/blas/impl/KokkosBlas1_reciprocal_impl.hpp @@ -31,7 +31,7 @@ namespace Impl { template struct MV_Reciprocal_Functor { typedef SizeType size_type; - typedef Kokkos::ArithTraits ATS; + typedef KokkosKernels::ArithTraits ATS; const size_type numCols; RMV R_; @@ -77,7 +77,7 @@ struct MV_Reciprocal_Functor { template struct MV_ReciprocalSelf_Functor { typedef SizeType size_type; - typedef Kokkos::ArithTraits ATS; + typedef KokkosKernels::ArithTraits ATS; const size_type numCols; RMV R_; @@ -116,7 +116,7 @@ struct MV_ReciprocalSelf_Functor { template struct V_Reciprocal_Functor { typedef SizeType size_type; - typedef Kokkos::ArithTraits ATS; + typedef KokkosKernels::ArithTraits ATS; RV R_; XV X_; @@ -145,7 +145,7 @@ struct V_Reciprocal_Functor { template struct V_ReciprocalSelf_Functor { typedef SizeType size_type; - typedef Kokkos::ArithTraits ATS; + typedef KokkosKernels::ArithTraits ATS; RV R_; diff --git a/blas/impl/KokkosBlas1_rot_spec.hpp b/blas/impl/KokkosBlas1_rot_spec.hpp index e68c1dbdd4..41c8459b72 100644 --- a/blas/impl/KokkosBlas1_rot_spec.hpp +++ b/blas/impl/KokkosBlas1_rot_spec.hpp @@ -48,7 +48,7 @@ struct rot_eti_spec_avail { struct rot_eti_spec_avail< \ EXECSPACE, \ Kokkos::View, Kokkos::MemoryTraits>, \ - Kokkos::View::mag_type, LAYOUT, Kokkos::Device, \ + Kokkos::View::mag_type, LAYOUT, Kokkos::Device, \ Kokkos::MemoryTraits>, \ Kokkos::View, Kokkos::MemoryTraits>> { \ enum : bool { value = true }; \ @@ -107,7 +107,7 @@ struct Rot, Kokkos::MemoryTraits>, \ - Kokkos::View::mag_type, LAYOUT, Kokkos::Device, \ + Kokkos::View::mag_type, LAYOUT, Kokkos::Device, \ Kokkos::MemoryTraits>, \ Kokkos::View, Kokkos::MemoryTraits>, \ false, true>; @@ -121,7 +121,7 @@ struct Rot, Kokkos::MemoryTraits>, \ - Kokkos::View::mag_type, LAYOUT, Kokkos::Device, \ + Kokkos::View::mag_type, LAYOUT, Kokkos::Device, \ Kokkos::MemoryTraits>, \ Kokkos::View, Kokkos::MemoryTraits>, \ false, true>; diff --git a/blas/impl/KokkosBlas1_rotg_impl.hpp b/blas/impl/KokkosBlas1_rotg_impl.hpp index 834c773a8d..0a4bfd2b24 100644 --- a/blas/impl/KokkosBlas1_rotg_impl.hpp +++ b/blas/impl/KokkosBlas1_rotg_impl.hpp @@ -24,10 +24,10 @@ namespace KokkosBlas { namespace Impl { template ::is_complex, bool>::type = true> + typename std::enable_if::is_complex, bool>::type = true> KOKKOS_INLINE_FUNCTION void rotg_impl(Scalar* a, Scalar* b, Magnitude* c, Scalar* s) { - const Scalar one = Kokkos::ArithTraits::one(); - const Scalar zero = Kokkos::ArithTraits::zero(); + const Scalar one = KokkosKernels::ArithTraits::one(); + const Scalar zero = KokkosKernels::ArithTraits::zero(); const Scalar numerical_scaling = Kokkos::abs(*a) + Kokkos::abs(*b); if (numerical_scaling == zero) { @@ -57,13 +57,13 @@ KOKKOS_INLINE_FUNCTION void rotg_impl(Scalar* a, Scalar* b, Magnitude* c, Scalar } template ::is_complex, bool>::type = true> + typename std::enable_if::is_complex, bool>::type = true> KOKKOS_INLINE_FUNCTION void rotg_impl(Scalar* a, Scalar* b, Magnitude* c, Scalar* s) { - using mag_type = typename Kokkos::ArithTraits::mag_type; + using mag_type = typename KokkosKernels::ArithTraits::mag_type; - const Scalar one = Kokkos::ArithTraits::one(); - const Scalar zero = Kokkos::ArithTraits::zero(); - const mag_type mag_zero = Kokkos::ArithTraits::zero(); + const Scalar one = KokkosKernels::ArithTraits::one(); + const Scalar zero = KokkosKernels::ArithTraits::zero(); + const mag_type mag_zero = KokkosKernels::ArithTraits::zero(); const mag_type numerical_scaling = Kokkos::abs(*a) + Kokkos::abs(*b); if (Kokkos::abs(*a) == zero) { diff --git a/blas/impl/KokkosBlas1_rotg_spec.hpp b/blas/impl/KokkosBlas1_rotg_spec.hpp index 12752ab71c..b9f8a36ced 100644 --- a/blas/impl/KokkosBlas1_rotg_spec.hpp +++ b/blas/impl/KokkosBlas1_rotg_spec.hpp @@ -47,7 +47,7 @@ struct rotg_eti_spec_avail { struct rotg_eti_spec_avail< \ EXECSPACE, \ Kokkos::View, Kokkos::MemoryTraits>, \ - Kokkos::View::mag_type, LAYOUT, Kokkos::Device, \ + Kokkos::View::mag_type, LAYOUT, Kokkos::Device, \ Kokkos::MemoryTraits>> { \ enum : bool { value = true }; \ }; @@ -105,7 +105,7 @@ struct Rotg, Kokkos::MemoryTraits>, \ - Kokkos::View::mag_type, LAYOUT, Kokkos::Device, \ + Kokkos::View::mag_type, LAYOUT, Kokkos::Device, \ Kokkos::MemoryTraits>, \ false, true>; @@ -118,7 +118,7 @@ struct Rotg, Kokkos::MemoryTraits>, \ - Kokkos::View::mag_type, LAYOUT, Kokkos::Device, \ + Kokkos::View::mag_type, LAYOUT, Kokkos::Device, \ Kokkos::MemoryTraits>, \ false, true>; diff --git a/blas/impl/KokkosBlas1_rotm_impl.hpp b/blas/impl/KokkosBlas1_rotm_impl.hpp index 1f0b6daf9f..d410dbc267 100644 --- a/blas/impl/KokkosBlas1_rotm_impl.hpp +++ b/blas/impl/KokkosBlas1_rotm_impl.hpp @@ -63,10 +63,10 @@ struct rotm_functor { template void Rotm_Invoke(execution_space const& space, VectorView const& X, VectorView const& Y, ParamView const& param) { using Scalar = typename VectorView::value_type; - static_assert(!Kokkos::ArithTraits::is_complex, "rotm is not defined for complex types!"); + static_assert(!KokkosKernels::ArithTraits::is_complex, "rotm is not defined for complex types!"); - Scalar const zero = Kokkos::ArithTraits::zero(); - Scalar const one = Kokkos::ArithTraits::one(); + Scalar const zero = KokkosKernels::ArithTraits::zero(); + Scalar const one = KokkosKernels::ArithTraits::one(); Scalar const two = one + one; rotm_functor myFunc(X, Y, param); diff --git a/blas/impl/KokkosBlas1_rotmg_impl.hpp b/blas/impl/KokkosBlas1_rotmg_impl.hpp index 558020e5a4..1d0fb72a1d 100644 --- a/blas/impl/KokkosBlas1_rotmg_impl.hpp +++ b/blas/impl/KokkosBlas1_rotmg_impl.hpp @@ -29,8 +29,8 @@ KOKKOS_INLINE_FUNCTION void rotmg_impl(DXView const& d1, DXView const& d2, DXVie PView const& param) { using Scalar = typename DXView::non_const_value_type; - const Scalar one = Kokkos::ArithTraits::one(); - const Scalar zero = Kokkos::ArithTraits::zero(); + const Scalar one = KokkosKernels::ArithTraits::one(); + const Scalar zero = KokkosKernels::ArithTraits::zero(); const Scalar gamma = 4096; const Scalar gammasq = 4096 * 4096; @@ -191,7 +191,7 @@ template void Rotmg_Invoke(execution_space const& space, DXView const& d1, DXView const& d2, DXView const& x1, YView const& y1, PView const& param) { using Scalar = typename DXView::value_type; - static_assert(!Kokkos::ArithTraits::is_complex, "rotmg is not defined for complex types!"); + static_assert(!KokkosKernels::ArithTraits::is_complex, "rotmg is not defined for complex types!"); rotmg_functor myFunc(d1, d2, x1, y1, param); Kokkos::RangePolicy rotmg_policy(space, 0, 1); diff --git a/blas/impl/KokkosBlas1_scal_impl.hpp b/blas/impl/KokkosBlas1_scal_impl.hpp index 510ca3808f..0db22fc9c4 100644 --- a/blas/impl/KokkosBlas1_scal_impl.hpp +++ b/blas/impl/KokkosBlas1_scal_impl.hpp @@ -45,7 +45,7 @@ namespace Impl { template struct V_Scal_Functor { typedef SizeType size_type; - typedef Kokkos::ArithTraits ATS; + typedef KokkosKernels::ArithTraits ATS; RV m_r; XV m_x; @@ -93,7 +93,7 @@ struct V_Scal_Functor { template struct V_Scal_Functor { typedef SizeType size_type; - typedef Kokkos::ArithTraits ATS; + typedef KokkosKernels::ArithTraits ATS; RV m_r; XV m_x; diff --git a/blas/impl/KokkosBlas1_scal_mv_impl.hpp b/blas/impl/KokkosBlas1_scal_mv_impl.hpp index a729e85025..c7880143a4 100644 --- a/blas/impl/KokkosBlas1_scal_mv_impl.hpp +++ b/blas/impl/KokkosBlas1_scal_mv_impl.hpp @@ -45,7 +45,7 @@ namespace Impl { template struct MV_Scal_Functor { typedef SizeType size_type; - typedef Kokkos::ArithTraits ATS; + typedef KokkosKernels::ArithTraits ATS; const size_type numCols; RMV R_; @@ -123,7 +123,7 @@ struct MV_Scal_Functor { template struct MV_Scal_Functor { typedef SizeType size_type; - typedef Kokkos::ArithTraits ATS; + typedef KokkosKernels::ArithTraits ATS; const size_type numCols; RMV m_r; @@ -191,7 +191,7 @@ struct MV_Scal_Functor struct MV_Scal_Unroll_Functor { typedef SizeType size_type; - typedef Kokkos::ArithTraits ATS; + typedef KokkosKernels::ArithTraits ATS; RMV m_r; XMV m_x; @@ -248,7 +248,7 @@ struct MV_Scal_Unroll_Functor { template struct MV_Scal_Unroll_Functor { typedef SizeType size_type; - typedef Kokkos::ArithTraits ATS; + typedef KokkosKernels::ArithTraits ATS; RMV m_r; XMV m_x; diff --git a/blas/impl/KokkosBlas1_scal_spec.hpp b/blas/impl/KokkosBlas1_scal_spec.hpp index a52e9a3b61..44ba103cc5 100644 --- a/blas/impl/KokkosBlas1_scal_spec.hpp +++ b/blas/impl/KokkosBlas1_scal_spec.hpp @@ -107,7 +107,7 @@ template struct Scal { typedef typename XV::non_const_value_type AV; typedef typename XV::size_type size_type; - typedef Kokkos::ArithTraits ATA; + typedef KokkosKernels::ArithTraits ATA; static void scal(const execution_space& space, const RV& R, const AV& alpha, const XV& X) { static_assert(Kokkos::is_view::value, @@ -164,7 +164,7 @@ struct Scal struct Scal { typedef typename XMV::size_type size_type; - typedef Kokkos::ArithTraits ATA; + typedef KokkosKernels::ArithTraits ATA; static void scal(const execution_space& space, const RMV& R, const AV& av, const XMV& X) { static_assert(Kokkos::is_view::value, @@ -221,7 +221,7 @@ struct Scal { typedef typename XMV::non_const_value_type AV; typedef typename XMV::size_type size_type; - typedef Kokkos::ArithTraits ATA; + typedef KokkosKernels::ArithTraits ATA; static void scal(const execution_space& space, const RMV& R, const AV& alpha, const XMV& X) { static_assert(Kokkos::is_view::value, diff --git a/blas/impl/KokkosBlas1_sum_impl.hpp b/blas/impl/KokkosBlas1_sum_impl.hpp index 222982dc24..32aceb1f64 100644 --- a/blas/impl/KokkosBlas1_sum_impl.hpp +++ b/blas/impl/KokkosBlas1_sum_impl.hpp @@ -39,7 +39,7 @@ struct V_Sum_Functor { typedef SizeType size_type; typedef typename XV::non_const_value_type xvalue_type; typedef Kokkos::Details::InnerProductSpaceTraits IPT; - typedef Kokkos::ArithTraits AT; + typedef KokkosKernels::ArithTraits AT; typedef typename RV::non_const_value_type value_type; typename XV::const_type m_x; @@ -67,7 +67,7 @@ struct V_Sum_Functor { template struct Sum_MV_Functor { typedef typename RV::non_const_value_type value_type; - typedef Kokkos::ArithTraits AT; + typedef KokkosKernels::ArithTraits AT; using TeamMem = typename Kokkos::TeamPolicy::member_type; @@ -124,7 +124,7 @@ void MV_Sum_Invoke( throw std::runtime_error(oss.str()); } // Zero out the result vector - Kokkos::deep_copy(space, r, Kokkos::ArithTraits::zero()); + Kokkos::deep_copy(space, r, KokkosKernels::ArithTraits::zero()); size_type teamsPerVec; KokkosBlas::Impl::multipleReductionWorkDistribution(x.extent(0), x.extent(1), teamsPerVec); diff --git a/blas/impl/KokkosBlas1_sum_spec.hpp b/blas/impl/KokkosBlas1_sum_spec.hpp index 2ade8b49a1..9634b91a2d 100644 --- a/blas/impl/KokkosBlas1_sum_spec.hpp +++ b/blas/impl/KokkosBlas1_sum_spec.hpp @@ -158,7 +158,7 @@ struct Sum::one()) { + if (numCols == KokkosKernels::ArithTraits::one()) { auto R0 = Kokkos::subview(R, 0); auto X0 = Kokkos::subview(X, Kokkos::ALL(), 0); if (numRows < static_cast(INT_MAX)) { diff --git a/blas/impl/KokkosBlas1_team_abs_spec.hpp b/blas/impl/KokkosBlas1_team_abs_spec.hpp index a5140a9b34..28a0c4bcc4 100644 --- a/blas/impl/KokkosBlas1_team_abs_spec.hpp +++ b/blas/impl/KokkosBlas1_team_abs_spec.hpp @@ -34,14 +34,14 @@ struct team_abs_tpl_spec_avail { // Unification and Specialization layer template ::value> struct TeamAbs { - typedef Kokkos::ArithTraits ATS; + typedef KokkosKernels::ArithTraits ATS; static KOKKOS_INLINE_FUNCTION void team_abs(const TeamType& team, const RV& R, const XV& X); }; template struct TeamAbs { - typedef Kokkos::ArithTraits ATS; + typedef KokkosKernels::ArithTraits ATS; static KOKKOS_INLINE_FUNCTION void team_abs(const TeamType& team, const RV& R, const XV& X) { int N = X.extent(0); diff --git a/blas/impl/KokkosBlas1_team_dot_spec.hpp b/blas/impl/KokkosBlas1_team_dot_spec.hpp index 5c5e4ea85d..0d423f7d10 100644 --- a/blas/impl/KokkosBlas1_team_dot_spec.hpp +++ b/blas/impl/KokkosBlas1_team_dot_spec.hpp @@ -46,7 +46,7 @@ struct TeamDot { typedef typename IPT::dot_type dot_type; static KOKKOS_INLINE_FUNCTION dot_type team_dot(const TeamType& team, const XV& X, const YV& Y) { - dot_type result = 0.0; // Kokkos::ArithTraitszero(); + dot_type result = 0.0; // KokkosKernels::ArithTraitszero(); int N = X.extent(0); Kokkos::parallel_reduce( Kokkos::TeamThreadRange(team, N), diff --git a/blas/impl/KokkosBlas1_team_nrm2_spec.hpp b/blas/impl/KokkosBlas1_team_nrm2_spec.hpp index bf486d88e8..7a3f127da7 100644 --- a/blas/impl/KokkosBlas1_team_nrm2_spec.hpp +++ b/blas/impl/KokkosBlas1_team_nrm2_spec.hpp @@ -36,7 +36,7 @@ template ::mag_type mag_type; typedef Kokkos::Details::InnerProductSpaceTraits IPT; - typedef Kokkos::ArithTraits AT; + typedef KokkosKernels::ArithTraits AT; static KOKKOS_INLINE_FUNCTION mag_type team_nrm2(const TeamType& team, const XV& X); }; @@ -45,10 +45,10 @@ template struct TeamNrm2 { typedef typename Kokkos::Details::InnerProductSpaceTraits::mag_type mag_type; typedef Kokkos::Details::InnerProductSpaceTraits IPT; - typedef Kokkos::ArithTraits AT; + typedef KokkosKernels::ArithTraits AT; static KOKKOS_INLINE_FUNCTION mag_type team_nrm2(const TeamType& team, const XV& X) { - mag_type result = 0.0; // Kokkos::ArithTraitszero(); + mag_type result = 0.0; // KokkosKernels::ArithTraitszero(); int N = X.extent(0); Kokkos::parallel_reduce( Kokkos::TeamThreadRange(team, N), diff --git a/blas/impl/KokkosBlas1_update_impl.hpp b/blas/impl/KokkosBlas1_update_impl.hpp index 31502bee8b..06d6aa3ad3 100644 --- a/blas/impl/KokkosBlas1_update_impl.hpp +++ b/blas/impl/KokkosBlas1_update_impl.hpp @@ -44,7 +44,7 @@ template struct MV_Update_Functor { typedef SizeType size_type; - typedef Kokkos::ArithTraits ATS; + typedef KokkosKernels::ArithTraits ATS; const size_type numCols; const typename XMV::non_const_value_type alpha_; @@ -202,7 +202,7 @@ template struct V_Update_Functor { typedef SizeType size_type; - typedef Kokkos::ArithTraits ATS; + typedef KokkosKernels::ArithTraits ATS; const size_type numCols; const typename XV::non_const_value_type alpha_; diff --git a/blas/impl/KokkosBlas1_update_spec.hpp b/blas/impl/KokkosBlas1_update_spec.hpp index 131ace8c25..75b0f5549a 100644 --- a/blas/impl/KokkosBlas1_update_spec.hpp +++ b/blas/impl/KokkosBlas1_update_spec.hpp @@ -108,9 +108,9 @@ struct Update { template struct Update { typedef typename XMV::size_type size_type; - typedef Kokkos::ArithTraits ATA; - typedef Kokkos::ArithTraits ATB; - typedef Kokkos::ArithTraits ATC; + typedef KokkosKernels::ArithTraits ATA; + typedef KokkosKernels::ArithTraits ATB; + typedef KokkosKernels::ArithTraits ATC; static void update(const execution_space& space, const typename XMV::non_const_value_type& alpha, const XMV& X, const typename YMV::non_const_value_type& beta, const YMV& Y, @@ -202,9 +202,9 @@ struct Update struct Update { typedef typename XV::size_type size_type; - typedef Kokkos::ArithTraits ATA; - typedef Kokkos::ArithTraits ATB; - typedef Kokkos::ArithTraits ATC; + typedef KokkosKernels::ArithTraits ATA; + typedef KokkosKernels::ArithTraits ATB; + typedef KokkosKernels::ArithTraits ATC; static void update(const execution_space& space, const typename XV::non_const_value_type& alpha, const XV& X, const typename YV::non_const_value_type& beta, const YV& Y, diff --git a/blas/impl/KokkosBlas2_gemv_impl.hpp b/blas/impl/KokkosBlas2_gemv_impl.hpp index 6ae3c90582..566110285c 100644 --- a/blas/impl/KokkosBlas2_gemv_impl.hpp +++ b/blas/impl/KokkosBlas2_gemv_impl.hpp @@ -60,7 +60,7 @@ struct SingleLevelNontransposeGEMV { KOKKOS_INLINE_FUNCTION void operator()(const IndexType& i) const { AccumScalar y_i; if (betaPreset == 0) { - y_i = Kokkos::ArithTraits::zero(); + y_i = KokkosKernels::ArithTraits::zero(); } else if (betaPreset == 1) { y_i = AccumScalar(y_(i)); } else { // beta_ != 0 and beta != 1 @@ -135,7 +135,7 @@ struct SingleLevelTransposeGEMV { public: KOKKOS_INLINE_FUNCTION void init(value_type y_cur) const { for (IndexType j = 0; j < value_count; ++j) { - y_cur[j] = Kokkos::ArithTraits::zero(); + y_cur[j] = KokkosKernels::ArithTraits::zero(); } } @@ -156,7 +156,7 @@ struct SingleLevelTransposeGEMV { } KOKKOS_INLINE_FUNCTION void operator()(const IndexType& i, value_type y_cur) const { - using Kokkos::ArithTraits; + using KokkosKernels::ArithTraits; using KAT = ArithTraits; const auto x_i = x_(i); @@ -203,9 +203,9 @@ void singleLevelGemv(const ExecutionSpace& space, const char trans[], typename A // depend on that or its implementation details. Instead, we reuse // an instantiation of the non-transpose case for alpha=0. if (A.extent(0) == 0 && (tr != 'N' && tr != 'n')) { - if (beta == Kokkos::ArithTraits::zero()) { - Kokkos::deep_copy(y, Kokkos::ArithTraits::zero()); - } else if (beta != Kokkos::ArithTraits::one()) { + if (beta == KokkosKernels::ArithTraits::zero()) { + Kokkos::deep_copy(y, KokkosKernels::ArithTraits::zero()); + } else if (beta != KokkosKernels::ArithTraits::one()) { // "Fake out" a scal() by using the non-transpose alpha=0, // general beta case. This assumes that the functor doesn't // check dimensions. @@ -217,23 +217,23 @@ void singleLevelGemv(const ExecutionSpace& space, const char trans[], typename A } if (tr == 'N' || tr == 'n') { - if (alpha == Kokkos::ArithTraits::zero()) { - if (beta == Kokkos::ArithTraits::zero()) { + if (alpha == KokkosKernels::ArithTraits::zero()) { + if (beta == KokkosKernels::ArithTraits::zero()) { // Fill y with zeros - Kokkos::deep_copy(y, Kokkos::ArithTraits::zero()); - } else if (beta == Kokkos::ArithTraits::one()) { + Kokkos::deep_copy(y, KokkosKernels::ArithTraits::zero()); + } else if (beta == KokkosKernels::ArithTraits::one()) { // Do nothing (y := 1 * y) } else { // beta != 0 && beta != 1 using functor_type = SingleLevelNontransposeGEMV; functor_type functor(alpha, A, x, beta, y); Kokkos::parallel_for("KokkosBlas::gemv[SingleLevel]", range, functor); } - } else if (alpha == Kokkos::ArithTraits::one()) { - if (beta == Kokkos::ArithTraits::zero()) { + } else if (alpha == KokkosKernels::ArithTraits::one()) { + if (beta == KokkosKernels::ArithTraits::zero()) { using functor_type = SingleLevelNontransposeGEMV; functor_type functor(alpha, A, x, beta, y); Kokkos::parallel_for("KokkosBlas::gemv[SingleLevel]", range, functor); - } else if (beta == Kokkos::ArithTraits::one()) { + } else if (beta == KokkosKernels::ArithTraits::one()) { using functor_type = SingleLevelNontransposeGEMV; functor_type functor(alpha, A, x, beta, y); Kokkos::parallel_for("KokkosBlas::gemv[SingleLevel]", range, functor); @@ -243,11 +243,11 @@ void singleLevelGemv(const ExecutionSpace& space, const char trans[], typename A Kokkos::parallel_for("KokkosBlas::gemv[SingleLevel]", range, functor); } } else { // alpha != 0 and alpha != 1 - if (beta == Kokkos::ArithTraits::zero()) { + if (beta == KokkosKernels::ArithTraits::zero()) { using functor_type = SingleLevelNontransposeGEMV; functor_type functor(alpha, A, x, beta, y); Kokkos::parallel_for("KokkosBlas::gemv[SingleLevel]", range, functor); - } else if (beta == Kokkos::ArithTraits::one()) { + } else if (beta == KokkosKernels::ArithTraits::one()) { using functor_type = SingleLevelNontransposeGEMV; functor_type functor(alpha, A, x, beta, y); Kokkos::parallel_for("KokkosBlas::gemv[SingleLevel]", range, functor); @@ -258,23 +258,23 @@ void singleLevelGemv(const ExecutionSpace& space, const char trans[], typename A } } } else if (tr == 'T' || tr == 't') { // transpose, no conjugate - if (alpha == Kokkos::ArithTraits::zero()) { - if (beta == Kokkos::ArithTraits::zero()) { + if (alpha == KokkosKernels::ArithTraits::zero()) { + if (beta == KokkosKernels::ArithTraits::zero()) { // Fill y with zeros - Kokkos::deep_copy(y, Kokkos::ArithTraits::zero()); - } else if (beta == Kokkos::ArithTraits::one()) { + Kokkos::deep_copy(y, KokkosKernels::ArithTraits::zero()); + } else if (beta == KokkosKernels::ArithTraits::one()) { // Do nothing (y := 1 * y) } else { // beta != 0 && beta != 1 using functor_type = SingleLevelTransposeGEMV; functor_type functor(alpha, A, x, beta, y); Kokkos::parallel_reduce("KokkosBlas::gemv[SingleLevelTranspose]", range, functor); } - } else if (alpha == Kokkos::ArithTraits::one()) { - if (beta == Kokkos::ArithTraits::zero()) { + } else if (alpha == KokkosKernels::ArithTraits::one()) { + if (beta == KokkosKernels::ArithTraits::zero()) { using functor_type = SingleLevelTransposeGEMV; functor_type functor(alpha, A, x, beta, y); Kokkos::parallel_reduce("KokkosBlas::gemv[SingleLevelTranspose]", range, functor); - } else if (beta == Kokkos::ArithTraits::one()) { + } else if (beta == KokkosKernels::ArithTraits::one()) { using functor_type = SingleLevelTransposeGEMV; functor_type functor(alpha, A, x, beta, y); Kokkos::parallel_reduce("KokkosBlas::gemv[SingleLevelTranspose]", range, functor); @@ -284,11 +284,11 @@ void singleLevelGemv(const ExecutionSpace& space, const char trans[], typename A Kokkos::parallel_reduce("KokkosBlas::gemv[SingleLevelTranspose]", range, functor); } } else { // alpha != 0 and alpha != 1 - if (beta == Kokkos::ArithTraits::zero()) { + if (beta == KokkosKernels::ArithTraits::zero()) { using functor_type = SingleLevelTransposeGEMV; functor_type functor(alpha, A, x, beta, y); Kokkos::parallel_reduce("KokkosBlas::gemv[SingleLevelTranspose]", range, functor); - } else if (beta == Kokkos::ArithTraits::one()) { + } else if (beta == KokkosKernels::ArithTraits::one()) { using functor_type = SingleLevelTransposeGEMV; functor_type functor(alpha, A, x, beta, y); Kokkos::parallel_reduce("KokkosBlas::gemv[SingleLevelTranspose]", range, functor); @@ -299,23 +299,23 @@ void singleLevelGemv(const ExecutionSpace& space, const char trans[], typename A } } } else if (tr == 'C' || tr == 'c' || tr == 'H' || tr == 'h') { // conj xpose - if (alpha == Kokkos::ArithTraits::zero()) { - if (beta == Kokkos::ArithTraits::zero()) { + if (alpha == KokkosKernels::ArithTraits::zero()) { + if (beta == KokkosKernels::ArithTraits::zero()) { // Fill y with zeros - Kokkos::deep_copy(y, Kokkos::ArithTraits::zero()); - } else if (beta == Kokkos::ArithTraits::one()) { + Kokkos::deep_copy(y, KokkosKernels::ArithTraits::zero()); + } else if (beta == KokkosKernels::ArithTraits::one()) { // Do nothing (y := 1 * y) } else { // beta != 0 && beta != 1 using functor_type = SingleLevelTransposeGEMV; functor_type functor(alpha, A, x, beta, y); Kokkos::parallel_reduce("KokkosBlas::gemv[SingleLevelTranspose]", range, functor); } - } else if (alpha == Kokkos::ArithTraits::one()) { - if (beta == Kokkos::ArithTraits::zero()) { + } else if (alpha == KokkosKernels::ArithTraits::one()) { + if (beta == KokkosKernels::ArithTraits::zero()) { using functor_type = SingleLevelTransposeGEMV; functor_type functor(alpha, A, x, beta, y); Kokkos::parallel_reduce("KokkosBlas::gemv[SingleLevelTranspose]", range, functor); - } else if (beta == Kokkos::ArithTraits::one()) { + } else if (beta == KokkosKernels::ArithTraits::one()) { using functor_type = SingleLevelTransposeGEMV; functor_type functor(alpha, A, x, beta, y); Kokkos::parallel_reduce("KokkosBlas::gemv[SingleLevelTranspose]", range, functor); @@ -325,11 +325,11 @@ void singleLevelGemv(const ExecutionSpace& space, const char trans[], typename A Kokkos::parallel_reduce("KokkosBlas::gemv[SingleLevelTranspose]", range, functor); } } else { // alpha != 0 and alpha != 1 - if (beta == Kokkos::ArithTraits::zero()) { + if (beta == KokkosKernels::ArithTraits::zero()) { using functor_type = SingleLevelTransposeGEMV; functor_type functor(alpha, A, x, beta, y); Kokkos::parallel_reduce("KokkosBlas::gemv[SingleLevelTranspose]", range, functor); - } else if (beta == Kokkos::ArithTraits::one()) { + } else if (beta == KokkosKernels::ArithTraits::one()) { using functor_type = SingleLevelTransposeGEMV; functor_type functor(alpha, A, x, beta, y); Kokkos::parallel_reduce("KokkosBlas::gemv[SingleLevelTranspose]", range, functor); @@ -380,8 +380,8 @@ struct TwoLevelGEMV { // results into shared. -Then individual thread results are combined with // parallel_reduce. KOKKOS_INLINE_FUNCTION void operator()(TwoLevelGEMV_LayoutLeftTag, const member_type& team) const { - using KAT = Kokkos::ArithTraits; - using AKAT = Kokkos::ArithTraits; + using KAT = KokkosKernels::ArithTraits; + using AKAT = KokkosKernels::ArithTraits; // Allocate a Scalar in shared for each thread AccumScalar* blockResult = (AccumScalar*)team.team_shmem().get_shmem(32 * sizeof(AccumScalar)); Kokkos::parallel_for(Kokkos::TeamThreadRange(team, 32), [&](int i) { blockResult[i] = AKAT::zero(); }); @@ -415,7 +415,7 @@ struct TwoLevelGEMV { // LayoutRight version: one team per row KOKKOS_INLINE_FUNCTION void operator()(TwoLevelGEMV_LayoutRightTag, const member_type& team) const { - using KAT = Kokkos::ArithTraits; + using KAT = KokkosKernels::ArithTraits; const IndexType N = A_.extent(1); const int i = team.league_rank(); // batch id @@ -477,7 +477,7 @@ struct TwoLevelTransposeGEMV { public: KOKKOS_INLINE_FUNCTION void operator()(const member_type& team) const { - using Kokkos::ArithTraits; + using KokkosKernels::ArithTraits; using KAT_A = ArithTraits; using KAT_Y = ArithTraits; @@ -530,7 +530,7 @@ void twoLevelGemv(const ExecutionSpace& space, const char trans[], typename AVie using team_policy_type = Kokkos::TeamPolicy; using range_policy_type = Kokkos::RangePolicy; - using Kokkos::ArithTraits; + using KokkosKernels::ArithTraits; using KAT = ArithTraits; using YKAT = ArithTraits; @@ -600,7 +600,7 @@ void twoLevelGemv(const ExecutionSpace& space, const char trans[], typename AVie } else { if (alpha == KAT::zero() && beta == KAT::zero()) { // Fill y with zeros - Kokkos::deep_copy(y, Kokkos::ArithTraits::zero()); + Kokkos::deep_copy(y, KokkosKernels::ArithTraits::zero()); } else if (alpha == KAT::zero() && beta == KAT::one()) { // Do nothing (y := 1 * y) } else if (tr == 'T') { diff --git a/blas/impl/KokkosBlas2_ger_impl.hpp b/blas/impl/KokkosBlas2_ger_impl.hpp index bfcff1fb0e..d320ddbdb5 100644 --- a/blas/impl/KokkosBlas2_ger_impl.hpp +++ b/blas/impl/KokkosBlas2_ger_impl.hpp @@ -41,7 +41,7 @@ struct ThreadParallelGER { } KOKKOS_INLINE_FUNCTION void operator()(const IndexType& i) const { - if (alpha_ == Kokkos::ArithTraits::zero()) { + if (alpha_ == KokkosKernels::ArithTraits::zero()) { // Nothing to do } else { const IndexType N(A_.extent(1)); @@ -53,7 +53,7 @@ struct ThreadParallelGER { } } else { for (IndexType j = 0; j < N; ++j) { - A_(i, j) += AComponentType(alpha_ * x_fixed * Kokkos::ArithTraits::conj(y_(j))); + A_(i, j) += AComponentType(alpha_ * x_fixed * KokkosKernels::ArithTraits::conj(y_(j))); } } } @@ -81,7 +81,7 @@ void threadParallelGer(const ExecutionSpace& space, const char trans[], // no entries to update } else if (x.extent(0) == 0) { // no entries to update - } else if (alpha == Kokkos::ArithTraits::zero()) { + } else if (alpha == KokkosKernels::ArithTraits::zero()) { // no entries to update } else { Kokkos::RangePolicy rangePolicy(space, 0, A.extent(0)); @@ -117,7 +117,7 @@ struct TeamParallelGER { public: // LayoutLeft version: one team per column KOKKOS_INLINE_FUNCTION void operator()(TeamParallelGER_LayoutLeftTag, const member_type& team) const { - if (alpha_ == Kokkos::ArithTraits::zero()) { + if (alpha_ == KokkosKernels::ArithTraits::zero()) { // Nothing to do } else { const IndexType M(A_.extent(0)); @@ -127,7 +127,7 @@ struct TeamParallelGER { Kokkos::parallel_for(Kokkos::TeamThreadRange(team, M), [&](const IndexType& i) { A_(i, j) += AComponentType(alpha_ * x_(i) * y_fixed); }); } else { - const YComponentType y_fixed(Kokkos::ArithTraits::conj(y_(j))); + const YComponentType y_fixed(KokkosKernels::ArithTraits::conj(y_(j))); Kokkos::parallel_for(Kokkos::TeamThreadRange(team, M), [&](const IndexType& i) { A_(i, j) += AComponentType(alpha_ * x_(i) * y_fixed); }); } @@ -136,7 +136,7 @@ struct TeamParallelGER { // LayoutRight version: one team per row KOKKOS_INLINE_FUNCTION void operator()(TeamParallelGER_LayoutRightTag, const member_type& team) const { - if (alpha_ == Kokkos::ArithTraits::zero()) { + if (alpha_ == KokkosKernels::ArithTraits::zero()) { // Nothing to do } else { const IndexType N(A_.extent(1)); @@ -147,7 +147,7 @@ struct TeamParallelGER { [&](const IndexType& j) { A_(i, j) += AComponentType(alpha_ * x_fixed * y_(j)); }); } else { Kokkos::parallel_for(Kokkos::TeamThreadRange(team, N), [&](const IndexType& j) { - A_(i, j) += AComponentType(alpha_ * x_fixed * Kokkos::ArithTraits::conj(y_(j))); + A_(i, j) += AComponentType(alpha_ * x_fixed * KokkosKernels::ArithTraits::conj(y_(j))); }); } } @@ -176,7 +176,7 @@ void teamParallelGer(const ExecutionSpace& space, const char trans[], const type } else if (x.extent(0) == 0) { // no entries to update return; - } else if (alpha == Kokkos::ArithTraits::zero()) { + } else if (alpha == KokkosKernels::ArithTraits::zero()) { // no entries to update return; } diff --git a/blas/impl/KokkosBlas2_syr2_impl.hpp b/blas/impl/KokkosBlas2_syr2_impl.hpp index 5f134c097d..5d056d2a73 100644 --- a/blas/impl/KokkosBlas2_syr2_impl.hpp +++ b/blas/impl/KokkosBlas2_syr2_impl.hpp @@ -40,10 +40,10 @@ struct ThreadParallelSYR2 { } KOKKOS_INLINE_FUNCTION void operator()(const IndexType& i) const { - if (alpha_ == Kokkos::ArithTraits::zero()) { + if (alpha_ == KokkosKernels::ArithTraits::zero()) { // Nothing to do - } else if ((x_(i) == Kokkos::ArithTraits::zero()) && - (y_(i) == Kokkos::ArithTraits::zero())) { + } else if ((x_(i) == KokkosKernels::ArithTraits::zero()) && + (y_(i) == KokkosKernels::ArithTraits::zero())) { // Nothing to do } else { const XComponentType x_fixed(x_(i)); @@ -51,14 +51,14 @@ struct ThreadParallelSYR2 { const IndexType N(A_.extent(1)); if constexpr (tJustTranspose) { - if (x_fixed != Kokkos::ArithTraits::zero()) { + if (x_fixed != KokkosKernels::ArithTraits::zero()) { for (IndexType j = 0; j < N; ++j) { if (((tJustUp == true) && (i <= j)) || ((tJustUp == false) && (i >= j))) { A_(i, j) += AComponentType(alpha_ * x_fixed * y_(j)); } } } - if (y_fixed != Kokkos::ArithTraits::zero()) { + if (y_fixed != KokkosKernels::ArithTraits::zero()) { for (IndexType j = 0; j < N; ++j) { if (((tJustUp == true) && (i <= j)) || ((tJustUp == false) && (i >= j))) { A_(i, j) += AComponentType(alpha_ * y_fixed * x_(j)); @@ -66,18 +66,18 @@ struct ThreadParallelSYR2 { } } } else { - if (x_fixed != Kokkos::ArithTraits::zero()) { + if (x_fixed != KokkosKernels::ArithTraits::zero()) { for (IndexType j = 0; j < N; ++j) { if (((tJustUp == true) && (i <= j)) || ((tJustUp == false) && (i >= j))) { - A_(i, j) += AComponentType(alpha_ * x_fixed * Kokkos::ArithTraits::conj(y_(j))); + A_(i, j) += AComponentType(alpha_ * x_fixed * KokkosKernels::ArithTraits::conj(y_(j))); } } } - if (y_fixed != Kokkos::ArithTraits::zero()) { + if (y_fixed != KokkosKernels::ArithTraits::zero()) { for (IndexType j = 0; j < N; ++j) { if (((tJustUp == true) && (i <= j)) || ((tJustUp == false) && (i >= j))) { - A_(i, j) += AComponentType(Kokkos::ArithTraits::conj(alpha_) * y_fixed * - Kokkos::ArithTraits::conj(x_(j))); + A_(i, j) += AComponentType(KokkosKernels::ArithTraits::conj(alpha_) * y_fixed * + KokkosKernels::ArithTraits::conj(x_(j))); } } } @@ -105,7 +105,7 @@ void threadParallelSyr2(const ExecutionSpace& space, const typename AViewType::c // no entries to update } else if (y.extent(0) == 0) { // no entries to update - } else if (alpha == Kokkos::ArithTraits::zero()) { + } else if (alpha == KokkosKernels::ArithTraits::zero()) { // no entries to update } else { Kokkos::RangePolicy rangePolicy(space, 0, A.extent(0)); @@ -140,26 +140,26 @@ struct TeamParallelSYR2 { public: // LayoutLeft version: one team per column KOKKOS_INLINE_FUNCTION void operator()(TeamParallelSYR2_LayoutLeftTag, const member_type& team) const { - if (alpha_ == Kokkos::ArithTraits::zero()) { + if (alpha_ == KokkosKernels::ArithTraits::zero()) { // Nothing to do } else { const IndexType j(team.league_rank()); - if ((x_(j) == Kokkos::ArithTraits::zero()) && - (y_(j) == Kokkos::ArithTraits::zero())) { + if ((x_(j) == KokkosKernels::ArithTraits::zero()) && + (y_(j) == KokkosKernels::ArithTraits::zero())) { // Nothing to do } else { const IndexType M(A_.extent(0)); if constexpr (tJustTranspose) { const XComponentType x_fixed(x_(j)); const YComponentType y_fixed(y_(j)); - if (y_fixed != Kokkos::ArithTraits::zero()) { + if (y_fixed != KokkosKernels::ArithTraits::zero()) { Kokkos::parallel_for(Kokkos::TeamThreadRange(team, M), [&](const IndexType& i) { if (((tJustUp == true) && (i <= j)) || ((tJustUp == false) && (i >= j))) { A_(i, j) += AComponentType(alpha_ * x_(i) * y_fixed); } }); } - if (x_fixed != Kokkos::ArithTraits::zero()) { + if (x_fixed != KokkosKernels::ArithTraits::zero()) { Kokkos::parallel_for(Kokkos::TeamThreadRange(team, M), [&](const IndexType& i) { if (((tJustUp == true) && (i <= j)) || ((tJustUp == false) && (i >= j))) { A_(i, j) += AComponentType(alpha_ * y_(i) * x_fixed); @@ -167,19 +167,19 @@ struct TeamParallelSYR2 { }); } } else { - const XComponentType x_fixed(Kokkos::ArithTraits::conj(x_(j))); - const YComponentType y_fixed(Kokkos::ArithTraits::conj(y_(j))); - if (y_fixed != Kokkos::ArithTraits::zero()) { + const XComponentType x_fixed(KokkosKernels::ArithTraits::conj(x_(j))); + const YComponentType y_fixed(KokkosKernels::ArithTraits::conj(y_(j))); + if (y_fixed != KokkosKernels::ArithTraits::zero()) { Kokkos::parallel_for(Kokkos::TeamThreadRange(team, M), [&](const IndexType& i) { if (((tJustUp == true) && (i <= j)) || ((tJustUp == false) && (i >= j))) { A_(i, j) += AComponentType(alpha_ * x_(i) * y_fixed); } }); } - if (x_fixed != Kokkos::ArithTraits::zero()) { + if (x_fixed != KokkosKernels::ArithTraits::zero()) { Kokkos::parallel_for(Kokkos::TeamThreadRange(team, M), [&](const IndexType& i) { if (((tJustUp == true) && (i <= j)) || ((tJustUp == false) && (i >= j))) { - A_(i, j) += AComponentType(Kokkos::ArithTraits::conj(alpha_) * y_(i) * x_fixed); + A_(i, j) += AComponentType(KokkosKernels::ArithTraits::conj(alpha_) * y_(i) * x_fixed); } }); } @@ -190,26 +190,26 @@ struct TeamParallelSYR2 { // LayoutRight version: one team per row KOKKOS_INLINE_FUNCTION void operator()(TeamParallelSYR2_LayoutRightTag, const member_type& team) const { - if (alpha_ == Kokkos::ArithTraits::zero()) { + if (alpha_ == KokkosKernels::ArithTraits::zero()) { // Nothing to do } else { const IndexType i(team.league_rank()); - if ((x_(i) == Kokkos::ArithTraits::zero()) && - (y_(i) == Kokkos::ArithTraits::zero())) { + if ((x_(i) == KokkosKernels::ArithTraits::zero()) && + (y_(i) == KokkosKernels::ArithTraits::zero())) { // Nothing to do } else { const IndexType N(A_.extent(1)); const XComponentType x_fixed(x_(i)); const YComponentType y_fixed(y_(i)); if constexpr (tJustTranspose) { - if (x_fixed != Kokkos::ArithTraits::zero()) { + if (x_fixed != KokkosKernels::ArithTraits::zero()) { Kokkos::parallel_for(Kokkos::TeamThreadRange(team, N), [&](const IndexType& j) { if (((tJustUp == true) && (i <= j)) || ((tJustUp == false) && (i >= j))) { A_(i, j) += AComponentType(alpha_ * x_fixed * y_(j)); } }); } - if (y_fixed != Kokkos::ArithTraits::zero()) { + if (y_fixed != KokkosKernels::ArithTraits::zero()) { Kokkos::parallel_for(Kokkos::TeamThreadRange(team, N), [&](const IndexType& j) { if (((tJustUp == true) && (i <= j)) || ((tJustUp == false) && (i >= j))) { A_(i, j) += AComponentType(alpha_ * y_fixed * x_(j)); @@ -217,18 +217,18 @@ struct TeamParallelSYR2 { }); } } else { - if (x_fixed != Kokkos::ArithTraits::zero()) { + if (x_fixed != KokkosKernels::ArithTraits::zero()) { Kokkos::parallel_for(Kokkos::TeamThreadRange(team, N), [&](const IndexType& j) { if (((tJustUp == true) && (i <= j)) || ((tJustUp == false) && (i >= j))) { - A_(i, j) += AComponentType(alpha_ * x_fixed * Kokkos::ArithTraits::conj(y_(j))); + A_(i, j) += AComponentType(alpha_ * x_fixed * KokkosKernels::ArithTraits::conj(y_(j))); } }); } - if (y_fixed != Kokkos::ArithTraits::zero()) { + if (y_fixed != KokkosKernels::ArithTraits::zero()) { Kokkos::parallel_for(Kokkos::TeamThreadRange(team, N), [&](const IndexType& j) { if (((tJustUp == true) && (i <= j)) || ((tJustUp == false) && (i >= j))) { - A_(i, j) += AComponentType(Kokkos::ArithTraits::conj(alpha_) * y_fixed * - Kokkos::ArithTraits::conj(x_(j))); + A_(i, j) += AComponentType(KokkosKernels::ArithTraits::conj(alpha_) * y_fixed * + KokkosKernels::ArithTraits::conj(x_(j))); } }); } @@ -259,7 +259,7 @@ void teamParallelSyr2(const ExecutionSpace& space, const typename AViewType::con } else if (y.extent(0) == 0) { // no entries to update return; - } else if (alpha == Kokkos::ArithTraits::zero()) { + } else if (alpha == KokkosKernels::ArithTraits::zero()) { // no entries to update return; } diff --git a/blas/impl/KokkosBlas2_syr_impl.hpp b/blas/impl/KokkosBlas2_syr_impl.hpp index 11aa3a5052..96e451a45f 100644 --- a/blas/impl/KokkosBlas2_syr_impl.hpp +++ b/blas/impl/KokkosBlas2_syr_impl.hpp @@ -39,7 +39,7 @@ struct ThreadParallelSYR { KOKKOS_INLINE_FUNCTION void operator()(const IndexType& i) const { // Condition 'alpha_ == zero' has already been checked. - if (x_(i) == Kokkos::ArithTraits::zero()) { + if (x_(i) == KokkosKernels::ArithTraits::zero()) { // Nothing to do } else { const XComponentType x_fixed(x_(i)); @@ -54,7 +54,7 @@ struct ThreadParallelSYR { } else { for (IndexType j = 0; j < N; ++j) { if (((tJustUp == true) && (i <= j)) || ((tJustUp == false) && (i >= j))) { - A_(i, j) += AComponentType(alpha_ * x_fixed * Kokkos::ArithTraits::conj(x_(j))); + A_(i, j) += AComponentType(alpha_ * x_fixed * KokkosKernels::ArithTraits::conj(x_(j))); } } } @@ -77,7 +77,7 @@ void threadParallelSyr(const ExecutionSpace& space, const typename AViewType::co if (x.extent(0) == 0) { // no entries to update - } else if (alpha == Kokkos::ArithTraits::zero()) { + } else if (alpha == KokkosKernels::ArithTraits::zero()) { // no entries to update } else { Kokkos::RangePolicy rangePolicy(space, 0, A.extent(0)); @@ -111,7 +111,7 @@ struct TeamParallelSYR { KOKKOS_INLINE_FUNCTION void operator()(TeamParallelSYR_LayoutLeftTag, const member_type& team) const { // Condition 'alpha_ == zero' has already been checked const IndexType j(team.league_rank()); - if (x_(j) == Kokkos::ArithTraits::zero()) { + if (x_(j) == KokkosKernels::ArithTraits::zero()) { // Nothing to do } else { const IndexType M(A_.extent(0)); @@ -123,7 +123,7 @@ struct TeamParallelSYR { } }); } else { - const XComponentType x_fixed(Kokkos::ArithTraits::conj(x_(j))); + const XComponentType x_fixed(KokkosKernels::ArithTraits::conj(x_(j))); Kokkos::parallel_for(Kokkos::TeamThreadRange(team, M), [&](const IndexType& i) { if (((tJustUp == true) && (i <= j)) || ((tJustUp == false) && (i >= j))) { A_(i, j) += AComponentType(alpha_ * x_(i) * x_fixed); @@ -137,7 +137,7 @@ struct TeamParallelSYR { KOKKOS_INLINE_FUNCTION void operator()(TeamParallelSYR_LayoutRightTag, const member_type& team) const { // Condition 'alpha_ == zero' has already been checked const IndexType i(team.league_rank()); - if (x_(i) == Kokkos::ArithTraits::zero()) { + if (x_(i) == KokkosKernels::ArithTraits::zero()) { // Nothing to do } else { const IndexType N(A_.extent(1)); @@ -151,7 +151,7 @@ struct TeamParallelSYR { } else { Kokkos::parallel_for(Kokkos::TeamThreadRange(team, N), [&](const IndexType& j) { if (((tJustUp == true) && (i <= j)) || ((tJustUp == false) && (i >= j))) { - A_(i, j) += AComponentType(alpha_ * x_fixed * Kokkos::ArithTraits::conj(x_(j))); + A_(i, j) += AComponentType(alpha_ * x_fixed * KokkosKernels::ArithTraits::conj(x_(j))); } }); } @@ -175,7 +175,7 @@ void teamParallelSyr(const ExecutionSpace& space, const typename AViewType::cons if (x.extent(0) == 0) { // no entries to update return; - } else if (alpha == Kokkos::ArithTraits::zero()) { + } else if (alpha == KokkosKernels::ArithTraits::zero()) { // no entries to update return; } diff --git a/blas/impl/KokkosBlas3_gemm_dotbased_impl.hpp b/blas/impl/KokkosBlas3_gemm_dotbased_impl.hpp index 72a08ec749..22c2dcf3f6 100644 --- a/blas/impl/KokkosBlas3_gemm_dotbased_impl.hpp +++ b/blas/impl/KokkosBlas3_gemm_dotbased_impl.hpp @@ -43,8 +43,8 @@ struct DotBasedGEMM { using size_A = typename AV::size_type; using scalar_C = typename CV::non_const_value_type; using size_C = typename CV::size_type; - using AVT = Kokkos::ArithTraits; - using CVT = Kokkos::ArithTraits; + using AVT = KokkosKernels::ArithTraits; + using CVT = KokkosKernels::ArithTraits; const scalar_A alpha; const scalar_C beta; diff --git a/blas/impl/KokkosBlas3_gemm_impl.hpp b/blas/impl/KokkosBlas3_gemm_impl.hpp index 38f3fe5f8d..66811961a8 100644 --- a/blas/impl/KokkosBlas3_gemm_impl.hpp +++ b/blas/impl/KokkosBlas3_gemm_impl.hpp @@ -62,7 +62,7 @@ struct impl_deep_copy_matrix_block; template struct impl_deep_copy_matrix_block { typedef typename ViewType::non_const_value_type value_type; - typedef Kokkos::ArithTraits ATV; + typedef KokkosKernels::ArithTraits ATV; KOKKOS_INLINE_FUNCTION static void copy(const TeamHandle& team, const ViewTypeScratch& A_scr, const ViewType& A, const int& offset_i, @@ -101,7 +101,7 @@ template { typedef typename ViewType::non_const_value_type value_type; - typedef Kokkos::ArithTraits ATV; + typedef KokkosKernels::ArithTraits ATV; KOKKOS_INLINE_FUNCTION static void copy(const TeamHandle& team, const ViewTypeScratch& A_scr, const ViewType& A, const int& offset_i, @@ -134,7 +134,7 @@ struct impl_deep_copy_matrix_block struct impl_deep_copy_matrix_block { typedef typename ViewType::non_const_value_type value_type; - typedef Kokkos::ArithTraits ATV; + typedef KokkosKernels::ArithTraits ATV; KOKKOS_INLINE_FUNCTION static void copy(const TeamHandle& team, const ViewTypeScratch& A_scr, const ViewType& A, const int& offset_i, @@ -173,7 +173,7 @@ template { typedef typename ViewType::non_const_value_type value_type; - typedef Kokkos::ArithTraits ATV; + typedef KokkosKernels::ArithTraits ATV; KOKKOS_INLINE_FUNCTION static void copy(const TeamHandle& team, const ViewTypeScratch& A_scr, const ViewType& A, const int& offset_i, @@ -211,7 +211,7 @@ struct impl_deep_copy_matrix_block struct impl_deep_copy_matrix_block { typedef typename ViewType::non_const_value_type value_type; - typedef Kokkos::ArithTraits ATV; + typedef KokkosKernels::ArithTraits ATV; KOKKOS_INLINE_FUNCTION static void copy(const TeamHandle& team, const ViewTypeScratch& A_scr, const ViewType& A, const int& offset_i, @@ -250,7 +250,7 @@ template { typedef typename ViewType::non_const_value_type value_type; - typedef Kokkos::ArithTraits ATV; + typedef KokkosKernels::ArithTraits ATV; KOKKOS_INLINE_FUNCTION static void copy(const TeamHandle& team, const ViewTypeScratch& A_scr, const ViewType& A, const int& offset_i, @@ -288,7 +288,7 @@ struct impl_deep_copy_matrix_block struct impl_update_matrix_block { typedef typename ViewType::non_const_value_type value_type; - typedef Kokkos::ArithTraits ATV; + typedef KokkosKernels::ArithTraits ATV; KOKKOS_INLINE_FUNCTION static void update(const TeamHandle& team, const value_type& beta, const ViewType& A, const value_type& alpha, @@ -332,7 +332,7 @@ struct impl_update_matrix_block { template struct impl_update_matrix_block { typedef typename ViewType::non_const_value_type value_type; - typedef Kokkos::ArithTraits ATV; + typedef KokkosKernels::ArithTraits ATV; KOKKOS_INLINE_FUNCTION static void update(const TeamHandle& team, const value_type& beta, const ViewType& A, const value_type& alpha, diff --git a/blas/impl/KokkosBlas3_trsm_impl.hpp b/blas/impl/KokkosBlas3_trsm_impl.hpp index 9875cf5a0b..c328eb52f9 100644 --- a/blas/impl/KokkosBlas3_trsm_impl.hpp +++ b/blas/impl/KokkosBlas3_trsm_impl.hpp @@ -37,7 +37,7 @@ template int SerialTrsmInternalLeftLowerConj(const bool use_unit_diag, const int m, const int n, const ScalarType alpha, const ValueType* KOKKOS_RESTRICT A, const int as0, const int as1, /**/ ValueType* KOKKOS_RESTRICT B, const int bs0, const int bs1) { - typedef Kokkos::ArithTraits AT; + typedef KokkosKernels::ArithTraits AT; const ScalarType one(1.0), zero(0.0); @@ -70,7 +70,7 @@ template int SerialTrsmInternalLeftUpperConj(const bool use_unit_diag, const int m, const int n, const ScalarType alpha, const ValueType* KOKKOS_RESTRICT A, const int as0, const int as1, /**/ ValueType* KOKKOS_RESTRICT B, const int bs0, const int bs1) { - typedef Kokkos::ArithTraits AT; + typedef KokkosKernels::ArithTraits AT; const ScalarType one(1.0), zero(0.0); diff --git a/blas/impl/KokkosBlas_serial_nrm2.hpp b/blas/impl/KokkosBlas_serial_nrm2.hpp index db17736c0f..a43539410b 100644 --- a/blas/impl/KokkosBlas_serial_nrm2.hpp +++ b/blas/impl/KokkosBlas_serial_nrm2.hpp @@ -32,14 +32,14 @@ KOKKOS_INLINE_FUNCTION static typename Kokkos::Details::InnerProductSpaceTraits< using IPT = Kokkos::Details::InnerProductSpaceTraits; using norm_type = typename IPT::mag_type; - norm_type nrm = Kokkos::ArithTraits::zero(); + norm_type nrm = KokkosKernels::ArithTraits::zero(); #if defined(KOKKOS_ENABLE_PRAGMA_UNROLL) #pragma unroll #endif for (int i = 0; i < m; ++i) nrm += IPT::norm(IPT::dot(X[i * xs0], X[i * xs0])); - return Kokkos::ArithTraits::sqrt(nrm); + return KokkosKernels::ArithTraits::sqrt(nrm); } template diff --git a/blas/impl/KokkosBlas_util.hpp b/blas/impl/KokkosBlas_util.hpp index c48f469242..fac2bac999 100644 --- a/blas/impl/KokkosBlas_util.hpp +++ b/blas/impl/KokkosBlas_util.hpp @@ -31,15 +31,15 @@ struct OpID { struct OpConj { template KOKKOS_INLINE_FUNCTION ValueType operator()(ValueType v) const { - using KAT = Kokkos::ArithTraits; + using KAT = KokkosKernels::ArithTraits; return KAT::conj(v); } }; struct OpReal { template - KOKKOS_INLINE_FUNCTION typename Kokkos::ArithTraits::mag_type operator()(ValueType v) const { - using KAT = Kokkos::ArithTraits; + KOKKOS_INLINE_FUNCTION typename KokkosKernels::ArithTraits::mag_type operator()(ValueType v) const { + using KAT = KokkosKernels::ArithTraits; return KAT::real(v); } }; @@ -244,7 +244,7 @@ struct TakeSqrtFunctor { TakeSqrtFunctor(const RV &r_) : r(r_) {} KOKKOS_INLINE_FUNCTION void operator()(int i) const { - r(i) = Kokkos::ArithTraits::sqrt(r(i)); + r(i) = KokkosKernels::ArithTraits::sqrt(r(i)); } RV r; diff --git a/blas/src/KokkosBlas1_axpby.hpp b/blas/src/KokkosBlas1_axpby.hpp index a6ad8c15a3..b4a3f30c85 100644 --- a/blas/src/KokkosBlas1_axpby.hpp +++ b/blas/src/KokkosBlas1_axpby.hpp @@ -275,7 +275,7 @@ void axpby(const AV& a, const XMV& X, const BV& b, const YMV& Y) { /// stored. template void axpy(const execution_space& exec_space, const AV& a, const XMV& X, const YMV& Y) { - axpby(exec_space, a, X, Kokkos::ArithTraits::one(), Y); + axpby(exec_space, a, X, KokkosKernels::ArithTraits::one(), Y); } /// \brief Computes Y := a*X + Y diff --git a/blas/src/KokkosBlas1_nrm2.hpp b/blas/src/KokkosBlas1_nrm2.hpp index 51a78b4208..a28c258141 100644 --- a/blas/src/KokkosBlas1_nrm2.hpp +++ b/blas/src/KokkosBlas1_nrm2.hpp @@ -205,7 +205,7 @@ KOKKOS_INLINE_FUNCTION int serial_nrm2(const XMV X, const RV& R) { using norm_type = typename Kokkos::Details::InnerProductSpaceTraits::mag_type; static_assert(std::is_same::value, "KokkosBlas::serial_nrm2: RV must have same value_type as" - " Kokkos::ArithTraits::mag_type"); + " KokkosKernels::ArithTraits::mag_type"); if (R.extent(0) != X.extent(1)) { Kokkos::printf( diff --git a/blas/src/KokkosBlas1_rotg.hpp b/blas/src/KokkosBlas1_rotg.hpp index e3c58c016e..bb5a850436 100644 --- a/blas/src/KokkosBlas1_rotg.hpp +++ b/blas/src/KokkosBlas1_rotg.hpp @@ -42,12 +42,12 @@ void rotg(execution_space const& space, SViewType const& a, SViewType const& b, SViewType const& s) { static_assert(SViewType::rank == 0, "rotg: the inputs need to be rank 0 views"); static_assert(MViewType::rank == 0, "rotg: the inputs need to be rank 0 views"); - static_assert(!Kokkos::ArithTraits::is_complex); + static_assert(!KokkosKernels::ArithTraits::is_complex); static_assert(Kokkos::SpaceAccessibility::accessible, "rotg: execution_space cannot access data in SViewType"); static_assert(Kokkos::SpaceAccessibility::accessible, "rotg: execution_space cannot access data in MViewType"); - static_assert(!Kokkos::ArithTraits::is_complex, + static_assert(!KokkosKernels::ArithTraits::is_complex, "rotg: MViewType cannot hold complex values."); using SView_Internal = Kokkos::View< diff --git a/blas/src/KokkosBlas1_rotm.hpp b/blas/src/KokkosBlas1_rotm.hpp index a26294300f..e319d8a6e9 100644 --- a/blas/src/KokkosBlas1_rotm.hpp +++ b/blas/src/KokkosBlas1_rotm.hpp @@ -51,9 +51,9 @@ void rotm(execution_space const& space, VectorView const& X, VectorView const& Y "from execution_space template parameter"); static_assert(std::is_same::value, "rotm: VectorView template parameter needs to store non-const values"); - static_assert(!Kokkos::ArithTraits::is_complex, + static_assert(!KokkosKernels::ArithTraits::is_complex, "rotm: VectorView template parameter cannot use complex value_type"); - static_assert(!Kokkos::ArithTraits::is_complex, + static_assert(!KokkosKernels::ArithTraits::is_complex, "rotm: ParamView template parameter cannot use complex value_type"); using VectorView_Internal = Kokkos::View void KOKKOS_INLINE_FUNCTION axpy(const TeamType& team, const typename XVector::non_const_value_type& a, const XVector& x, const YVector& y) { KokkosBlas::Experimental::axpby( - team, a, x, Kokkos::ArithTraits::one(), y); + team, a, x, KokkosKernels::ArithTraits::one(), y); } } // namespace Experimental diff --git a/blas/tpls/KokkosBlas1_dot_tpl_spec_decl.hpp b/blas/tpls/KokkosBlas1_dot_tpl_spec_decl.hpp index 8533ca6f85..d024ffc99b 100644 --- a/blas/tpls/KokkosBlas1_dot_tpl_spec_decl.hpp +++ b/blas/tpls/KokkosBlas1_dot_tpl_spec_decl.hpp @@ -55,7 +55,7 @@ namespace Impl { typedef typename XV::size_type size_type; \ \ static void dot(const ExecSpace& space, RV& R, const XV& X, const XV& Y) { \ - Kokkos::Profiling::pushRegion("KokkosBlas::dot[TPL_BLAS," + Kokkos::ArithTraits::name() + "]"); \ + Kokkos::Profiling::pushRegion("KokkosBlas::dot[TPL_BLAS," + KokkosKernels::ArithTraits::name() + "]"); \ const size_type numElems = X.extent(0); \ if (numElems < static_cast(INT_MAX)) { \ dot_print_specialization(); \ @@ -110,7 +110,7 @@ namespace Impl { typedef typename XV::size_type size_type; \ \ static void dot(const EXECSPACE& space, RV& R, const XV& X, const XV& Y) { \ - Kokkos::Profiling::pushRegion("KokkosBlas::dot[TPL_CUBLAS," + Kokkos::ArithTraits::name() + "]"); \ + Kokkos::Profiling::pushRegion("KokkosBlas::dot[TPL_CUBLAS," + KokkosKernels::ArithTraits::name() + "]"); \ const size_type numElems = X.extent(0); \ /* TODO: CUDA-12's 64-bit indices allow larger numElems */ \ if (numElems <= static_cast(std::numeric_limits::max())) { \ @@ -169,7 +169,7 @@ namespace Impl { typedef typename XV::size_type size_type; \ \ static void dot(const EXECSPACE& space, RV& R, const XV& X, const XV& Y) { \ - Kokkos::Profiling::pushRegion("KokkosBlas::dot[TPL_ROCBLAS," + Kokkos::ArithTraits::name() + "]"); \ + Kokkos::Profiling::pushRegion("KokkosBlas::dot[TPL_ROCBLAS," + KokkosKernels::ArithTraits::name() + "]"); \ const size_type numElems = X.extent(0); \ if (numElems <= static_cast(std::numeric_limits::max())) { \ dot_print_specialization(); \ @@ -228,7 +228,7 @@ namespace Impl { typedef typename XV::size_type size_type; \ \ static void dot(const EXECSPACE& exec, RV& R, const XV& X, const XV& Y) { \ - Kokkos::Profiling::pushRegion("KokkosBlas::dot[TPL_ONEMKL," + Kokkos::ArithTraits::name() + "]"); \ + Kokkos::Profiling::pushRegion("KokkosBlas::dot[TPL_ONEMKL," + KokkosKernels::ArithTraits::name() + "]"); \ const size_type numElems = X.extent(0); \ if (numElems <= static_cast(std::numeric_limits::max())) { \ dot_print_specialization(); \ diff --git a/blas/tpls/KokkosBlas1_nrm1_tpl_spec_decl.hpp b/blas/tpls/KokkosBlas1_nrm1_tpl_spec_decl.hpp index 5503445227..1d3c0cf6ca 100644 --- a/blas/tpls/KokkosBlas1_nrm1_tpl_spec_decl.hpp +++ b/blas/tpls/KokkosBlas1_nrm1_tpl_spec_decl.hpp @@ -41,17 +41,17 @@ namespace Impl { #define KOKKOSBLAS1_NRM1_TPL_SPEC_DECL_BLAS(SCALAR, LAYOUT, EXECSPACE, MEMSPACE) \ template <> \ struct Nrm1::mag_type, LAYOUT, Kokkos::HostSpace, \ + Kokkos::View::mag_type, LAYOUT, Kokkos::HostSpace, \ Kokkos::MemoryTraits>, \ Kokkos::View, \ Kokkos::MemoryTraits>, \ 1, true, \ nrm1_eti_spec_avail::mag_type, LAYOUT, \ + Kokkos::View::mag_type, LAYOUT, \ Kokkos::HostSpace, Kokkos::MemoryTraits>, \ Kokkos::View, \ Kokkos::MemoryTraits>>::value> { \ - using mag_type = typename Kokkos::ArithTraits::mag_type; \ + using mag_type = typename KokkosKernels::ArithTraits::mag_type; \ using RV = Kokkos::View>; \ using XV = Kokkos::View, \ Kokkos::MemoryTraits>; \ @@ -64,7 +64,7 @@ namespace Impl { nrm1_print_specialization(); \ int N = numElems; \ int one = 1; \ - if constexpr (Kokkos::ArithTraits::is_complex) { \ + if constexpr (KokkosKernels::ArithTraits::is_complex) { \ R() = HostBlas>::asum(N, reinterpret_cast*>(X.data()), \ one); \ } else { \ @@ -140,18 +140,18 @@ void cublasAsumWrapper(const ExecutionSpace& space, RViewType& R, const XViewTyp #define KOKKOSBLAS1_NRM1_TPL_SPEC_DECL_CUBLAS(SCALAR, LAYOUT, MEMSPACE) \ template <> \ struct Nrm1::mag_type, LAYOUT, Kokkos::HostSpace, \ + Kokkos::View::mag_type, LAYOUT, Kokkos::HostSpace, \ Kokkos::MemoryTraits>, \ Kokkos::View, \ Kokkos::MemoryTraits>, \ 1, true, \ nrm1_eti_spec_avail::mag_type, LAYOUT, \ + Kokkos::View::mag_type, LAYOUT, \ Kokkos::HostSpace, Kokkos::MemoryTraits>, \ Kokkos::View, \ Kokkos::MemoryTraits>>::value> { \ using execution_space = Kokkos::Cuda; \ - using RV = Kokkos::View::mag_type, LAYOUT, Kokkos::HostSpace, \ + using RV = Kokkos::View::mag_type, LAYOUT, Kokkos::HostSpace, \ Kokkos::MemoryTraits>; \ using XV = Kokkos::View, \ Kokkos::MemoryTraits>; \ @@ -222,17 +222,17 @@ void rocblasAsumWrapper(const ExecutionSpace& space, RViewType& R, const XViewTy #define KOKKOSBLAS1_NRM1_TPL_SPEC_DECL_ROCBLAS(SCALAR, LAYOUT, MEMSPACE) \ template <> \ struct Nrm1::mag_type, LAYOUT, Kokkos::HostSpace, \ + Kokkos::View::mag_type, LAYOUT, Kokkos::HostSpace, \ Kokkos::MemoryTraits>, \ Kokkos::View, \ Kokkos::MemoryTraits>, \ 1, true, \ nrm1_eti_spec_avail::mag_type, LAYOUT, \ + Kokkos::View::mag_type, LAYOUT, \ Kokkos::HostSpace, Kokkos::MemoryTraits>, \ Kokkos::View, \ Kokkos::MemoryTraits>>::value> { \ - using RV = Kokkos::View::mag_type, LAYOUT, Kokkos::HostSpace, \ + using RV = Kokkos::View::mag_type, LAYOUT, Kokkos::HostSpace, \ Kokkos::MemoryTraits>; \ using XV = Kokkos::View, \ Kokkos::MemoryTraits>; \ @@ -274,13 +274,13 @@ namespace Impl { template void onemklAsumWrapper(const ExecutionSpace& space, RViewType& R, const XViewType& X) { using XScalar = typename XViewType::non_const_value_type; - using KAT_X = Kokkos::ArithTraits; + using KAT_X = KokkosKernels::ArithTraits; using layout_t = typename XViewType::array_layout; const std::int64_t N = static_cast(X.extent(0)); // Create temp view on device to store the result - Kokkos::View::mag_type, typename XViewType::memory_space> res( + Kokkos::View::mag_type, typename XViewType::memory_space> res( "sycl asum result"); // Decide to call row_major or column_major function @@ -309,18 +309,18 @@ void onemklAsumWrapper(const ExecutionSpace& space, RViewType& R, const XViewTyp template <> \ struct Nrm1< \ Kokkos::Experimental::SYCL, \ - Kokkos::View::mag_type, LAYOUT, Kokkos::HostSpace, \ + Kokkos::View::mag_type, LAYOUT, Kokkos::HostSpace, \ Kokkos::MemoryTraits>, \ Kokkos::View, \ Kokkos::MemoryTraits>, \ 1, true, \ nrm1_eti_spec_avail::mag_type, LAYOUT, Kokkos::HostSpace, \ + Kokkos::View::mag_type, LAYOUT, Kokkos::HostSpace, \ Kokkos::MemoryTraits>, \ Kokkos::View, \ Kokkos::MemoryTraits>>::value> { \ using execution_space = Kokkos::Experimental::SYCL; \ - using RV = Kokkos::View::mag_type, LAYOUT, Kokkos::HostSpace, \ + using RV = Kokkos::View::mag_type, LAYOUT, Kokkos::HostSpace, \ Kokkos::MemoryTraits>; \ using XV = Kokkos::View, \ Kokkos::MemoryTraits>; \ diff --git a/blas/tpls/KokkosBlas1_nrm2_tpl_spec_avail.hpp b/blas/tpls/KokkosBlas1_nrm2_tpl_spec_avail.hpp index b7b70b5edb..370bf005d7 100644 --- a/blas/tpls/KokkosBlas1_nrm2_tpl_spec_avail.hpp +++ b/blas/tpls/KokkosBlas1_nrm2_tpl_spec_avail.hpp @@ -53,7 +53,7 @@ KOKKOSBLAS1_NRM2_TPL_SPEC_AVAIL_BLAS(Kokkos::complex, Kokkos::LayoutLeft, #define KOKKOSBLAS1_NRM2_TPL_SPEC(SCALAR, LAYOUT, EXECSPACE, MEMSPACE) \ template <> \ struct nrm2_tpl_spec_avail::mag_type, LAYOUT, Kokkos::HostSpace, \ + Kokkos::View::mag_type, LAYOUT, Kokkos::HostSpace, \ Kokkos::MemoryTraits >, \ Kokkos::View, \ Kokkos::MemoryTraits >, \ diff --git a/blas/tpls/KokkosBlas1_nrm2_tpl_spec_decl.hpp b/blas/tpls/KokkosBlas1_nrm2_tpl_spec_decl.hpp index 3fba6d03e7..419a8a3236 100644 --- a/blas/tpls/KokkosBlas1_nrm2_tpl_spec_decl.hpp +++ b/blas/tpls/KokkosBlas1_nrm2_tpl_spec_decl.hpp @@ -179,19 +179,19 @@ namespace Impl { ETI_SPEC_AVAIL) \ template <> \ struct Nrm2::mag_type, LAYOUT, Kokkos::HostSpace, \ + Kokkos::View::mag_type, LAYOUT, Kokkos::HostSpace, \ Kokkos::MemoryTraits >, \ Kokkos::View, \ Kokkos::MemoryTraits >, \ 1, true, ETI_SPEC_AVAIL> { \ - using RT = Kokkos::ArithTraits::mag_type; \ + using RT = KokkosKernels::ArithTraits::mag_type; \ using RV = Kokkos::View >; \ using XV = Kokkos::View, \ Kokkos::MemoryTraits >; \ using size_type = typename XV::size_type; \ \ static void nrm2(const EXECSPACE& space, RV& R, const XV& X, const bool& take_sqrt) { \ - Kokkos::Profiling::pushRegion("KokkosBlas::nrm2[TPL_CUBLAS," + Kokkos::ArithTraits::name() + "]"); \ + Kokkos::Profiling::pushRegion("KokkosBlas::nrm2[TPL_CUBLAS," + KokkosKernels::ArithTraits::name() + "]"); \ const size_type numElems = X.extent(0); \ if (numElems <= static_cast(std::numeric_limits::max())) { \ nrm2_print_specialization(); \ @@ -236,19 +236,19 @@ namespace Impl { ETI_SPEC_AVAIL) \ template <> \ struct Nrm2::mag_type, LAYOUT, Kokkos::HostSpace, \ + Kokkos::View::mag_type, LAYOUT, Kokkos::HostSpace, \ Kokkos::MemoryTraits >, \ Kokkos::View, \ Kokkos::MemoryTraits >, \ 1, true, ETI_SPEC_AVAIL> { \ - using RT = Kokkos::ArithTraits::mag_type; \ + using RT = KokkosKernels::ArithTraits::mag_type; \ using RV = Kokkos::View >; \ using XV = Kokkos::View, \ Kokkos::MemoryTraits >; \ using size_type = typename XV::size_type; \ \ static void nrm2(const EXECSPACE& space, RV& R, const XV& X, const bool& take_sqrt) { \ - Kokkos::Profiling::pushRegion("KokkosBlas::nrm2[TPL_ROCBLAS," + Kokkos::ArithTraits::name() + "]"); \ + Kokkos::Profiling::pushRegion("KokkosBlas::nrm2[TPL_ROCBLAS," + KokkosKernels::ArithTraits::name() + "]"); \ const size_type numElems = X.extent(0); \ if (numElems <= static_cast(std::numeric_limits::max())) { \ nrm2_print_specialization(); \ @@ -296,19 +296,19 @@ namespace Impl { ETI_SPEC_AVAIL) \ template <> \ struct Nrm2::mag_type, LAYOUT, Kokkos::HostSpace, \ + Kokkos::View::mag_type, LAYOUT, Kokkos::HostSpace, \ Kokkos::MemoryTraits >, \ Kokkos::View, \ Kokkos::MemoryTraits >, \ 1, true, ETI_SPEC_AVAIL> { \ - using RT = Kokkos::ArithTraits::mag_type; \ + using RT = KokkosKernels::ArithTraits::mag_type; \ using RV = Kokkos::View >; \ using XV = Kokkos::View, \ Kokkos::MemoryTraits >; \ using size_type = typename XV::size_type; \ \ static void nrm2(const EXECSPACE& space, RV& R, const XV& X, const bool& take_sqrt) { \ - Kokkos::Profiling::pushRegion("KokkosBlas::nrm2[TPL_ONEMKL," + Kokkos::ArithTraits::name() + "]"); \ + Kokkos::Profiling::pushRegion("KokkosBlas::nrm2[TPL_ONEMKL," + KokkosKernels::ArithTraits::name() + "]"); \ const size_type numElems = X.extent(0); \ if (numElems <= static_cast(std::numeric_limits::max())) { \ nrm2_print_specialization(); \ diff --git a/blas/tpls/KokkosBlas1_rot_tpl_spec_avail.hpp b/blas/tpls/KokkosBlas1_rot_tpl_spec_avail.hpp index 3417efc3a5..c1c24fe032 100644 --- a/blas/tpls/KokkosBlas1_rot_tpl_spec_avail.hpp +++ b/blas/tpls/KokkosBlas1_rot_tpl_spec_avail.hpp @@ -38,7 +38,7 @@ namespace Impl { EXECSPACE, \ Kokkos::View, \ Kokkos::MemoryTraits>, \ - Kokkos::View::mag_type, LAYOUT, \ + Kokkos::View::mag_type, LAYOUT, \ Kokkos::Device, Kokkos::MemoryTraits>, \ Kokkos::View, \ Kokkos::MemoryTraits>> { \ @@ -67,7 +67,7 @@ KOKKOSBLAS1_ROT_TPL_SPEC_AVAIL_BLAS(Kokkos::complex, Kokkos::LayoutLeft, struct rot_tpl_spec_avail< \ EXECSPACE, \ Kokkos::View, Kokkos::MemoryTraits>, \ - Kokkos::View::mag_type, LAYOUT, Kokkos::Device, \ + Kokkos::View::mag_type, LAYOUT, Kokkos::Device, \ Kokkos::MemoryTraits>, \ Kokkos::View, Kokkos::MemoryTraits>> { \ enum : bool { value = true }; \ diff --git a/blas/tpls/KokkosBlas1_rotg_tpl_spec_avail.hpp b/blas/tpls/KokkosBlas1_rotg_tpl_spec_avail.hpp index f8b8184b80..16ac7a3679 100644 --- a/blas/tpls/KokkosBlas1_rotg_tpl_spec_avail.hpp +++ b/blas/tpls/KokkosBlas1_rotg_tpl_spec_avail.hpp @@ -37,7 +37,7 @@ namespace Impl { struct rotg_tpl_spec_avail< \ EXECSPACE, \ Kokkos::View, Kokkos::MemoryTraits>, \ - Kokkos::View::mag_type, LAYOUT, Kokkos::Device, \ + Kokkos::View::mag_type, LAYOUT, Kokkos::Device, \ Kokkos::MemoryTraits>> { \ enum : bool { value = true }; \ }; @@ -72,7 +72,7 @@ KOKKOSBLAS1_ROTG_TPL_SPEC_AVAIL_BLAS(Kokkos::complex, Kokkos::LayoutRight struct rotg_tpl_spec_avail< \ EXECSPACE, \ Kokkos::View, Kokkos::MemoryTraits>, \ - Kokkos::View::mag_type, LAYOUT, Kokkos::Device, \ + Kokkos::View::mag_type, LAYOUT, Kokkos::Device, \ Kokkos::MemoryTraits>> { \ enum : bool { value = true }; \ }; @@ -103,7 +103,7 @@ KOKKOSBLAS1_ROTG_TPL_SPEC_AVAIL_CUBLAS(Kokkos::complex, Kokkos::LayoutRig struct rotg_tpl_spec_avail< \ EXECSPACE, \ Kokkos::View, Kokkos::MemoryTraits>, \ - Kokkos::View::mag_type, LAYOUT, Kokkos::Device, \ + Kokkos::View::mag_type, LAYOUT, Kokkos::Device, \ Kokkos::MemoryTraits>> { \ enum : bool { value = true }; \ }; diff --git a/blas/tpls/KokkosBlas2_gemv_tpl_spec_decl.hpp b/blas/tpls/KokkosBlas2_gemv_tpl_spec_decl.hpp index fdfd17e454..bef3d07d97 100644 --- a/blas/tpls/KokkosBlas2_gemv_tpl_spec_decl.hpp +++ b/blas/tpls/KokkosBlas2_gemv_tpl_spec_decl.hpp @@ -620,7 +620,7 @@ struct kokkos_to_std_type_map { // e.g., map Kokkos::complex to std::complex template struct kokkos_to_std_type_map { - using type = std::complex::mag_type>; + using type = std::complex::mag_type>; }; #define KOKKOSBLAS2_GEMV_ONEMKL(SCALAR, LAYOUT, MEM_SPACE, ETI_SPEC_AVAIL) \ @@ -642,8 +642,8 @@ struct kokkos_to_std_type_map { static void gemv(const ExecSpace& exec, const char kk_trans[], typename AViewType::const_value_type& alpha, \ const AViewType& A, const XViewType& X, typename YViewType::const_value_type& beta, \ const YViewType& Y) { \ - if (beta == Kokkos::ArithTraits::zero()) { \ - Kokkos::deep_copy(Y, Kokkos::ArithTraits::zero()); \ + if (beta == KokkosKernels::ArithTraits::zero()) { \ + Kokkos::deep_copy(Y, KokkosKernels::ArithTraits::zero()); \ } \ \ bool row_major = std::is_same::value; \ @@ -651,10 +651,10 @@ struct kokkos_to_std_type_map { const std::int64_t N = A.extent(1); \ oneapi::mkl::transpose trans = mode_kk_to_onemkl(kk_trans[0]); \ const std::int64_t LDA = row_major ? A.stride(0) : A.stride(1); \ - std::string label = "KokkosBlas::gemv[TPL_ONEMKL," + Kokkos::ArithTraits::name() + "]"; \ + std::string label = "KokkosBlas::gemv[TPL_ONEMKL," + KokkosKernels::ArithTraits::name() + "]"; \ \ Kokkos::Profiling::pushRegion(label); \ - using mag_type = kokkos_to_std_type_map::is_complex>::type; \ + using mag_type = kokkos_to_std_type_map::is_complex>::type; \ const mag_type* a = reinterpret_cast(A.data()); \ const mag_type* x = reinterpret_cast(X.data()); \ mag_type* y = reinterpret_cast(Y.data()); \ diff --git a/blas/tpls/KokkosBlas_Host_tpl.hpp b/blas/tpls/KokkosBlas_Host_tpl.hpp index 920b978cc1..c1fde4aa9f 100644 --- a/blas/tpls/KokkosBlas_Host_tpl.hpp +++ b/blas/tpls/KokkosBlas_Host_tpl.hpp @@ -40,7 +40,7 @@ using KK_INT = int; template struct HostBlas { - typedef Kokkos::ArithTraits ats; + typedef KokkosKernels::ArithTraits ats; typedef typename ats::mag_type mag_type; static void scal(KK_INT n, const T alpha, diff --git a/blas/unit_test/Test_Blas1_abs.hpp b/blas/unit_test/Test_Blas1_abs.hpp index eb2d290a6f..9b78a311f3 100644 --- a/blas/unit_test/Test_Blas1_abs.hpp +++ b/blas/unit_test/Test_Blas1_abs.hpp @@ -24,7 +24,7 @@ template void impl_test_abs(int N) { typedef typename ViewTypeA::value_type ScalarA; typedef typename ViewTypeB::value_type ScalarB; - typedef Kokkos::ArithTraits AT; + typedef KokkosKernels::ArithTraits AT; typename AT::mag_type eps = AT::epsilon() * 10; @@ -70,7 +70,7 @@ template void impl_test_abs_mv(int N, int K) { typedef typename ViewTypeA::value_type ScalarA; typedef typename ViewTypeB::value_type ScalarB; - typedef Kokkos::ArithTraits AT; + typedef KokkosKernels::ArithTraits AT; view_stride_adapter x("X", N, K); view_stride_adapter y("Y", N, K); diff --git a/blas/unit_test/Test_Blas1_asum.hpp b/blas/unit_test/Test_Blas1_asum.hpp index 07cf2e6998..8d027158a9 100644 --- a/blas/unit_test/Test_Blas1_asum.hpp +++ b/blas/unit_test/Test_Blas1_asum.hpp @@ -23,8 +23,8 @@ namespace Test { template void impl_test_asum(int N) { typedef typename ViewTypeA::value_type ScalarA; - typedef Kokkos::ArithTraits AT; - typedef Kokkos::ArithTraits MAT; + typedef KokkosKernels::ArithTraits AT; + typedef KokkosKernels::ArithTraits MAT; view_stride_adapter a("A", N); diff --git a/blas/unit_test/Test_Blas1_axpby.hpp b/blas/unit_test/Test_Blas1_axpby.hpp index 16d6bdc78f..99a0ad05f9 100644 --- a/blas/unit_test/Test_Blas1_axpby.hpp +++ b/blas/unit_test/Test_Blas1_axpby.hpp @@ -25,16 +25,16 @@ template void impl_test_axpby(int N) { using ScalarA = typename ViewTypeA::value_type; using ScalarB = typename ViewTypeB::value_type; - using MagnitudeB = typename Kokkos::ArithTraits::mag_type; + using MagnitudeB = typename KokkosKernels::ArithTraits::mag_type; ScalarA a = 3; ScalarB b = 5; // eps should probably be based on ScalarB since that is the type // in which the result is computed. - const MagnitudeB eps = Kokkos::ArithTraits::epsilon(); + const MagnitudeB eps = KokkosKernels::ArithTraits::epsilon(); const MagnitudeB max_val = 10; const MagnitudeB max_error = - (static_cast(Kokkos::ArithTraits::abs(a)) + Kokkos::ArithTraits::abs(b)) * max_val * + (static_cast(KokkosKernels::ArithTraits::abs(a)) + KokkosKernels::ArithTraits::abs(b)) * max_val * eps; view_stride_adapter x("X", N); @@ -73,7 +73,7 @@ template void impl_test_axpby_mv(int N, int K) { using ScalarA = typename ViewTypeA::value_type; using ScalarB = typename ViewTypeB::value_type; - using MagnitudeB = typename Kokkos::ArithTraits::mag_type; + using MagnitudeB = typename KokkosKernels::ArithTraits::mag_type; view_stride_adapter x("X", N, K); view_stride_adapter y("Y", N, K); @@ -81,10 +81,10 @@ void impl_test_axpby_mv(int N, int K) { ScalarA a = 3; ScalarB b = 5; - const MagnitudeB eps = Kokkos::ArithTraits::epsilon(); + const MagnitudeB eps = KokkosKernels::ArithTraits::epsilon(); const MagnitudeB max_val = 10; const MagnitudeB max_error = - (static_cast(Kokkos::ArithTraits::abs(a)) + Kokkos::ArithTraits::abs(b)) * max_val * + (static_cast(KokkosKernels::ArithTraits::abs(a)) + KokkosKernels::ArithTraits::abs(b)) * max_val * eps; Kokkos::Random_XorShift64_Pool rand_pool(13718); diff --git a/blas/unit_test/Test_Blas1_axpby_unification.hpp b/blas/unit_test/Test_Blas1_axpby_unification.hpp index d6c714a7dc..e5a7b8da09 100644 --- a/blas/unit_test/Test_Blas1_axpby_unification.hpp +++ b/blas/unit_test/Test_Blas1_axpby_unification.hpp @@ -78,10 +78,10 @@ constexpr bool isRank0() { template void impl_test_axpby_unification_compare(tA const& a, tX const& x, tB const& b, tY const& y, int N, bool testWithNanY, - typename Kokkos::ArithTraits::mag_type const max_val, - typename Kokkos::ArithTraits::mag_type const max_error, - tScalarA const inputValueA = Kokkos::ArithTraits::zero(), - tScalarB const inputValueB = Kokkos::ArithTraits::zero()) { + typename KokkosKernels::ArithTraits::mag_type const max_val, + typename KokkosKernels::ArithTraits::mag_type const max_error, + tScalarA const inputValueA = KokkosKernels::ArithTraits::zero(), + tScalarB const inputValueB = KokkosKernels::ArithTraits::zero()) { using ScalarTypeX = typename std::remove_const::type; using ScalarTypeY = typename std::remove_const::type; @@ -98,7 +98,7 @@ void impl_test_axpby_unification_compare(tA const& a, tX const& x, tB const& b, ScalarTypeY randStart, randEnd; Test::getRandomBounds(max_val, randStart, randEnd); if (testWithNanY) { - Kokkos::deep_copy(y.d_view, Kokkos::ArithTraits::nan()); + Kokkos::deep_copy(y.d_view, KokkosKernels::ArithTraits::nan()); } else { Kokkos::fill_random(y.d_view, rand_pool, randStart, randEnd); } @@ -106,8 +106,8 @@ void impl_test_axpby_unification_compare(tA const& a, tX const& x, tB const& b, tY org_y("Org_Y", N); Kokkos::deep_copy(org_y.h_base, y.d_base); - tScalarA valueA(Kokkos::ArithTraits::zero()); - tScalarB valueB(Kokkos::ArithTraits::zero()); + tScalarA valueA(KokkosKernels::ArithTraits::zero()); + tScalarB valueB(KokkosKernels::ArithTraits::zero()); if constexpr (std::is_same_v) { valueA = a; @@ -185,7 +185,7 @@ void impl_test_axpby_unification_compare(tA const& a, tX const& x, tB const& b, } else { // ******************************************************** // Tests with 'Y == nan()' are called only for cases where - // b == Kokkos::ArithTraits::zero() + // b == KokkosKernels::ArithTraits::zero() // ******************************************************** for (int i(0); i < N; ++i) { #if 0 @@ -204,10 +204,10 @@ void impl_test_axpby_unification_compare(tA const& a, tX const& x, tB const& b, // 'nan()' converts to '-1' in case of 'int' => no need to compare // **************************************************************** if (y.h_view(i) != -1) { - EXPECT_NE(y.h_view(i), Kokkos::ArithTraits::nan()); + EXPECT_NE(y.h_view(i), KokkosKernels::ArithTraits::nan()); } } else { - EXPECT_NE(y.h_view(i), Kokkos::ArithTraits::nan()); + EXPECT_NE(y.h_view(i), KokkosKernels::ArithTraits::nan()); } EXPECT_NEAR_KK(static_cast(valueA * x.h_view(i)), y.h_view(i), 4. * max_error); } @@ -217,10 +217,10 @@ void impl_test_axpby_unification_compare(tA const& a, tX const& x, tB const& b, template void impl_test_axpby_mv_unification_compare(tA const& a, tX const& x, tB const& b, tY const& y, int N, int K, bool testWithNanY, - typename Kokkos::ArithTraits::mag_type const max_val, - typename Kokkos::ArithTraits::mag_type const max_error, - tScalarA const inputValueA = Kokkos::ArithTraits::zero(), - tScalarB const inputValueB = Kokkos::ArithTraits::zero()) { + typename KokkosKernels::ArithTraits::mag_type const max_val, + typename KokkosKernels::ArithTraits::mag_type const max_error, + tScalarA const inputValueA = KokkosKernels::ArithTraits::zero(), + tScalarB const inputValueB = KokkosKernels::ArithTraits::zero()) { using ScalarTypeX = typename std::remove_const::type; using ScalarTypeY = typename std::remove_const::type; @@ -237,7 +237,7 @@ void impl_test_axpby_mv_unification_compare(tA const& a, tX const& x, tB const& ScalarTypeY randStart, randEnd; Test::getRandomBounds(max_val, randStart, randEnd); if (testWithNanY) { - Kokkos::deep_copy(y.d_view, Kokkos::ArithTraits::nan()); + Kokkos::deep_copy(y.d_view, KokkosKernels::ArithTraits::nan()); } else { Kokkos::fill_random(y.d_view, rand_pool, randStart, randEnd); } @@ -259,8 +259,8 @@ void impl_test_axpby_mv_unification_compare(tA const& a, tX const& x, tB const& Kokkos::deep_copy(b.h_base, b.d_base); } - tScalarA valueA(Kokkos::ArithTraits::zero()); - tScalarB valueB(Kokkos::ArithTraits::zero()); + tScalarA valueA(KokkosKernels::ArithTraits::zero()); + tScalarB valueB(KokkosKernels::ArithTraits::zero()); if constexpr (std::is_same_v) { valueA = a; if constexpr (std::is_same_v) { @@ -328,7 +328,7 @@ void impl_test_axpby_mv_unification_compare(tA const& a, tX const& x, tB const& if (testWithNanY == false) { for (int i(0); i < N; ++i) { for (int k(0); k < K; ++k) { - ScalarTypeY vanillaValue(Kokkos::ArithTraits::zero()); + ScalarTypeY vanillaValue(KokkosKernels::ArithTraits::zero()); if constexpr (aIsRank1) { (void)valueA; // Avoid "set but not used" error if constexpr (bIsRank1) { @@ -378,11 +378,11 @@ void impl_test_axpby_mv_unification_compare(tA const& a, tX const& x, tB const& } else { // ******************************************************** // Tests with 'Y == nan()' are called only for cases where - // b == Kokkos::ArithTraits::zero() + // b == KokkosKernels::ArithTraits::zero() // ******************************************************** for (int i(0); i < N; ++i) { for (int k(0); k < K; ++k) { - ScalarTypeY vanillaValue(Kokkos::ArithTraits::zero()); + ScalarTypeY vanillaValue(KokkosKernels::ArithTraits::zero()); if constexpr (aIsRank1) { (void)valueA; // Avoid "set but not used" error int a_k(a.h_view.extent(0) == 1 ? 0 : k); @@ -423,10 +423,10 @@ void impl_test_axpby_mv_unification_compare(tA const& a, tX const& x, tB const& // 'nan()' converts to '-1' in case of 'int' => no need to compare // **************************************************************** if (y.h_view(i, k) != -1) { - EXPECT_NE(y.h_view(i, k), Kokkos::ArithTraits::nan()); + EXPECT_NE(y.h_view(i, k), KokkosKernels::ArithTraits::nan()); } } else { - EXPECT_NE(y.h_view(i, k), Kokkos::ArithTraits::nan()); + EXPECT_NE(y.h_view(i, k), KokkosKernels::ArithTraits::nan()); } #if 0 std::cout << "In impl_test_axpby_mv_unification_compare(2)" @@ -457,17 +457,17 @@ void impl_test_axpby_unification(int const N) { using ViewTypeY = Kokkos::View; - std::array const valuesA{-1, Kokkos::ArithTraits::zero(), 1, 3}; - std::array const valuesB{-1, Kokkos::ArithTraits::zero(), 1, 5}; + std::array const valuesA{-1, KokkosKernels::ArithTraits::zero(), 1, 3}; + std::array const valuesB{-1, KokkosKernels::ArithTraits::zero(), 1, 5}; // eps should probably be based on tScalarB since that is the type // in which the result is computed. - using MagnitudeB = typename Kokkos::ArithTraits::mag_type; - MagnitudeB const eps = Kokkos::ArithTraits::epsilon(); + using MagnitudeB = typename KokkosKernels::ArithTraits::mag_type; + MagnitudeB const eps = KokkosKernels::ArithTraits::epsilon(); MagnitudeB const max_val = 10; MagnitudeB const max_error = - static_cast(Kokkos::ArithTraits::abs(valuesA[valuesA.size() - 1]) + - Kokkos::ArithTraits::abs(valuesB[valuesB.size() - 1])) * + static_cast(KokkosKernels::ArithTraits::abs(valuesA[valuesA.size() - 1]) + + KokkosKernels::ArithTraits::abs(valuesB[valuesB.size() - 1])) * max_val * eps; // ************************************************************ @@ -491,7 +491,7 @@ void impl_test_axpby_unification(int const N) { impl_test_axpby_unification_compare, tScalarB, tScalarB, view_stride_adapter, Device>(a, x, b, y, N, false, max_val, max_error); - if (valueB == Kokkos::ArithTraits::zero()) { + if (valueB == KokkosKernels::ArithTraits::zero()) { impl_test_axpby_unification_compare, tScalarB, tScalarB, view_stride_adapter, Device>(a, x, b, y, N, true, max_val, max_error); @@ -527,7 +527,7 @@ void impl_test_axpby_unification(int const N) { impl_test_axpby_unification_compare, tScalarB, ViewTypeBr0, view_stride_adapter, Device>(a, x, b, y, N, false, max_val, max_error); - if (valueB == Kokkos::ArithTraits::zero()) { + if (valueB == KokkosKernels::ArithTraits::zero()) { impl_test_axpby_unification_compare, tScalarB, ViewTypeBr0, view_stride_adapter, Device>( a, x, b, y, N, true, max_val, max_error); @@ -558,7 +558,7 @@ void impl_test_axpby_unification(int const N) { impl_test_axpby_unification_compare, tScalarB, view_stride_adapter, view_stride_adapter, Device>(a, x, b, y, N, false, max_val, max_error); - if (valueB == Kokkos::ArithTraits::zero()) { + if (valueB == KokkosKernels::ArithTraits::zero()) { impl_test_axpby_unification_compare, tScalarB, view_stride_adapter, view_stride_adapter, Device>(a, x, b, y, N, true, max_val, max_error); @@ -588,7 +588,7 @@ void impl_test_axpby_unification(int const N) { impl_test_axpby_unification_compare, tScalarB, view_stride_adapter, view_stride_adapter, Device>( a, x, b, y, N, false, max_val, max_error); - if (valueB == Kokkos::ArithTraits::zero()) { + if (valueB == KokkosKernels::ArithTraits::zero()) { impl_test_axpby_unification_compare, tScalarB, view_stride_adapter, view_stride_adapter, Device>(a, x, b, y, N, true, max_val, max_error); @@ -621,7 +621,7 @@ void impl_test_axpby_unification(int const N) { impl_test_axpby_unification_compare, tScalarB, tScalarB, view_stride_adapter, Device>(a, x, b, y, N, false, max_val, max_error); - if (valueB == Kokkos::ArithTraits::zero()) { + if (valueB == KokkosKernels::ArithTraits::zero()) { impl_test_axpby_unification_compare, tScalarB, tScalarB, view_stride_adapter, Device>(a, x, b, y, N, true, max_val, max_error); @@ -655,7 +655,7 @@ void impl_test_axpby_unification(int const N) { impl_test_axpby_unification_compare, tScalarB, ViewTypeBr0, view_stride_adapter, Device>(a, x, b, y, N, false, max_val, max_error); - if (valueB == Kokkos::ArithTraits::zero()) { + if (valueB == KokkosKernels::ArithTraits::zero()) { impl_test_axpby_unification_compare, tScalarB, ViewTypeBr0, view_stride_adapter, Device>( a, x, b, y, N, true, max_val, max_error); @@ -689,7 +689,7 @@ void impl_test_axpby_unification(int const N) { impl_test_axpby_unification_compare, tScalarB, view_stride_adapter, view_stride_adapter, Device>(a, x, b, y, N, false, max_val, max_error); - if (valueB == Kokkos::ArithTraits::zero()) { + if (valueB == KokkosKernels::ArithTraits::zero()) { impl_test_axpby_unification_compare, tScalarB, view_stride_adapter, view_stride_adapter, Device>(a, x, b, y, N, true, max_val, max_error); @@ -723,7 +723,7 @@ void impl_test_axpby_unification(int const N) { impl_test_axpby_unification_compare, tScalarB, view_stride_adapter, view_stride_adapter, Device>(a, x, b, y, N, false, max_val, max_error); - if (valueB == Kokkos::ArithTraits::zero()) { + if (valueB == KokkosKernels::ArithTraits::zero()) { impl_test_axpby_unification_compare, tScalarB, view_stride_adapter, view_stride_adapter, Device>(a, x, b, y, N, true, max_val, max_error); @@ -755,7 +755,7 @@ void impl_test_axpby_unification(int const N) { view_stride_adapter, tScalarB, tScalarB, view_stride_adapter, Device>(a, x, b, y, N, false, max_val, max_error); - if (valueB == Kokkos::ArithTraits::zero()) { + if (valueB == KokkosKernels::ArithTraits::zero()) { impl_test_axpby_unification_compare, view_stride_adapter, tScalarB, tScalarB, view_stride_adapter, Device>(a, x, b, y, N, true, max_val, @@ -790,7 +790,7 @@ void impl_test_axpby_unification(int const N) { view_stride_adapter, tScalarB, ViewTypeBr0, view_stride_adapter, Device>(a, x, b, y, N, false, max_val, max_error); - if (valueB == Kokkos::ArithTraits::zero()) { + if (valueB == KokkosKernels::ArithTraits::zero()) { impl_test_axpby_unification_compare, view_stride_adapter, tScalarB, ViewTypeBr0, view_stride_adapter, Device>(a, x, b, y, N, true, max_val, @@ -823,7 +823,7 @@ void impl_test_axpby_unification(int const N) { tScalarA, view_stride_adapter, view_stride_adapter, tScalarB, view_stride_adapter, view_stride_adapter, Device>(a, x, b, y, N, false, max_val, max_error); - if (valueB == Kokkos::ArithTraits::zero()) { + if (valueB == KokkosKernels::ArithTraits::zero()) { impl_test_axpby_unification_compare< tScalarA, view_stride_adapter, view_stride_adapter, tScalarB, view_stride_adapter, view_stride_adapter, Device>(a, x, b, y, N, true, max_val, @@ -855,7 +855,7 @@ void impl_test_axpby_unification(int const N) { view_stride_adapter, tScalarB, view_stride_adapter, view_stride_adapter, Device>(a, x, b, y, N, false, max_val, max_error); - if (valueB == Kokkos::ArithTraits::zero()) { + if (valueB == KokkosKernels::ArithTraits::zero()) { impl_test_axpby_unification_compare< tScalarA, view_stride_adapter, view_stride_adapter, tScalarB, view_stride_adapter, view_stride_adapter, Device>(a, x, b, y, N, true, max_val, @@ -886,7 +886,7 @@ void impl_test_axpby_unification(int const N) { impl_test_axpby_unification_compare, view_stride_adapter, tScalarB, tScalarB, view_stride_adapter, Device>( a, x, b, y, N, false, max_val, max_error); - if (valueB == Kokkos::ArithTraits::zero()) { + if (valueB == KokkosKernels::ArithTraits::zero()) { impl_test_axpby_unification_compare, view_stride_adapter, tScalarB, tScalarB, view_stride_adapter, Device>(a, x, b, y, N, true, max_val, @@ -921,7 +921,7 @@ void impl_test_axpby_unification(int const N) { view_stride_adapter, tScalarB, ViewTypeBr0, view_stride_adapter, Device>(a, x, b, y, N, false, max_val, max_error); - if (valueB == Kokkos::ArithTraits::zero()) { + if (valueB == KokkosKernels::ArithTraits::zero()) { impl_test_axpby_unification_compare, view_stride_adapter, tScalarB, ViewTypeBr0, view_stride_adapter, Device>(a, x, b, y, N, true, max_val, @@ -954,7 +954,7 @@ void impl_test_axpby_unification(int const N) { tScalarB, view_stride_adapter, view_stride_adapter, Device>(a, x, b, y, N, false, max_val, max_error); - if (valueB == Kokkos::ArithTraits::zero()) { + if (valueB == KokkosKernels::ArithTraits::zero()) { impl_test_axpby_unification_compare< tScalarA, view_stride_adapter, view_stride_adapter, tScalarB, view_stride_adapter, view_stride_adapter, Device>(a, x, b, y, N, true, max_val, @@ -985,7 +985,7 @@ void impl_test_axpby_unification(int const N) { impl_test_axpby_unification_compare, view_stride_adapter, tScalarB, view_stride_adapter, view_stride_adapter, Device>(a, x, b, y, N, false, max_val, max_error); - if (valueB == Kokkos::ArithTraits::zero()) { + if (valueB == KokkosKernels::ArithTraits::zero()) { impl_test_axpby_unification_compare< tScalarA, view_stride_adapter, view_stride_adapter, tScalarB, view_stride_adapter, view_stride_adapter, Device>(a, x, b, y, N, true, max_val, @@ -1022,17 +1022,17 @@ void impl_test_axpby_mv_unification(int const N, int const K) { using ViewTypeY = Kokkos::View; - std::array const valuesA{-1, Kokkos::ArithTraits::zero(), 1, 3}; - std::array const valuesB{-1, Kokkos::ArithTraits::zero(), 1, 5}; + std::array const valuesA{-1, KokkosKernels::ArithTraits::zero(), 1, 3}; + std::array const valuesB{-1, KokkosKernels::ArithTraits::zero(), 1, 5}; // eps should probably be based on tScalarB since that is the type // in which the result is computed. - using MagnitudeB = typename Kokkos::ArithTraits::mag_type; - MagnitudeB const eps = Kokkos::ArithTraits::epsilon(); + using MagnitudeB = typename KokkosKernels::ArithTraits::mag_type; + MagnitudeB const eps = KokkosKernels::ArithTraits::epsilon(); MagnitudeB const max_val = 10; MagnitudeB const max_error = - static_cast(Kokkos::ArithTraits::abs(valuesA[valuesA.size() - 1]) + - Kokkos::ArithTraits::abs(valuesB[valuesB.size() - 1])) * + static_cast(KokkosKernels::ArithTraits::abs(valuesA[valuesA.size() - 1]) + + KokkosKernels::ArithTraits::abs(valuesB[valuesB.size() - 1])) * max_val * eps; // ************************************************************ @@ -1056,7 +1056,7 @@ void impl_test_axpby_mv_unification(int const N, int const K) { impl_test_axpby_mv_unification_compare, tScalarB, tScalarB, view_stride_adapter, Device>(a, x, b, y, N, K, false, max_val, max_error); - if (valueB == Kokkos::ArithTraits::zero()) { + if (valueB == KokkosKernels::ArithTraits::zero()) { impl_test_axpby_mv_unification_compare, tScalarB, tScalarB, view_stride_adapter, Device>(a, x, b, y, N, K, true, max_val, max_error); @@ -1089,7 +1089,7 @@ void impl_test_axpby_mv_unification(int const N, int const K) { impl_test_axpby_mv_unification_compare, tScalarB, ViewTypeBr0, view_stride_adapter, Device>( a, x, b, y, N, K, false, max_val, max_error); - if (valueB == Kokkos::ArithTraits::zero()) { + if (valueB == KokkosKernels::ArithTraits::zero()) { impl_test_axpby_mv_unification_compare, tScalarB, ViewTypeBr0, view_stride_adapter, Device>( a, x, b, y, N, K, true, max_val, max_error); @@ -1120,7 +1120,7 @@ void impl_test_axpby_mv_unification(int const N, int const K) { impl_test_axpby_mv_unification_compare, tScalarB, view_stride_adapter, view_stride_adapter, Device>(a, x, b, y, N, K, false, max_val, max_error); - if (valueB == Kokkos::ArithTraits::zero()) { + if (valueB == KokkosKernels::ArithTraits::zero()) { impl_test_axpby_mv_unification_compare, tScalarB, view_stride_adapter, view_stride_adapter, Device>(a, x, b, y, N, K, true, max_val, max_error); @@ -1185,7 +1185,7 @@ void impl_test_axpby_mv_unification(int const N, int const K) { impl_test_axpby_mv_unification_compare, tScalarB, view_stride_adapter, view_stride_adapter, Device>(a, x, b, y, N, K, false, max_val, max_error); - if (valueB == Kokkos::ArithTraits::zero()) { + if (valueB == KokkosKernels::ArithTraits::zero()) { impl_test_axpby_mv_unification_compare, tScalarB, view_stride_adapter, view_stride_adapter, Device>(a, x, b, y, N, K, true, max_val, max_error); @@ -1253,7 +1253,7 @@ void impl_test_axpby_mv_unification(int const N, int const K) { impl_test_axpby_mv_unification_compare, tScalarB, tScalarB, view_stride_adapter, Device>( a, x, b, y, N, K, false, max_val, max_error); - if (valueB == Kokkos::ArithTraits::zero()) { + if (valueB == KokkosKernels::ArithTraits::zero()) { impl_test_axpby_mv_unification_compare, tScalarB, tScalarB, view_stride_adapter, Device>( a, x, b, y, N, K, true, max_val, max_error); @@ -1287,7 +1287,7 @@ void impl_test_axpby_mv_unification(int const N, int const K) { impl_test_axpby_mv_unification_compare, tScalarB, ViewTypeBr0, view_stride_adapter, Device>( a, x, b, y, N, K, false, max_val, max_error); - if (valueB == Kokkos::ArithTraits::zero()) { + if (valueB == KokkosKernels::ArithTraits::zero()) { impl_test_axpby_mv_unification_compare, tScalarB, ViewTypeBr0, view_stride_adapter, Device>( a, x, b, y, N, K, true, max_val, max_error); @@ -1321,7 +1321,7 @@ void impl_test_axpby_mv_unification(int const N, int const K) { impl_test_axpby_mv_unification_compare, tScalarB, view_stride_adapter, view_stride_adapter, Device>(a, x, b, y, N, K, false, max_val, max_error); - if (valueB == Kokkos::ArithTraits::zero()) { + if (valueB == KokkosKernels::ArithTraits::zero()) { impl_test_axpby_mv_unification_compare, tScalarB, view_stride_adapter, view_stride_adapter, Device>(a, x, b, y, N, K, true, max_val, max_error); @@ -1394,7 +1394,7 @@ void impl_test_axpby_mv_unification(int const N, int const K) { impl_test_axpby_mv_unification_compare, tScalarB, view_stride_adapter, view_stride_adapter, Device>(a, x, b, y, N, K, false, max_val, max_error); - if (valueB == Kokkos::ArithTraits::zero()) { + if (valueB == KokkosKernels::ArithTraits::zero()) { impl_test_axpby_mv_unification_compare, tScalarB, view_stride_adapter, view_stride_adapter, Device>(a, x, b, y, N, K, true, max_val, max_error); @@ -1465,7 +1465,7 @@ void impl_test_axpby_mv_unification(int const N, int const K) { view_stride_adapter, tScalarB, tScalarB, view_stride_adapter, Device>(a, x, b, y, N, K, false, max_val, max_error); - if (valueB == Kokkos::ArithTraits::zero()) { + if (valueB == KokkosKernels::ArithTraits::zero()) { impl_test_axpby_mv_unification_compare, view_stride_adapter, tScalarB, tScalarB, view_stride_adapter, Device>(a, x, b, y, N, K, true, @@ -1500,7 +1500,7 @@ void impl_test_axpby_mv_unification(int const N, int const K) { view_stride_adapter, tScalarB, ViewTypeBr0, view_stride_adapter, Device>(a, x, b, y, N, K, false, max_val, max_error); - if (valueB == Kokkos::ArithTraits::zero()) { + if (valueB == KokkosKernels::ArithTraits::zero()) { impl_test_axpby_mv_unification_compare, view_stride_adapter, tScalarB, ViewTypeBr0, view_stride_adapter, Device>(a, x, b, y, N, K, true, @@ -1533,7 +1533,7 @@ void impl_test_axpby_mv_unification(int const N, int const K) { tScalarA, view_stride_adapter, view_stride_adapter, tScalarB, view_stride_adapter, view_stride_adapter, Device>(a, x, b, y, N, K, false, max_val, max_error); - if (valueB == Kokkos::ArithTraits::zero()) { + if (valueB == KokkosKernels::ArithTraits::zero()) { impl_test_axpby_mv_unification_compare< tScalarA, view_stride_adapter, view_stride_adapter, tScalarB, view_stride_adapter, view_stride_adapter, Device>(a, x, b, y, N, K, true, @@ -1601,7 +1601,7 @@ void impl_test_axpby_mv_unification(int const N, int const K) { tScalarA, view_stride_adapter, view_stride_adapter, tScalarB, view_stride_adapter, view_stride_adapter, Device>(a, x, b, y, N, K, false, max_val, max_error); - if (valueB == Kokkos::ArithTraits::zero()) { + if (valueB == KokkosKernels::ArithTraits::zero()) { impl_test_axpby_mv_unification_compare< tScalarA, view_stride_adapter, view_stride_adapter, tScalarB, view_stride_adapter, view_stride_adapter, Device>(a, x, b, y, N, K, true, @@ -1679,7 +1679,7 @@ void impl_test_axpby_mv_unification(int const N, int const K) { view_stride_adapter, tScalarB, tScalarB, view_stride_adapter, Device>(a, x, b, y, N, K, false, max_val, max_error); - if (valueB == Kokkos::ArithTraits::zero()) { + if (valueB == KokkosKernels::ArithTraits::zero()) { impl_test_axpby_mv_unification_compare, view_stride_adapter, tScalarB, tScalarB, view_stride_adapter, Device>(a, x, b, y, N, K, true, @@ -1724,7 +1724,7 @@ void impl_test_axpby_mv_unification(int const N, int const K) { view_stride_adapter, tScalarB, ViewTypeBr0, view_stride_adapter, Device>(a, x, b, y, N, K, false, max_val, max_error); - if (valueB == Kokkos::ArithTraits::zero()) { + if (valueB == KokkosKernels::ArithTraits::zero()) { impl_test_axpby_mv_unification_compare, view_stride_adapter, tScalarB, ViewTypeBr0, view_stride_adapter, Device>(a, x, b, y, N, K, true, @@ -1767,7 +1767,7 @@ void impl_test_axpby_mv_unification(int const N, int const K) { tScalarA, view_stride_adapter, view_stride_adapter, tScalarB, view_stride_adapter, view_stride_adapter, Device>(a, x, b, y, N, K, false, max_val, max_error); - if (valueB == Kokkos::ArithTraits::zero()) { + if (valueB == KokkosKernels::ArithTraits::zero()) { impl_test_axpby_mv_unification_compare< tScalarA, view_stride_adapter, view_stride_adapter, tScalarB, view_stride_adapter, view_stride_adapter, Device>(a, x, b, y, N, K, true, @@ -1856,7 +1856,7 @@ void impl_test_axpby_mv_unification(int const N, int const K) { tScalarA, view_stride_adapter, view_stride_adapter, tScalarB, view_stride_adapter, view_stride_adapter, Device>(a, x, b, y, N, K, false, max_val, max_error); - if (valueB == Kokkos::ArithTraits::zero()) { + if (valueB == KokkosKernels::ArithTraits::zero()) { impl_test_axpby_mv_unification_compare< tScalarA, view_stride_adapter, view_stride_adapter, tScalarB, view_stride_adapter, view_stride_adapter, Device>(a, x, b, y, N, K, true, @@ -1936,7 +1936,7 @@ void impl_test_axpby_mv_unification(int const N, int const K) { view_stride_adapter, tScalarB, tScalarB, view_stride_adapter, Device>(a, x, b, y, N, K, false, max_val, max_error); - if (valueB == Kokkos::ArithTraits::zero()) { + if (valueB == KokkosKernels::ArithTraits::zero()) { impl_test_axpby_mv_unification_compare, view_stride_adapter, tScalarB, tScalarB, view_stride_adapter, Device>(a, x, b, y, N, K, true, @@ -1971,7 +1971,7 @@ void impl_test_axpby_mv_unification(int const N, int const K) { view_stride_adapter, tScalarB, ViewTypeBr0, view_stride_adapter, Device>(a, x, b, y, N, K, false, max_val, max_error); - if (valueB == Kokkos::ArithTraits::zero()) { + if (valueB == KokkosKernels::ArithTraits::zero()) { impl_test_axpby_mv_unification_compare, view_stride_adapter, tScalarB, ViewTypeBr0, view_stride_adapter, Device>(a, x, b, y, N, K, true, @@ -2004,7 +2004,7 @@ void impl_test_axpby_mv_unification(int const N, int const K) { tScalarA, view_stride_adapter, view_stride_adapter, tScalarB, view_stride_adapter, view_stride_adapter, Device>(a, x, b, y, N, K, false, max_val, max_error); - if (valueB == Kokkos::ArithTraits::zero()) { + if (valueB == KokkosKernels::ArithTraits::zero()) { impl_test_axpby_mv_unification_compare< tScalarA, view_stride_adapter, view_stride_adapter, tScalarB, view_stride_adapter, view_stride_adapter, Device>(a, x, b, y, N, K, true, @@ -2072,7 +2072,7 @@ void impl_test_axpby_mv_unification(int const N, int const K) { tScalarA, view_stride_adapter, view_stride_adapter, tScalarB, view_stride_adapter, view_stride_adapter, Device>(a, x, b, y, N, K, false, max_val, max_error); - if (valueB == Kokkos::ArithTraits::zero()) { + if (valueB == KokkosKernels::ArithTraits::zero()) { impl_test_axpby_mv_unification_compare< tScalarA, view_stride_adapter, view_stride_adapter, tScalarB, view_stride_adapter, view_stride_adapter, Device>(a, x, b, y, N, K, true, @@ -2150,7 +2150,7 @@ void impl_test_axpby_mv_unification(int const N, int const K) { view_stride_adapter, tScalarB, tScalarB, view_stride_adapter, Device>(a, x, b, y, N, K, false, max_val, max_error); - if (valueB == Kokkos::ArithTraits::zero()) { + if (valueB == KokkosKernels::ArithTraits::zero()) { impl_test_axpby_mv_unification_compare, view_stride_adapter, tScalarB, tScalarB, view_stride_adapter, Device>(a, x, b, y, N, K, true, @@ -2195,7 +2195,7 @@ void impl_test_axpby_mv_unification(int const N, int const K) { view_stride_adapter, tScalarB, ViewTypeBr0, view_stride_adapter, Device>(a, x, b, y, N, K, false, max_val, max_error); - if (valueB == Kokkos::ArithTraits::zero()) { + if (valueB == KokkosKernels::ArithTraits::zero()) { impl_test_axpby_mv_unification_compare, view_stride_adapter, tScalarB, ViewTypeBr0, view_stride_adapter, Device>(a, x, b, y, N, K, true, @@ -2238,7 +2238,7 @@ void impl_test_axpby_mv_unification(int const N, int const K) { tScalarA, view_stride_adapter, view_stride_adapter, tScalarB, view_stride_adapter, view_stride_adapter, Device>(a, x, b, y, N, K, false, max_val, max_error); - if (valueB == Kokkos::ArithTraits::zero()) { + if (valueB == KokkosKernels::ArithTraits::zero()) { impl_test_axpby_mv_unification_compare< tScalarA, view_stride_adapter, view_stride_adapter, tScalarB, view_stride_adapter, view_stride_adapter, Device>(a, x, b, y, N, K, true, @@ -2328,7 +2328,7 @@ void impl_test_axpby_mv_unification(int const N, int const K) { tScalarA, view_stride_adapter, view_stride_adapter, tScalarB, view_stride_adapter, view_stride_adapter, Device>(a, x, b, y, N, K, false, max_val, max_error); - if (valueB == Kokkos::ArithTraits::zero()) { + if (valueB == KokkosKernels::ArithTraits::zero()) { impl_test_axpby_mv_unification_compare< tScalarA, view_stride_adapter, view_stride_adapter, tScalarB, view_stride_adapter, view_stride_adapter, Device>(a, x, b, y, N, K, true, diff --git a/blas/unit_test/Test_Blas1_axpy.hpp b/blas/unit_test/Test_Blas1_axpy.hpp index 94e4260268..ee3c6c54a4 100644 --- a/blas/unit_test/Test_Blas1_axpy.hpp +++ b/blas/unit_test/Test_Blas1_axpy.hpp @@ -25,13 +25,13 @@ template void impl_test_axpy(int N) { using ScalarA = typename ViewTypeA::value_type; using ScalarB = typename ViewTypeB::value_type; - using MagnitudeB = typename Kokkos::ArithTraits::mag_type; + using MagnitudeB = typename KokkosKernels::ArithTraits::mag_type; ScalarA a = 3; const MagnitudeB max_val = 10; - const MagnitudeB eps = Kokkos::ArithTraits::epsilon(); + const MagnitudeB eps = KokkosKernels::ArithTraits::epsilon(); const MagnitudeB max_error = - (static_cast(Kokkos::ArithTraits::abs(a)) * max_val + max_val) * eps; + (static_cast(KokkosKernels::ArithTraits::abs(a)) * max_val + max_val) * eps; view_stride_adapter x("X", N); view_stride_adapter y("Y", N); @@ -75,17 +75,17 @@ template void impl_test_axpy_mv(int N, int K) { using ScalarA = typename ViewTypeA::value_type; using ScalarB = typename ViewTypeB::value_type; - using MagnitudeB = typename Kokkos::ArithTraits::mag_type; + using MagnitudeB = typename KokkosKernels::ArithTraits::mag_type; view_stride_adapter x("X", N, K); view_stride_adapter y("Y", N, K); view_stride_adapter org_y("Org_Y", N, K); ScalarA a = 3; - const MagnitudeB eps = Kokkos::ArithTraits::epsilon(); + const MagnitudeB eps = KokkosKernels::ArithTraits::epsilon(); const MagnitudeB max_val = 10; const MagnitudeB max_error = - (static_cast(Kokkos::ArithTraits::abs(a)) * max_val + max_val) * eps; + (static_cast(KokkosKernels::ArithTraits::abs(a)) * max_val + max_val) * eps; Kokkos::Random_XorShift64_Pool rand_pool(13718); diff --git a/blas/unit_test/Test_Blas1_dot.hpp b/blas/unit_test/Test_Blas1_dot.hpp index 3de0fae12d..1f43fe7971 100644 --- a/blas/unit_test/Test_Blas1_dot.hpp +++ b/blas/unit_test/Test_Blas1_dot.hpp @@ -25,7 +25,7 @@ template void impl_test_dot(int N) { typedef typename ViewTypeA::value_type ScalarA; typedef typename ViewTypeB::value_type ScalarB; - typedef Kokkos::ArithTraits ats; + typedef KokkosKernels::ArithTraits ats; view_stride_adapter a("a", N); view_stride_adapter b("b", N); @@ -67,7 +67,7 @@ template void impl_test_dot_mv(int N, int K) { typedef typename ViewTypeA::value_type ScalarA; typedef typename ViewTypeB::value_type ScalarB; - typedef Kokkos::ArithTraits ats; + typedef KokkosKernels::ArithTraits ats; view_stride_adapter a("A", N, K); view_stride_adapter b("B", N, K); diff --git a/blas/unit_test/Test_Blas1_iamax.hpp b/blas/unit_test/Test_Blas1_iamax.hpp index 09e5d256b3..c64c5761dd 100644 --- a/blas/unit_test/Test_Blas1_iamax.hpp +++ b/blas/unit_test/Test_Blas1_iamax.hpp @@ -24,7 +24,7 @@ namespace Test { template void impl_test_iamax(int N) { using ScalarA = typename ViewTypeA::non_const_value_type; - using AT = Kokkos::ArithTraits; + using AT = KokkosKernels::ArithTraits; using mag_type = typename AT::mag_type; using size_type = typename ViewTypeA::size_type; @@ -38,7 +38,7 @@ void impl_test_iamax(int N) { Kokkos::deep_copy(a.h_base, a.d_base); - mag_type expected_result = Kokkos::ArithTraits::min(); + mag_type expected_result = KokkosKernels::ArithTraits::min(); size_type expected_max_loc = 0; for (int i = 0; i < N; i++) { mag_type val = AT::abs(a.h_view(i)); @@ -107,7 +107,7 @@ void impl_test_iamax(int N) { template void impl_test_iamax_mv(int N, int K) { typedef typename ViewTypeA::non_const_value_type ScalarA; - typedef Kokkos::ArithTraits AT; + typedef KokkosKernels::ArithTraits AT; typedef typename AT::mag_type mag_type; typedef typename ViewTypeA::size_type size_type; @@ -125,7 +125,7 @@ void impl_test_iamax_mv(int N, int K) { size_type* expected_max_loc = new size_type[K]; for (int j = 0; j < K; j++) { - expected_result[j] = Kokkos::ArithTraits::min(); + expected_result[j] = KokkosKernels::ArithTraits::min(); for (int i = 0; i < N; i++) { mag_type val = AT::abs(a.h_view(i, j)); if (val > expected_result[j]) { diff --git a/blas/unit_test/Test_Blas1_nrm1.hpp b/blas/unit_test/Test_Blas1_nrm1.hpp index 3942dafe93..119ec7b23c 100644 --- a/blas/unit_test/Test_Blas1_nrm1.hpp +++ b/blas/unit_test/Test_Blas1_nrm1.hpp @@ -23,9 +23,9 @@ namespace Test { template void impl_test_nrm1(int N) { using ScalarA = typename ViewTypeA::value_type; - using AT = Kokkos::ArithTraits; + using AT = KokkosKernels::ArithTraits; using mag_type = typename AT::mag_type; - using MAT = Kokkos::ArithTraits; + using MAT = KokkosKernels::ArithTraits; view_stride_adapter a("a", N); @@ -37,7 +37,7 @@ void impl_test_nrm1(int N) { Kokkos::deep_copy(a.h_base, a.d_base); - double eps = (std::is_same::mag_type, float>::value ? 1e-4 : 1e-7); + double eps = (std::is_same::mag_type, float>::value ? 1e-4 : 1e-7); mag_type expected_result = 0; for (int i = 0; i < N; i++) { @@ -59,9 +59,9 @@ void impl_test_nrm1(int N) { template void impl_test_nrm1_mv(int N, int K) { typedef typename ViewTypeA::value_type ScalarA; - typedef Kokkos::ArithTraits AT; + typedef KokkosKernels::ArithTraits AT; typedef typename AT::mag_type mag_type; - typedef Kokkos::ArithTraits MAT; + typedef KokkosKernels::ArithTraits MAT; view_stride_adapter a("A", N, K); @@ -73,7 +73,7 @@ void impl_test_nrm1_mv(int N, int K) { Kokkos::deep_copy(a.h_base, a.d_base); - double eps = (std::is_same::mag_type, float>::value ? 1e-4 : 1e-7); + double eps = (std::is_same::mag_type, float>::value ? 1e-4 : 1e-7); Kokkos::View expected_result("Expected Nrm1", K); for (int k = 0; k < K; k++) { diff --git a/blas/unit_test/Test_Blas1_nrm2.hpp b/blas/unit_test/Test_Blas1_nrm2.hpp index 556d48f753..a922e58c76 100644 --- a/blas/unit_test/Test_Blas1_nrm2.hpp +++ b/blas/unit_test/Test_Blas1_nrm2.hpp @@ -23,7 +23,7 @@ namespace Test { template void impl_test_nrm2(int N) { typedef typename ViewTypeA::value_type ScalarA; - typedef Kokkos::ArithTraits AT; + typedef KokkosKernels::ArithTraits AT; view_stride_adapter a("a", N); @@ -41,7 +41,7 @@ void impl_test_nrm2(int N) { for (int i = 0; i < N; i++) { expected_result += AT::abs(a.h_view(i)) * AT::abs(a.h_view(i)); } - expected_result = Kokkos::ArithTraits::sqrt(expected_result); + expected_result = KokkosKernels::ArithTraits::sqrt(expected_result); typename AT::mag_type nonconst_result = KokkosBlas::nrm2(a.d_view); EXPECT_NEAR_KK(nonconst_result, expected_result, eps * expected_result); @@ -53,7 +53,7 @@ void impl_test_nrm2(int N) { template void impl_test_nrm2_mv(int N, int K) { typedef typename ViewTypeA::value_type ScalarA; - typedef Kokkos::ArithTraits AT; + typedef KokkosKernels::ArithTraits AT; view_stride_adapter a("A", N, K); @@ -71,7 +71,7 @@ void impl_test_nrm2_mv(int N, int K) { for (int i = 0; i < N; i++) { expected_result[j] += AT::abs(a.h_view(i, j)) * AT::abs(a.h_view(i, j)); } - expected_result[j] = Kokkos::ArithTraits::sqrt(expected_result[j]); + expected_result[j] = KokkosKernels::ArithTraits::sqrt(expected_result[j]); } double eps = std::is_same::value ? 2 * 1e-5 : 1e-7; diff --git a/blas/unit_test/Test_Blas1_nrm2_squared.hpp b/blas/unit_test/Test_Blas1_nrm2_squared.hpp index d718626f8e..37176be5a4 100644 --- a/blas/unit_test/Test_Blas1_nrm2_squared.hpp +++ b/blas/unit_test/Test_Blas1_nrm2_squared.hpp @@ -23,7 +23,7 @@ namespace Test { template void impl_test_nrm2_squared(int N) { typedef typename ViewTypeA::value_type ScalarA; - typedef Kokkos::ArithTraits AT; + typedef KokkosKernels::ArithTraits AT; view_stride_adapter a("a", N); @@ -52,7 +52,7 @@ void impl_test_nrm2_squared(int N) { template void impl_test_nrm2_squared_mv(int N, int K) { typedef typename ViewTypeA::value_type ScalarA; - typedef Kokkos::ArithTraits AT; + typedef KokkosKernels::ArithTraits AT; view_stride_adapter a("A", N, K); diff --git a/blas/unit_test/Test_Blas1_nrm2w.hpp b/blas/unit_test/Test_Blas1_nrm2w.hpp index 6dcc01bf17..c9f31b459a 100644 --- a/blas/unit_test/Test_Blas1_nrm2w.hpp +++ b/blas/unit_test/Test_Blas1_nrm2w.hpp @@ -23,7 +23,7 @@ namespace Test { template void impl_test_nrm2w(int N) { using ScalarA = typename ViewTypeA::value_type; - using AT = Kokkos::ArithTraits; + using AT = KokkosKernels::ArithTraits; using MagnitudeA = typename AT::mag_type; view_stride_adapter a("A", N); @@ -49,7 +49,7 @@ void impl_test_nrm2w(int N) { typename AT::mag_type term = AT::abs(a.h_view(i)) / AT::abs(w.h_view(i)); expected_result += term * term; } - expected_result = Kokkos::ArithTraits::sqrt(expected_result); + expected_result = KokkosKernels::ArithTraits::sqrt(expected_result); typename AT::mag_type nonconst_result = KokkosBlas::nrm2w(a.d_view, w.d_view); EXPECT_NEAR_KK(nonconst_result, expected_result, max_error); @@ -58,7 +58,7 @@ void impl_test_nrm2w(int N) { template void impl_test_nrm2w_mv(int N, int K) { using ScalarA = typename ViewTypeA::value_type; - using AT = Kokkos::ArithTraits; + using AT = KokkosKernels::ArithTraits; using MagnitudeA = typename AT::mag_type; view_stride_adapter a("A", N, K); @@ -86,7 +86,7 @@ void impl_test_nrm2w_mv(int N, int K) { typename AT::mag_type term = AT::abs(a.h_view(i, j)) / AT::abs(w.h_view(i, j)); expected_result[j] += term * term; } - expected_result[j] = Kokkos::ArithTraits::sqrt(expected_result[j]); + expected_result[j] = KokkosKernels::ArithTraits::sqrt(expected_result[j]); } Kokkos::View r("Dot::Result", K); diff --git a/blas/unit_test/Test_Blas1_nrm2w_squared.hpp b/blas/unit_test/Test_Blas1_nrm2w_squared.hpp index 42bcdb0848..0e5e4c8a55 100644 --- a/blas/unit_test/Test_Blas1_nrm2w_squared.hpp +++ b/blas/unit_test/Test_Blas1_nrm2w_squared.hpp @@ -23,7 +23,7 @@ namespace Test { template void impl_test_nrm2w_squared(int N) { using ScalarA = typename ViewTypeA::value_type; - using AT = Kokkos::ArithTraits; + using AT = KokkosKernels::ArithTraits; using MagnitudeA = typename AT::mag_type; view_stride_adapter a("A", N); @@ -57,7 +57,7 @@ void impl_test_nrm2w_squared(int N) { template void impl_test_nrm2w_squared_mv(int N, int K) { using ScalarA = typename ViewTypeA::value_type; - using AT = Kokkos::ArithTraits; + using AT = KokkosKernels::ArithTraits; using MagnitudeA = typename AT::mag_type; view_stride_adapter a("A", N, K); diff --git a/blas/unit_test/Test_Blas1_nrminf.hpp b/blas/unit_test/Test_Blas1_nrminf.hpp index e4a9101e85..330716af4f 100644 --- a/blas/unit_test/Test_Blas1_nrminf.hpp +++ b/blas/unit_test/Test_Blas1_nrminf.hpp @@ -23,7 +23,7 @@ namespace Test { template void impl_test_nrminf(int N) { typedef typename ViewTypeA::non_const_value_type ScalarA; - typedef Kokkos::ArithTraits AT; + typedef KokkosKernels::ArithTraits AT; view_stride_adapter a("A", N); @@ -37,7 +37,7 @@ void impl_test_nrminf(int N) { double eps = std::is_same::value ? 2 * 1e-5 : 1e-7; - typename AT::mag_type expected_result = Kokkos::ArithTraits::min(); + typename AT::mag_type expected_result = KokkosKernels::ArithTraits::min(); for (int i = 0; i < N; i++) if (AT::abs(a.h_view(i)) > expected_result) expected_result = AT::abs(a.h_view(i)); @@ -53,7 +53,7 @@ void impl_test_nrminf(int N) { template void impl_test_nrminf_mv(int N, int K) { typedef typename ViewTypeA::non_const_value_type ScalarA; - typedef Kokkos::ArithTraits AT; + typedef KokkosKernels::ArithTraits AT; view_stride_adapter a("A", N, K); @@ -67,7 +67,7 @@ void impl_test_nrminf_mv(int N, int K) { typename AT::mag_type* expected_result = new typename AT::mag_type[K]; for (int j = 0; j < K; j++) { - expected_result[j] = Kokkos::ArithTraits::min(); + expected_result[j] = KokkosKernels::ArithTraits::min(); for (int i = 0; i < N; i++) { if (AT::abs(a.h_view(i, j)) > expected_result[j]) expected_result[j] = AT::abs(a.h_view(i, j)); } diff --git a/blas/unit_test/Test_Blas1_reciprocal.hpp b/blas/unit_test/Test_Blas1_reciprocal.hpp index 2b8a07a552..04ba3399b5 100644 --- a/blas/unit_test/Test_Blas1_reciprocal.hpp +++ b/blas/unit_test/Test_Blas1_reciprocal.hpp @@ -25,11 +25,11 @@ template void impl_test_reciprocal(int N) { using ScalarA = typename ViewTypeA::value_type; using ScalarB = typename ViewTypeB::value_type; - using AT = Kokkos::ArithTraits; + using AT = KokkosKernels::ArithTraits; using MagnitudeA = typename AT::mag_type; - using MagnitudeB = typename Kokkos::ArithTraits::mag_type; + using MagnitudeB = typename KokkosKernels::ArithTraits::mag_type; - const MagnitudeB eps = Kokkos::ArithTraits::epsilon(); + const MagnitudeB eps = KokkosKernels::ArithTraits::epsilon(); const MagnitudeA one = AT::abs(AT::one()); const MagnitudeA max_val = 10; @@ -53,7 +53,7 @@ void impl_test_reciprocal(int N) { } // Zero out y again, and run again with const input - Kokkos::deep_copy(y.d_view, Kokkos::ArithTraits::zero()); + Kokkos::deep_copy(y.d_view, KokkosKernels::ArithTraits::zero()); KokkosBlas::reciprocal(y.d_view, x.d_view_const); Kokkos::deep_copy(y.h_base, y.d_base); @@ -75,7 +75,7 @@ void impl_test_reciprocal_mv(int N, int K) { { ScalarA randStart, randEnd; Test::getRandomBounds(10, randStart, randEnd); - Kokkos::fill_random(x.d_view, rand_pool, Kokkos::ArithTraits::one(), randEnd); + Kokkos::fill_random(x.d_view, rand_pool, KokkosKernels::ArithTraits::one(), randEnd); } Kokkos::deep_copy(x.h_base, x.d_base); @@ -85,20 +85,20 @@ void impl_test_reciprocal_mv(int N, int K) { Kokkos::deep_copy(y.h_base, y.d_base); for (int j = 0; j < K; ++j) { for (int i = 0; i < N; ++i) { - EXPECT_NEAR_KK(y.h_view(i, j), Kokkos::ArithTraits::one() / ScalarB(x.h_view(i, j)), - 2 * Kokkos::ArithTraits::epsilon()); + EXPECT_NEAR_KK(y.h_view(i, j), KokkosKernels::ArithTraits::one() / ScalarB(x.h_view(i, j)), + 2 * KokkosKernels::ArithTraits::epsilon()); } } // Zero out y again, and run again with const input - Kokkos::deep_copy(y.d_view, Kokkos::ArithTraits::zero()); + Kokkos::deep_copy(y.d_view, KokkosKernels::ArithTraits::zero()); KokkosBlas::reciprocal(y.d_view, x.d_view_const); Kokkos::deep_copy(y.h_base, y.d_base); for (int j = 0; j < K; j++) { for (int i = 0; i < N; ++i) { - EXPECT_NEAR_KK(y.h_view(i, j), Kokkos::ArithTraits::one() / ScalarB(x.h_view(i, j)), - 2 * Kokkos::ArithTraits::epsilon()); + EXPECT_NEAR_KK(y.h_view(i, j), KokkosKernels::ArithTraits::one() / ScalarB(x.h_view(i, j)), + 2 * KokkosKernels::ArithTraits::epsilon()); } } } diff --git a/blas/unit_test/Test_Blas1_rot.hpp b/blas/unit_test/Test_Blas1_rot.hpp index bd323cbda7..2548f289ad 100644 --- a/blas/unit_test/Test_Blas1_rot.hpp +++ b/blas/unit_test/Test_Blas1_rot.hpp @@ -17,7 +17,7 @@ template int test_rot() { - using mag_type = typename Kokkos::ArithTraits::mag_type; + using mag_type = typename KokkosKernels::ArithTraits::mag_type; using vector_type = Kokkos::View; using magnitude_type = Kokkos::View; using scalar_type = Kokkos::View; @@ -63,7 +63,7 @@ int test_rot() { Yref(2) = 0.54; Yref(3) = 0.08; - Scalar const tol = 10 * Kokkos::ArithTraits::eps(); + Scalar const tol = 10 * KokkosKernels::ArithTraits::eps(); for (int idx = 0; idx < 4; ++idx) { Test::EXPECT_NEAR_KK_REL(X_h(idx), Xref(idx), tol); Test::EXPECT_NEAR_KK_REL(Y_h(idx), Yref(idx), tol); diff --git a/blas/unit_test/Test_Blas1_rotg.hpp b/blas/unit_test/Test_Blas1_rotg.hpp index 31945ba6d9..5f0da7ec3f 100644 --- a/blas/unit_test/Test_Blas1_rotg.hpp +++ b/blas/unit_test/Test_Blas1_rotg.hpp @@ -18,12 +18,12 @@ namespace Test { template void test_rotg_impl(typename Device::execution_space const& space, Scalar const a_in, Scalar const b_in) { - using magnitude_type = typename Kokkos::ArithTraits::mag_type; + using magnitude_type = typename KokkosKernels::ArithTraits::mag_type; using SViewType = Kokkos::View; using MViewType = Kokkos::View; - // const magnitude_type eps = Kokkos::ArithTraits::eps(); - // const Scalar zero = Kokkos::ArithTraits::zero(); + // const magnitude_type eps = KokkosKernels::ArithTraits::eps(); + // const Scalar zero = KokkosKernels::ArithTraits::zero(); // Initialize inputs/outputs SViewType a("a"); @@ -44,8 +44,8 @@ void test_rotg_impl(typename Device::execution_space const& space, Scalar const template int test_rotg() { - const Scalar zero = Kokkos::ArithTraits::zero(); - const Scalar one = Kokkos::ArithTraits::one(); + const Scalar zero = KokkosKernels::ArithTraits::zero(); + const Scalar one = KokkosKernels::ArithTraits::one(); const Scalar two = one + one; typename Device::execution_space space{}; diff --git a/blas/unit_test/Test_Blas1_rotm.hpp b/blas/unit_test/Test_Blas1_rotm.hpp index e7cf37300b..73ab8fe752 100644 --- a/blas/unit_test/Test_Blas1_rotm.hpp +++ b/blas/unit_test/Test_Blas1_rotm.hpp @@ -122,7 +122,7 @@ void check_results(vector_view_type &X, vector_view_type &Y, vector_ref_type &Xr Kokkos::deep_copy(X_h, X); Kokkos::deep_copy(Y_h, Y); - Scalar const tol = 10 * Kokkos::ArithTraits::eps(); + Scalar const tol = 10 * KokkosKernels::ArithTraits::eps(); for (int idx = 0; idx < 4; ++idx) { Test::EXPECT_NEAR_KK_REL(X_h(idx), Xref(idx), tol); Test::EXPECT_NEAR_KK_REL(Y_h(idx), Yref(idx), tol); diff --git a/blas/unit_test/Test_Blas1_rotmg.hpp b/blas/unit_test/Test_Blas1_rotmg.hpp index 0fb3c5f67e..6052d81876 100644 --- a/blas/unit_test/Test_Blas1_rotmg.hpp +++ b/blas/unit_test/Test_Blas1_rotmg.hpp @@ -25,7 +25,7 @@ void test_rotmg_impl(View0& d1, View0& d2, View0& x1, View0& y1, PView& param, R KokkosBlas::rotmg(d1, d2, x1, y1_const, param); - const scalar_type eps = Kokkos::ArithTraits::eps(); + const scalar_type eps = KokkosKernels::ArithTraits::eps(); const scalar_type tol = #if defined(KOKKOSKERNELS_ENABLE_TPL_BLAS) || defined(KOKKOSKERNELS_ENABLE_TPL_MKL) 100 * eps; // Guessing MKL implements sin/cos differently so need larger tol diff --git a/blas/unit_test/Test_Blas1_scal.hpp b/blas/unit_test/Test_Blas1_scal.hpp index b0169095fd..63ec289ed8 100644 --- a/blas/unit_test/Test_Blas1_scal.hpp +++ b/blas/unit_test/Test_Blas1_scal.hpp @@ -25,7 +25,7 @@ template void impl_test_scal(int N) { typedef typename ViewTypeA::value_type ScalarA; typedef typename ViewTypeB::value_type ScalarB; - typedef Kokkos::ArithTraits AT; + typedef KokkosKernels::ArithTraits AT; ScalarA a(3); typename AT::mag_type eps = AT::epsilon() * 1000; @@ -50,7 +50,7 @@ void impl_test_scal(int N) { } // Zero out y again and run with const input - Kokkos::deep_copy(y.d_view, Kokkos::ArithTraits::zero()); + Kokkos::deep_copy(y.d_view, KokkosKernels::ArithTraits::zero()); KokkosBlas::scal(y.d_view, a, x.d_view_const); Kokkos::deep_copy(y.h_base, y.d_base); for (int i = 0; i < N; i++) { @@ -62,7 +62,7 @@ template void impl_test_scal_mv(int N, int K) { typedef typename ViewTypeA::value_type ScalarA; typedef typename ViewTypeB::value_type ScalarB; - typedef Kokkos::ArithTraits AT; + typedef KokkosKernels::ArithTraits AT; view_stride_adapter x("X", N, K); view_stride_adapter y("Y", N, K); @@ -92,7 +92,7 @@ void impl_test_scal_mv(int N, int K) { } // Zero out y again, and run again with const input - Kokkos::deep_copy(y.d_view, Kokkos::ArithTraits::zero()); + Kokkos::deep_copy(y.d_view, KokkosKernels::ArithTraits::zero()); KokkosBlas::scal(y.d_view, a, x.d_view_const); Kokkos::deep_copy(y.h_base, y.d_base); for (int i = 0; i < N; i++) { @@ -111,7 +111,7 @@ void impl_test_scal_mv(int N, int K) { auto h_params = Kokkos::create_mirror_view_and_copy(Kokkos::HostSpace(), params); - Kokkos::deep_copy(y.d_view, Kokkos::ArithTraits::zero()); + Kokkos::deep_copy(y.d_view, KokkosKernels::ArithTraits::zero()); KokkosBlas::scal(y.d_view, params, x.d_view); Kokkos::deep_copy(y.h_base, y.d_base); for (int i = 0; i < N; i++) { @@ -120,7 +120,7 @@ void impl_test_scal_mv(int N, int K) { } } - Kokkos::deep_copy(y.d_view, Kokkos::ArithTraits::zero()); + Kokkos::deep_copy(y.d_view, KokkosKernels::ArithTraits::zero()); KokkosBlas::scal(y.d_view, params, x.d_view_const); Kokkos::deep_copy(y.h_base, y.d_base); for (int i = 0; i < N; i++) { diff --git a/blas/unit_test/Test_Blas1_serial_setscal.hpp b/blas/unit_test/Test_Blas1_serial_setscal.hpp index 97932403c0..f19f0c934c 100644 --- a/blas/unit_test/Test_Blas1_serial_setscal.hpp +++ b/blas/unit_test/Test_Blas1_serial_setscal.hpp @@ -91,7 +91,7 @@ template ats; + typedef KokkosKernels::ArithTraits ats; /// radomized input testing views const ScalarType alpha = 11.1; diff --git a/blas/unit_test/Test_Blas1_swap.hpp b/blas/unit_test/Test_Blas1_swap.hpp index dbdad9dc13..cfecf56eb2 100644 --- a/blas/unit_test/Test_Blas1_swap.hpp +++ b/blas/unit_test/Test_Blas1_swap.hpp @@ -9,7 +9,7 @@ void test_swap(int const vector_length) { using memory_space = typename DeviceType::memory_space; using vector_type = Kokkos::View; using scalar_type = typename vector_type::non_const_value_type; - using mag_type = typename Kokkos::ArithTraits::mag_type; + using mag_type = typename KokkosKernels::ArithTraits::mag_type; // Note that Xref and Yref need to always be copies of X and Y // hence the use of create_mirror instead of create_mirror_view. @@ -18,7 +18,7 @@ void test_swap(int const vector_length) { typename vector_type::host_mirror_type Yref = Kokkos::create_mirror(X); // Setup values in X, Y and copy them to Xref and Yref - const scalar_type range = 10 * Kokkos::ArithTraits::one(); + const scalar_type range = 10 * KokkosKernels::ArithTraits::one(); Kokkos::Random_XorShift64_Pool rand_pool(13718); Kokkos::fill_random(X, rand_pool, range); Kokkos::fill_random(Y, rand_pool, range); @@ -34,7 +34,7 @@ void test_swap(int const vector_length) { Kokkos::deep_copy(Xtest, X); Kokkos::deep_copy(Ytest, Y); - const mag_type tol = 10 * Kokkos::ArithTraits::eps(); + const mag_type tol = 10 * KokkosKernels::ArithTraits::eps(); for (int idx = 0; idx < vector_length; ++idx) { Test::EXPECT_NEAR_KK_REL(Xtest(idx), Xref(idx), tol); Test::EXPECT_NEAR_KK_REL(Ytest(idx), Yref(idx), tol); diff --git a/blas/unit_test/Test_Blas1_team_abs.hpp b/blas/unit_test/Test_Blas1_team_abs.hpp index 0f78731ab3..5b8818a924 100644 --- a/blas/unit_test/Test_Blas1_team_abs.hpp +++ b/blas/unit_test/Test_Blas1_team_abs.hpp @@ -40,7 +40,7 @@ void impl_test_team_abs(int N) { typedef typename ViewTypeA::value_type ScalarA; typedef typename ViewTypeB::value_type ScalarB; - typedef Kokkos::ArithTraits AT; + typedef KokkosKernels::ArithTraits AT; double eps = std::is_same::value ? 2 * 1e-5 : 1e-7; @@ -73,7 +73,7 @@ void impl_test_team_abs(int N) { EXPECT_NEAR_KK(nonconst_nonconst_result, expected_result, eps * expected_result); // Zero out y and run again with const input - Kokkos::deep_copy(y.d_view, Kokkos::ArithTraits::zero()); + Kokkos::deep_copy(y.d_view, KokkosKernels::ArithTraits::zero()); // KokkosBlas::abs(y,c_x); Kokkos::parallel_for( @@ -102,7 +102,7 @@ void impl_test_team_abs_mv(int N, int K) { typedef typename ViewTypeA::value_type ScalarA; typedef typename ViewTypeB::value_type ScalarB; - typedef Kokkos::ArithTraits AT; + typedef KokkosKernels::ArithTraits AT; view_stride_adapter x("X", N, K); view_stride_adapter y("Y", N, K); @@ -146,7 +146,7 @@ void impl_test_team_abs_mv(int N, int K) { } // Zero out y and run again with const input - Kokkos::deep_copy(y.d_view, Kokkos::ArithTraits::zero()); + Kokkos::deep_copy(y.d_view, KokkosKernels::ArithTraits::zero()); // KokkosBlas::abs(y,c_x); Kokkos::parallel_for( diff --git a/blas/unit_test/Test_Blas1_team_axpby.hpp b/blas/unit_test/Test_Blas1_team_axpby.hpp index cadb2d0d09..e1a347083a 100644 --- a/blas/unit_test/Test_Blas1_team_axpby.hpp +++ b/blas/unit_test/Test_Blas1_team_axpby.hpp @@ -137,7 +137,7 @@ void impl_test_team_axpby_mv(int N, int K) { Kokkos::View r("Dot::Result", K); - typedef Kokkos::ArithTraits AT; + typedef KokkosKernels::ArithTraits AT; // KokkosBlas::axpby(a,x,b,y); Kokkos::parallel_for( diff --git a/blas/unit_test/Test_Blas1_team_mult.hpp b/blas/unit_test/Test_Blas1_team_mult.hpp index 63fdbf99c1..047695951f 100644 --- a/blas/unit_test/Test_Blas1_team_mult.hpp +++ b/blas/unit_test/Test_Blas1_team_mult.hpp @@ -145,7 +145,7 @@ void impl_test_team_mult_mv(int N, int K) { Kokkos::Random_XorShift64_Pool rand_pool(13718); - typename Kokkos::ArithTraits::mag_type const max_val = 10; + typename KokkosKernels::ArithTraits::mag_type const max_val = 10; Kokkos::fill_random(x.d_view, rand_pool, ScalarA(max_val)); Kokkos::fill_random(y.d_view, rand_pool, ScalarB(max_val)); Kokkos::fill_random(z.d_view, rand_pool, ScalarC(max_val)); @@ -163,9 +163,9 @@ void impl_test_team_mult_mv(int N, int K) { // Since b and a are known and the largest value in z, x and y // is set by the variables max_val, the error upper bound will be // max_error = a * max_val * max_val - typename Kokkos::ArithTraits::mag_type const eps = Kokkos::ArithTraits::epsilon(); - typename Kokkos::ArithTraits::mag_type const max_error = - Kokkos::ArithTraits::abs(a) * max_val * max_val * eps; + typename KokkosKernels::ArithTraits::mag_type const eps = KokkosKernels::ArithTraits::epsilon(); + typename KokkosKernels::ArithTraits::mag_type const max_error = + KokkosKernels::ArithTraits::abs(a) * max_val * max_val * eps; // KokkosBlas::mult(b,z,a,x,y); Kokkos::parallel_for( diff --git a/blas/unit_test/Test_Blas1_team_nrm2.hpp b/blas/unit_test/Test_Blas1_team_nrm2.hpp index befec6e57b..4ac6eb3a3b 100644 --- a/blas/unit_test/Test_Blas1_team_nrm2.hpp +++ b/blas/unit_test/Test_Blas1_team_nrm2.hpp @@ -36,7 +36,7 @@ void impl_test_team_nrm2(int N, int K) { const team_policy policy(K, Kokkos::AUTO); typedef typename ViewTypeA::value_type ScalarA; - typedef Kokkos::ArithTraits AT; + typedef KokkosKernels::ArithTraits AT; view_stride_adapter a("A", N, K); @@ -50,7 +50,7 @@ void impl_test_team_nrm2(int N, int K) { for (int j = 0; j < K; j++) { expected_result[j] = typename AT::mag_type(); for (int i = 0; i < N; i++) expected_result[j] += AT::abs(a.h_view(i, j)) * AT::abs(a.h_view(i, j)); - expected_result[j] = Kokkos::ArithTraits::sqrt(expected_result[j]); + expected_result[j] = KokkosKernels::ArithTraits::sqrt(expected_result[j]); } double eps = std::is_same::value ? 2 * 1e-5 : 1e-7; diff --git a/blas/unit_test/Test_Blas1_team_scal.hpp b/blas/unit_test/Test_Blas1_team_scal.hpp index f3d6707ba3..2f6a039a29 100644 --- a/blas/unit_test/Test_Blas1_team_scal.hpp +++ b/blas/unit_test/Test_Blas1_team_scal.hpp @@ -40,7 +40,7 @@ void impl_test_team_scal(int N) { typedef typename ViewTypeA::value_type ScalarA; typedef typename ViewTypeB::value_type ScalarB; - typedef Kokkos::ArithTraits AT; + typedef KokkosKernels::ArithTraits AT; view_stride_adapter x("X", N); view_stride_adapter y("Y", N); @@ -80,7 +80,7 @@ void impl_test_team_scal(int N) { EXPECT_NEAR_KK(diff, zero, eps); } - Kokkos::deep_copy(y.d_view, Kokkos::ArithTraits::zero()); + Kokkos::deep_copy(y.d_view, KokkosKernels::ArithTraits::zero()); Kokkos::parallel_for( "KokkosBlas::Test::TeamScal", policy, KOKKOS_LAMBDA(const team_member &teamMember) { @@ -113,7 +113,7 @@ void impl_test_team_scal_mv(int N, int K) { typedef typename ViewTypeA::value_type ScalarA; typedef typename ViewTypeB::value_type ScalarB; - typedef Kokkos::ArithTraits AT; + typedef KokkosKernels::ArithTraits AT; view_stride_adapter x("X", N, K); view_stride_adapter y("Y", N, K); @@ -155,7 +155,7 @@ void impl_test_team_scal_mv(int N, int K) { } // Zero out y again, and run again with const input - Kokkos::deep_copy(y.d_view, Kokkos::ArithTraits::zero()); + Kokkos::deep_copy(y.d_view, KokkosKernels::ArithTraits::zero()); Kokkos::parallel_for( "KokkosBlas::Test::TeamScal", policy, KOKKOS_LAMBDA(const team_member &teamMember) { @@ -189,7 +189,7 @@ void impl_test_team_scal_mv(int N, int K) { } // Zero out y to run again - Kokkos::deep_copy(y.d_view, Kokkos::ArithTraits::zero()); + Kokkos::deep_copy(y.d_view, KokkosKernels::ArithTraits::zero()); Kokkos::parallel_for( "KokkosBlas::Test::TeamScal", policy, KOKKOS_LAMBDA(const team_member &teamMember) { @@ -207,7 +207,7 @@ void impl_test_team_scal_mv(int N, int K) { } // Zero out y again, and run again with const input - Kokkos::deep_copy(y.d_view, Kokkos::ArithTraits::zero()); + Kokkos::deep_copy(y.d_view, KokkosKernels::ArithTraits::zero()); Kokkos::parallel_for( "KokkosBlas::Test::TeamScal", policy, KOKKOS_LAMBDA(const team_member &teamMember) { diff --git a/blas/unit_test/Test_Blas1_team_setscal.hpp b/blas/unit_test/Test_Blas1_team_setscal.hpp index f7ceb5d7d0..8c8b9e0cc3 100644 --- a/blas/unit_test/Test_Blas1_team_setscal.hpp +++ b/blas/unit_test/Test_Blas1_team_setscal.hpp @@ -97,7 +97,7 @@ template ats; + typedef KokkosKernels::ArithTraits ats; /// radomized input testing views const ScalarType alpha = 11.1; diff --git a/blas/unit_test/Test_Blas2_gemv.hpp b/blas/unit_test/Test_Blas2_gemv.hpp index be6e4a6d51..4f23777f5e 100644 --- a/blas/unit_test/Test_Blas2_gemv.hpp +++ b/blas/unit_test/Test_Blas2_gemv.hpp @@ -27,7 +27,7 @@ void impl_test_gemv_streams(ExecutionSpace& space, const char* mode, int M, int typedef typename ViewTypeA::value_type ScalarA; typedef typename ViewTypeX::value_type ScalarX; typedef typename ViewTypeY::value_type ScalarY; - typedef Kokkos::ArithTraits KAT_Y; + typedef KokkosKernels::ArithTraits KAT_Y; const ScalarA alpha = 3; ScalarY beta = 5; diff --git a/blas/unit_test/Test_Blas2_ger.hpp b/blas/unit_test/Test_Blas2_ger.hpp index 49ff7af983..8df17ba7f2 100644 --- a/blas/unit_test/Test_Blas2_ger.hpp +++ b/blas/unit_test/Test_Blas2_ger.hpp @@ -73,7 +73,7 @@ class GerTester { using _HostViewTypeA = typename _ViewTypeA::host_mirror_type; using _ViewTypeExpected = Kokkos::View; - using _KAT_A = Kokkos::ArithTraits; + using _KAT_A = KokkosKernels::ArithTraits; using _AuxType = typename _KAT_A::mag_type; void populateVariables(ScalarA& alpha, view_stride_adapter<_ViewTypeX, false>& x, diff --git a/blas/unit_test/Test_Blas2_syr.hpp b/blas/unit_test/Test_Blas2_syr.hpp index 9092108f85..b78e1fd775 100644 --- a/blas/unit_test/Test_Blas2_syr.hpp +++ b/blas/unit_test/Test_Blas2_syr.hpp @@ -69,7 +69,7 @@ class SyrTester { using _HostViewTypeA = typename _ViewTypeA::host_mirror_type; using _ViewTypeExpected = Kokkos::View; - using _KAT_A = Kokkos::ArithTraits; + using _KAT_A = KokkosKernels::ArithTraits; using _AuxType = typename _KAT_A::mag_type; void populateVariables(ScalarA& alpha, view_stride_adapter<_ViewTypeX, false>& x, diff --git a/blas/unit_test/Test_Blas2_syr2.hpp b/blas/unit_test/Test_Blas2_syr2.hpp index 2e68ee11c6..e3082650f5 100644 --- a/blas/unit_test/Test_Blas2_syr2.hpp +++ b/blas/unit_test/Test_Blas2_syr2.hpp @@ -76,7 +76,7 @@ class Syr2Tester { using _HostViewTypeA = typename _ViewTypeA::host_mirror_type; using _ViewTypeExpected = Kokkos::View; - using _KAT_A = Kokkos::ArithTraits; + using _KAT_A = KokkosKernels::ArithTraits; using _AuxType = typename _KAT_A::mag_type; void populateVariables(ScalarA& alpha, view_stride_adapter<_ViewTypeX, false>& x, @@ -251,7 +251,7 @@ void Syr2Tester bool expectedResultIsKnown = false; using AlphaCoeffType = typename _ViewTypeA::non_const_value_type; - ScalarA alpha(Kokkos::ArithTraits::zero()); + ScalarA alpha(KokkosKernels::ArithTraits::zero()); // ******************************************************************** // Step 2 of 7: populate alpha, h_x, h_A, h_expected, x, A diff --git a/blas/unit_test/Test_Blas3_gemm.hpp b/blas/unit_test/Test_Blas3_gemm.hpp index d56886cf13..60d62d50f8 100644 --- a/blas/unit_test/Test_Blas3_gemm.hpp +++ b/blas/unit_test/Test_Blas3_gemm.hpp @@ -34,7 +34,7 @@ struct gemm_VanillaGEMM { typedef typename ViewTypeA::value_type ScalarA; typedef typename ViewTypeB::value_type ScalarB; typedef typename ViewTypeC::value_type ScalarC; - typedef Kokkos::ArithTraits APT; + typedef KokkosKernels::ArithTraits APT; typedef typename APT::mag_type mag_type; ScalarA alpha; ScalarC beta; @@ -128,7 +128,7 @@ struct DiffGEMM { ViewTypeC C, C2; typedef typename ViewTypeC::value_type ScalarC; - typedef Kokkos::ArithTraits APT; + typedef KokkosKernels::ArithTraits APT; typedef typename APT::mag_type mag_type; KOKKOS_INLINE_FUNCTION @@ -160,7 +160,7 @@ void impl_test_gemm(const char* TA, const char* TB, int M, int N, int K, typenam typedef typename ViewTypeA::value_type ScalarA; typedef typename ViewTypeB::value_type ScalarB; typedef typename ViewTypeC::value_type ScalarC; - typedef Kokkos::ArithTraits APT; + typedef KokkosKernels::ArithTraits APT; typedef typename APT::mag_type mag_type; double machine_eps = APT::epsilon(); @@ -239,7 +239,7 @@ void impl_test_stream_gemm_psge2(const int M, const int N, const int K, const Sc using ViewTypeB = Kokkos::View; using ViewTypeC = Kokkos::View; using ScalarC = typename ViewTypeC::value_type; - using APT = Kokkos::ArithTraits; + using APT = KokkosKernels::ArithTraits; using mag_type = typename APT::mag_type; const char tA[] = {"N"}; @@ -365,9 +365,9 @@ void test_gemm_mixed_scalars() { Matrix1 C("C", dim2, dim1); Matrix2 D("D", dim2, dim1); - Kokkos::deep_copy(A, Kokkos::ArithTraits::one()); - Kokkos::deep_copy(B, Kokkos::ArithTraits::one()); - Kokkos::deep_copy(C, Kokkos::ArithTraits::one()); + Kokkos::deep_copy(A, KokkosKernels::ArithTraits::one()); + Kokkos::deep_copy(B, KokkosKernels::ArithTraits::one()); + Kokkos::deep_copy(C, KokkosKernels::ArithTraits::one()); KokkosBlas::gemm(TestDevice(), "N", "N", 1.0, D, A, 0.0, C); KokkosBlas::gemm(TestDevice(), "N", "T", 1.0, C, D, 0.0, B); diff --git a/blas/unit_test/Test_Blas3_trmm.hpp b/blas/unit_test/Test_Blas3_trmm.hpp index 1dbbf8e5a3..d139296007 100644 --- a/blas/unit_test/Test_Blas3_trmm.hpp +++ b/blas/unit_test/Test_Blas3_trmm.hpp @@ -55,7 +55,7 @@ struct trmm_VanillaGEMM { typedef typename ViewTypeA::value_type ScalarA; typedef typename ViewTypeB::value_type ScalarB; typedef typename ViewTypeC::value_type ScalarC; - typedef Kokkos::ArithTraits APT; + typedef KokkosKernels::ArithTraits APT; typedef typename APT::mag_type mag_type; ScalarA alpha; ScalarC beta; @@ -98,7 +98,7 @@ void impl_test_trmm(const char* side, const char* uplo, const char* trans, const Scalar alpha) { using execution_space = typename ViewTypeA::device_type::execution_space; using ScalarA = typename ViewTypeA::value_type; - using APT = Kokkos::ArithTraits; + using APT = KokkosKernels::ArithTraits; using mag_type = typename APT::mag_type; double machine_eps = APT::epsilon(); @@ -113,7 +113,7 @@ void impl_test_trmm(const char* side, const char* uplo, const char* trans, const // printf("KokkosBlas::trmm test for alpha %g, %c %c %c %c, M %d, N %d, eps // %g, ViewType: %s\n", - // Kokkos::ArithTraits::real(alpha),side[0],uplo[0],trans[0],diag[0],M,N,eps,typeid(ViewTypeA).name()); + // KokkosKernels::ArithTraits::real(alpha),side[0],uplo[0],trans[0],diag[0],M,N,eps,typeid(ViewTypeA).name()); typename ViewTypeA::host_mirror_type host_A = Kokkos::create_mirror_view(A); typename ViewTypeB::host_mirror_type host_B_actual = Kokkos::create_mirror_view(B); diff --git a/blas/unit_test/Test_Blas3_trsm.hpp b/blas/unit_test/Test_Blas3_trsm.hpp index 982682bc4b..7b2a33a4dc 100644 --- a/blas/unit_test/Test_Blas3_trsm.hpp +++ b/blas/unit_test/Test_Blas3_trsm.hpp @@ -55,7 +55,7 @@ struct trsm_VanillaGEMM { typedef typename ViewTypeA::value_type ScalarA; typedef typename ViewTypeB::value_type ScalarB; typedef typename ViewTypeC::value_type ScalarC; - typedef Kokkos::ArithTraits APT; + typedef KokkosKernels::ArithTraits APT; typedef typename APT::mag_type mag_type; ScalarA alpha; ScalarC beta; @@ -99,7 +99,7 @@ void impl_test_trsm(const char* side, const char* uplo, const char* trans, const typename ViewTypeA::value_type alpha) { using execution_space = typename ViewTypeA::device_type::execution_space; using ScalarA = typename ViewTypeA::value_type; - using APT = Kokkos::ArithTraits; + using APT = KokkosKernels::ArithTraits; using mag_type = typename APT::mag_type; double machine_eps = APT::epsilon(); diff --git a/blas/unit_test/Test_Blas_serial_axpy.hpp b/blas/unit_test/Test_Blas_serial_axpy.hpp index fba8d17b4a..9d2711aa4b 100644 --- a/blas/unit_test/Test_Blas_serial_axpy.hpp +++ b/blas/unit_test/Test_Blas_serial_axpy.hpp @@ -77,7 +77,7 @@ template void impl_test_blas_serial_axpy(const int N, const int BlkSize) { /// typedefs using value_type = typename ViewType::value_type; - using ats = Kokkos::ArithTraits; + using ats = KokkosKernels::ArithTraits; /// radomized input testing views const ScalarType alpha = 11.1; diff --git a/blas/unit_test/Test_Blas_serial_nrm2.hpp b/blas/unit_test/Test_Blas_serial_nrm2.hpp index d0b27ad955..06a81d2ffe 100644 --- a/blas/unit_test/Test_Blas_serial_nrm2.hpp +++ b/blas/unit_test/Test_Blas_serial_nrm2.hpp @@ -49,12 +49,12 @@ struct Functor_TestBlasSerialNrm2 { KOKKOS_INLINE_FUNCTION void operator()(const NaiveTag &, const int k) const { auto X = Kokkos::subview(_x, k, Kokkos::ALL()); - _nrm(k) = Kokkos::ArithTraits::zero(); + _nrm(k) = KokkosKernels::ArithTraits::zero(); for (int i = 0; i < X.extent_int(0); ++i) { _nrm(k) += IPT::norm(IPT::dot(X(i), X(i))); } - _nrm(k) = Kokkos::ArithTraits::sqrt(_nrm(k)); + _nrm(k) = KokkosKernels::ArithTraits::sqrt(_nrm(k)); } inline void run() { @@ -100,11 +100,11 @@ struct Functor_TestBlasSerialNrm2MV { auto R = Kokkos::subview(_nrm, k, Kokkos::ALL()); for (int colIdx = 0; colIdx < X.extent_int(1); ++colIdx) { - R(colIdx) = Kokkos::ArithTraits::zero(); + R(colIdx) = KokkosKernels::ArithTraits::zero(); for (int rowIdx = 0; rowIdx < X.extent_int(0); ++rowIdx) { R(colIdx) += IPT::norm(IPT::dot(X(rowIdx, colIdx), X(rowIdx, colIdx))); } - R(colIdx) = Kokkos::ArithTraits::sqrt(R(colIdx)); + R(colIdx) = KokkosKernels::ArithTraits::sqrt(R(colIdx)); } } @@ -129,7 +129,7 @@ void impl_test_blas_serial_nrm2(const int N, const int BlkSize) { /// typedefs using execution_space = typename DeviceType::execution_space; using value_type = typename ViewType::non_const_value_type; - using ats = Kokkos::ArithTraits; + using ats = KokkosKernels::ArithTraits; using IPT = Kokkos::Details::InnerProductSpaceTraits; using norm_type = typename IPT::mag_type; using norm_view_type = Kokkos::View; @@ -166,7 +166,7 @@ void impl_test_blas_serial_nrm2mv(const int N, const int vecLength, const int nu /// typedefs using execution_space = typename DeviceType::execution_space; using value_type = typename ViewType::non_const_value_type; - using ats = Kokkos::ArithTraits; + using ats = KokkosKernels::ArithTraits; using IPT = Kokkos::Details::InnerProductSpaceTraits; using norm_type = typename IPT::mag_type; using norm_view_type = Kokkos::View; diff --git a/common/impl/KokkosKernels_NaN.hpp b/common/impl/KokkosKernels_NaN.hpp index 75d6a3ac8c..03bf41e4b3 100644 --- a/common/impl/KokkosKernels_NaN.hpp +++ b/common/impl/KokkosKernels_NaN.hpp @@ -29,7 +29,7 @@ KOKKOS_INLINE_FUNCTION T quiet_NaN() { return double(Kokkos::Experimental::quiet_NaN_v); // Kokkos::Experimetnal::quiet_NaN_v // is undefined in // device code - } else if constexpr (Kokkos::ArithTraits::is_complex) { + } else if constexpr (KokkosKernels::ArithTraits::is_complex) { using value_type = typename T::value_type; return T(quiet_NaN(), quiet_NaN()); // Kokkos::complex ctor is not constexpr diff --git a/common/impl/KokkosKernels_SafeCompare.hpp b/common/impl/KokkosKernels_SafeCompare.hpp index 1bd43c046a..dcf3b2d15c 100644 --- a/common/impl/KokkosKernels_SafeCompare.hpp +++ b/common/impl/KokkosKernels_SafeCompare.hpp @@ -43,8 +43,8 @@ namespace Impl { */ template KOKKOS_INLINE_FUNCTION constexpr bool safe_gt(const T &t, const U &u) { - using KT = Kokkos::ArithTraits; - using KU = Kokkos::ArithTraits; + using KT = KokkosKernels::ArithTraits; + using KU = KokkosKernels::ArithTraits; // both are integer, but only one is signed if constexpr (KT::is_integer && KU::is_integer && (KT::is_signed != KU::is_signed)) { diff --git a/common/src/KokkosKernels_IOUtils.hpp b/common/src/KokkosKernels_IOUtils.hpp index b0d48beb6a..2aeff5262c 100644 --- a/common/src/KokkosKernels_IOUtils.hpp +++ b/common/src/KokkosKernels_IOUtils.hpp @@ -42,8 +42,8 @@ namespace Impl { // For complex, both real and imaginary parts will have interval (-mag, mag) template inline void getRandomBounds(double mag, Scalar &start, Scalar &end) { - start = -mag * Kokkos::ArithTraits::one(); - end = mag * Kokkos::ArithTraits::one(); + start = -mag * KokkosKernels::ArithTraits::one(); + end = mag * KokkosKernels::ArithTraits::one(); } template <> diff --git a/common/src/KokkosKernels_Predicates.hpp b/common/src/KokkosKernels_Predicates.hpp index 0eda8fac86..b53e7c826a 100644 --- a/common/src/KokkosKernels_Predicates.hpp +++ b/common/src/KokkosKernels_Predicates.hpp @@ -32,7 +32,7 @@ namespace KokkosKernels { template struct GT { using value_type = T; - static_assert(!Kokkos::ArithTraits::is_complex, "Please define custom predicates for ordering complex types"); + static_assert(!KokkosKernels::ArithTraits::is_complex, "Please define custom predicates for ordering complex types"); /** * @brief Return true if a is greater than b @@ -50,7 +50,7 @@ struct GT { template struct GTE { using value_type = T; - static_assert(!Kokkos::ArithTraits::is_complex, "Please define custom predicates for ordering complex types"); + static_assert(!KokkosKernels::ArithTraits::is_complex, "Please define custom predicates for ordering complex types"); /// \brief return a >= b KOKKOS_INLINE_FUNCTION constexpr bool operator()(const value_type &a, const value_type &b) const noexcept { @@ -64,7 +64,7 @@ struct GTE { template struct LT { using value_type = T; - static_assert(!Kokkos::ArithTraits::is_complex, "Please define custom predicates for ordering complex types"); + static_assert(!KokkosKernels::ArithTraits::is_complex, "Please define custom predicates for ordering complex types"); /// \brief return a < b KOKKOS_INLINE_FUNCTION constexpr bool operator()(const value_type &a, const value_type &b) const noexcept { @@ -78,7 +78,7 @@ struct LT { template struct LTE { using value_type = T; - static_assert(!Kokkos::ArithTraits::is_complex, "Please define custom predicates for ordering complex types"); + static_assert(!KokkosKernels::ArithTraits::is_complex, "Please define custom predicates for ordering complex types"); /// \brief return a <= b KOKKOS_INLINE_FUNCTION constexpr bool operator()(const value_type &a, const value_type &b) const noexcept { diff --git a/common/src/KokkosKernels_SimpleUtils.hpp b/common/src/KokkosKernels_SimpleUtils.hpp index ba72ed14fb..fd481770f8 100644 --- a/common/src/KokkosKernels_SimpleUtils.hpp +++ b/common/src/KokkosKernels_SimpleUtils.hpp @@ -21,7 +21,7 @@ #define KOKKOSKERNELS_MACRO_MIN(x, y) ((x) < (y) ? (x) : (y)) #define KOKKOSKERNELS_MACRO_MAX(x, y) ((x) < (y) ? (y) : (x)) -#define KOKKOSKERNELS_MACRO_ABS(x) Kokkos::ArithTraits::type>::abs(x) +#define KOKKOSKERNELS_MACRO_ABS(x) KokkosKernels::ArithTraits::type>::abs(x) namespace KokkosKernels { @@ -37,7 +37,7 @@ class SquareRootFunctor { KOKKOS_INLINE_FUNCTION void operator()(const size_type i) const { typedef typename ViewType::value_type value_type; - theView_(i) = Kokkos::ArithTraits::sqrt(theView_(i)); + theView_(i) = KokkosKernels::ArithTraits::sqrt(theView_(i)); } private: @@ -237,7 +237,7 @@ inline void kk_reduce_view2(size_t num_elements, view_t arr, size_t &reduction) } template ::mag_type> + typename eps_type = typename KokkosKernels::ArithTraits::mag_type> struct IsIdenticalFunctor { view_type1 view1; view_type2 view2; @@ -248,7 +248,7 @@ struct IsIdenticalFunctor { KOKKOS_INLINE_FUNCTION void operator()(const size_t &i, size_t &is_equal) const { typedef typename view_type2::non_const_value_type val_type; - typedef Kokkos::ArithTraits KAT; + typedef KokkosKernels::ArithTraits KAT; typedef typename KAT::mag_type mag_type; const mag_type val_diff = KAT::abs(view1(i) - view2(i)); @@ -279,7 +279,7 @@ bool kk_is_identical_view(view_type1 view1, view_type2 view2, eps_type eps) { } template ::mag_type> + typename eps_type = typename KokkosKernels::ArithTraits::mag_type> struct IsRelativelyIdenticalFunctor { view_type1 view1; view_type2 view2; @@ -291,9 +291,9 @@ struct IsRelativelyIdenticalFunctor { KOKKOS_INLINE_FUNCTION void operator()(const size_t &i, size_t &num_diffs) const { typedef typename view_type2::non_const_value_type val_type; - typedef Kokkos::ArithTraits KAT; + typedef KokkosKernels::ArithTraits KAT; typedef typename KAT::mag_type mag_type; - typedef Kokkos::ArithTraits KATM; + typedef KokkosKernels::ArithTraits KATM; mag_type val_diff = KATM::zero(); if (KAT::abs(view1(i)) > mag_type(eps) || KAT::abs(view2(i)) > mag_type(eps)) { diff --git a/common/src/KokkosKernels_Utils.hpp b/common/src/KokkosKernels_Utils.hpp index fea55c2d19..a98cf98eef 100644 --- a/common/src/KokkosKernels_Utils.hpp +++ b/common/src/KokkosKernels_Utils.hpp @@ -737,7 +737,7 @@ template void zero_vector(ExecSpaceIn &exec_space_in, typename value_array_type::value_type /* num_elements */, value_array_type &vector) { typedef typename value_array_type::non_const_value_type val_type; - Kokkos::deep_copy(exec_space_in, vector, Kokkos::ArithTraits::zero()); + Kokkos::deep_copy(exec_space_in, vector, KokkosKernels::ArithTraits::zero()); exec_space_in.fence(); } diff --git a/common/src/Kokkos_ArithTraits.hpp b/common/src/Kokkos_ArithTraits.hpp index 62cc81b130..a6441d16a1 100644 --- a/common/src/Kokkos_ArithTraits.hpp +++ b/common/src/Kokkos_ArithTraits.hpp @@ -18,7 +18,7 @@ #define KOKKOSKERNELS_KOKKOS_ARITHTRAITS_HPP /// \file Kokkos_ArithTraits.hpp -/// \brief Declaration and definition of Kokkos::ArithTraits +/// \brief Declaration and definition of KokkosKernels::ArithTraits #include #include diff --git a/common/src/Kokkos_InnerProductSpaceTraits.hpp b/common/src/Kokkos_InnerProductSpaceTraits.hpp index d190009168..3e121dea23 100644 --- a/common/src/Kokkos_InnerProductSpaceTraits.hpp +++ b/common/src/Kokkos_InnerProductSpaceTraits.hpp @@ -105,7 +105,7 @@ namespace Details { /// /// \section Kokkos_IPST_new Adding a specialization for a new type T /// -/// You must first add a specialization of Kokkos::ArithTraits. Please +/// You must first add a specialization of KokkosKernels::ArithTraits. Please /// note that if CUDA does not support using T in device functions, /// then you must not mark norm() or dot() as device functions /// in your specialization. (Simply omit the KOKKOS_FORCEINLINE_FUNCTION @@ -119,13 +119,13 @@ class InnerProductSpaceTraits { typedef T val_type; //! The type returned by norm(x) for a value x of type val_type. - typedef typename Kokkos::ArithTraits::mag_type mag_type; + typedef typename KokkosKernels::ArithTraits::mag_type mag_type; //! The type returned by dot(x,y) for values x and y of type val_type. typedef val_type dot_type; //! The "norm" (absolute value or magnitude) of a value x of type val_type. - static KOKKOS_FORCEINLINE_FUNCTION mag_type norm(const val_type& x) { return Kokkos::ArithTraits::abs(x); } + static KOKKOS_FORCEINLINE_FUNCTION mag_type norm(const val_type& x) { return KokkosKernels::ArithTraits::abs(x); } /// \brief The "dot product" of two values x and y of type val_type. /// /// This default implementation should suffice unless val_type is @@ -141,10 +141,10 @@ class InnerProductSpaceTraits { template <> struct InnerProductSpaceTraits { typedef long double val_type; - typedef Kokkos::ArithTraits::mag_type mag_type; + typedef KokkosKernels::ArithTraits::mag_type mag_type; typedef val_type dot_type; - static mag_type norm(const val_type& x) { return Kokkos::ArithTraits::abs(x); } + static mag_type norm(const val_type& x) { return KokkosKernels::ArithTraits::abs(x); } static dot_type dot(const val_type& x, const val_type& y) { return x * y; } }; @@ -153,10 +153,10 @@ template class InnerProductSpaceTraits> { public: typedef Kokkos::complex val_type; - typedef typename Kokkos::ArithTraits::mag_type mag_type; + typedef typename KokkosKernels::ArithTraits::mag_type mag_type; typedef val_type dot_type; - static KOKKOS_FORCEINLINE_FUNCTION mag_type norm(const val_type& x) { return Kokkos::ArithTraits::abs(x); } + static KOKKOS_FORCEINLINE_FUNCTION mag_type norm(const val_type& x) { return KokkosKernels::ArithTraits::abs(x); } static KOKKOS_FORCEINLINE_FUNCTION dot_type dot(const val_type& x, const val_type& y) { return Kokkos::conj(x) * y; } }; @@ -167,10 +167,10 @@ class InnerProductSpaceTraits> { template struct InnerProductSpaceTraits> { typedef std::complex val_type; - typedef typename Kokkos::ArithTraits::mag_type mag_type; + typedef typename KokkosKernels::ArithTraits::mag_type mag_type; typedef val_type dot_type; - static mag_type norm(const val_type& x) { return Kokkos::ArithTraits::abs(x); } + static mag_type norm(const val_type& x) { return KokkosKernels::ArithTraits::abs(x); } static dot_type dot(const val_type& x, const val_type& y) { return std::conj(x) * y; } }; @@ -184,10 +184,10 @@ struct InnerProductSpaceTraits> { template <> struct InnerProductSpaceTraits<__float128> { typedef __float128 val_type; - typedef typename Kokkos::ArithTraits::mag_type mag_type; + typedef typename KokkosKernels::ArithTraits::mag_type mag_type; typedef val_type dot_type; - static mag_type norm(const val_type& x) { return Kokkos::ArithTraits::abs(x); } + static mag_type norm(const val_type& x) { return KokkosKernels::ArithTraits::abs(x); } static dot_type dot(const val_type& x, const val_type& y) { return x * y; } }; @@ -205,26 +205,26 @@ struct InnerProductSpaceTraits<__float128> { // functions. It should be possible to use Kokkos' support for // aggregate types to implement device function support for dd_real // and qd_real, but we have not done this yet (as of 07 Jan 2014). -// Hence, the class methods of the Kokkos::ArithTraits specializations for +// Hence, the class methods of the KokkosKernels::ArithTraits specializations for // dd_real and qd_real are not marked as device functions. #ifdef HAVE_KOKKOS_QD template <> struct InnerProductSpaceTraits { typedef dd_real val_type; - typedef Kokkos::ArithTraits::mag_type mag_type; + typedef KokkosKernels::ArithTraits::mag_type mag_type; typedef val_type dot_type; - static mag_type norm(const val_type& x) { return Kokkos::ArithTraits::abs(x); } + static mag_type norm(const val_type& x) { return KokkosKernels::ArithTraits::abs(x); } static dot_type dot(const val_type& x, const val_type& y) { return x * y; } }; template <> struct InnerProductSpaceTraits { typedef qd_real val_type; - typedef Kokkos::ArithTraits::mag_type mag_type; + typedef KokkosKernels::ArithTraits::mag_type mag_type; typedef val_type dot_type; - static mag_type norm(const val_type& x) { return Kokkos::ArithTraits::abs(x); } + static mag_type norm(const val_type& x) { return KokkosKernels::ArithTraits::abs(x); } static dot_type dot(const val_type& x, const val_type& y) { return x * y; } }; #endif // HAVE_KOKKOS_QD diff --git a/common/unit_test/Test_Common_ArithTraits.hpp b/common/unit_test/Test_Common_ArithTraits.hpp index b1fe860f8a..c55a196a84 100644 --- a/common/unit_test/Test_Common_ArithTraits.hpp +++ b/common/unit_test/Test_Common_ArithTraits.hpp @@ -15,15 +15,15 @@ //@HEADER /// \file ArithTraitsTest.hpp -/// \brief Templated test for Kokkos::ArithTraits +/// \brief Templated test for KokkosKernels::ArithTraits /// /// This header file is an implementation detail of the tests for -/// Kokkos::ArithTraits. Users must not rely on it existing, +/// KokkosKernels::ArithTraits. Users must not rely on it existing, /// or on its contents. This header file should not be /// installed with Kokkos' other header files. /// /// On the other hand, this header file does give examples of how to -/// use Kokkos::ArithTraits, so it may be useful for users to +/// use KokkosKernels::ArithTraits, so it may be useful for users to /// read it. #ifndef KOKKOSKERNELS_TEST_COMMON_ARITHTRAITSTEST_HPP @@ -48,7 +48,7 @@ #endif namespace { -// Whether Kokkos::ArithTraits implements +// Whether KokkosKernels::ArithTraits implements // transcendental functions. These include sqrt, pow, log, and // log10. template @@ -89,8 +89,8 @@ struct HasTranscendentals { } // namespace /// \class ArithTraitsTesterBase -/// \brief Base class providing tests for Kokkos::ArithTraits -/// \tparam ScalarType Any type for which Kokkos::ArithTraits +/// \brief Base class providing tests for KokkosKernels::ArithTraits +/// \tparam ScalarType Any type for which KokkosKernels::ArithTraits /// has a specialization, and which can be executed on the parallel /// device. /// \tparam DeviceType A Kokkos parallel device type. @@ -104,8 +104,8 @@ struct HasTranscendentals { /// types. /// /// This class provides a Kokkos reduction operator for testing -/// Kokkos::ArithTraits. This test works for any type -/// ScalarType for which Kokkos::ArithTraits has a +/// KokkosKernels::ArithTraits. This test works for any type +/// ScalarType for which KokkosKernels::ArithTraits has a /// specialization, and which can be executed on the parallel device. /// /// The tests include those suitable for execution on the parallel @@ -157,7 +157,7 @@ class ArithTraitsTesterBase { /// test's result. KOKKOS_INLINE_FUNCTION void operator()(size_type iwork, value_type& dst) const { TRACE(); - typedef Kokkos::ArithTraits AT; + typedef KokkosKernels::ArithTraits AT; (void)iwork; // not using this argument int success = 1; @@ -266,7 +266,7 @@ class ArithTraitsTesterBase { /// /// \return \c 1 if all the tests pass, else \c 0. int testHost(std::ostream& out) const { - typedef Kokkos::ArithTraits AT; + typedef KokkosKernels::ArithTraits AT; using std::endl; int success = 1; @@ -378,7 +378,7 @@ class ArithTraitsTesterBase { /// \brief Base class of ArithTraitsTester that exercises /// transcendental functions, if and only if ArithTraits /// implements them. -/// \tparam ScalarType Any type for which Kokkos::ArithTraits +/// \tparam ScalarType Any type for which KokkosKernels::ArithTraits /// implements transcendental functions, along with the requirements /// imposed by ArithTraitsTesterBase. /// \tparam DeviceType A Kokkos parallel device type. @@ -437,7 +437,7 @@ class ArithTraitsTesterTranscendentalBase KOKKOS_INLINE_FUNCTION void operator()(size_type iwork, value_type& dst) const { TRACE(); - // typedef Kokkos::ArithTraits AT; + // typedef KokkosKernels::ArithTraits AT; (void)iwork; // forestall compiler warning for unused variable int success = 1; @@ -458,7 +458,7 @@ class ArithTraitsTesterTranscendentalBase protected: virtual int testHostImpl(std::ostream& out) const { using std::endl; - // typedef Kokkos::ArithTraits AT; + // typedef KokkosKernels::ArithTraits AT; int success = 1; if (HasTranscendentals::value) { @@ -491,16 +491,16 @@ class ArithTraitsTesterTranscendentalBase KOKKOS_INLINE_FUNCTION bool equal(const ScalarType& a, const ScalarType& b) const { - if (b != Kokkos::ArithTraits::zero()) { + if (b != KokkosKernels::ArithTraits::zero()) { if (a > b) - return (a - b) / b < 2 * Kokkos::ArithTraits::epsilon(); + return (a - b) / b < 2 * KokkosKernels::ArithTraits::epsilon(); else - return (b - a) / b < 2 * Kokkos::ArithTraits::epsilon(); + return (b - a) / b < 2 * KokkosKernels::ArithTraits::epsilon(); } else { if (a > b) - return (a - b) < 2 * Kokkos::ArithTraits::epsilon(); + return (a - b) < 2 * KokkosKernels::ArithTraits::epsilon(); else - return (b - a) < 2 * Kokkos::ArithTraits::epsilon(); + return (b - a) < 2 * KokkosKernels::ArithTraits::epsilon(); } } @@ -515,7 +515,7 @@ class ArithTraitsTesterTranscendentalBase KOKKOS_INLINE_FUNCTION void operator()(size_type iwork, value_type& dst) const { TRACE(); - typedef Kokkos::ArithTraits AT; + typedef KokkosKernels::ArithTraits AT; (void)iwork; // forestall compiler warning for unused variable int success = 1; @@ -719,7 +719,7 @@ class ArithTraitsTesterTranscendentalBase protected: virtual int testHostImpl(std::ostream& out) const { using std::endl; - typedef Kokkos::ArithTraits AT; + typedef KokkosKernels::ArithTraits AT; int success = 1; if (!HasTranscendentals::value) { @@ -923,7 +923,7 @@ class ArithTraitsTesterTranscendentalBase }; /// \class ArithTraitsTesterComplexBase -/// \brief Execute Kokkos::ArithTraits tests relevant to +/// \brief Execute KokkosKernels::ArithTraits tests relevant to /// complex numbers (whether or not \c ScalarType is itself a /// complex-valued type). /// @@ -934,7 +934,7 @@ class ArithTraitsTesterTranscendentalBase /// Some tests will be executed whether or not ScalarType is /// complex, but the specific tests that are run will depend on /// ScalarType. -template ::is_complex> +template ::is_complex> class ArithTraitsTesterComplexBase : public ArithTraitsTesterTranscendentalBase { private: //! The base class of this class. @@ -981,7 +981,7 @@ class ArithTraitsTesterComplexBase KOKKOS_INLINE_FUNCTION void operator()(size_type iwork, value_type& dst) const { TRACE(); - typedef Kokkos::ArithTraits AT; + typedef KokkosKernels::ArithTraits AT; (void)iwork; // forestall compiler warning for unused variable int success = 1; @@ -1020,7 +1020,7 @@ class ArithTraitsTesterComplexBase protected: virtual int testHostImpl(std::ostream& out) const { using std::endl; - typedef Kokkos::ArithTraits AT; + typedef KokkosKernels::ArithTraits AT; int success = 1; // Apparently, std::numeric_limits::is_signed is 1 only for real @@ -1066,7 +1066,7 @@ class ArithTraitsTesterComplexBase KOKKOS_INLINE_FUNCTION void operator()(size_type iwork, value_type& dst) const { TRACE(); - typedef Kokkos::ArithTraits AT; + typedef KokkosKernels::ArithTraits AT; (void)iwork; // forestall compiler warning for unused variable int success = 1; @@ -1074,7 +1074,7 @@ class ArithTraitsTesterComplexBase FAILURE(); } typedef typename AT::mag_type mag_type; - const mag_type one = Kokkos::ArithTraits::one(); + const mag_type one = KokkosKernels::ArithTraits::one(); // This presumes that ScalarType, being a complex number, has a // constructor which takes two mag_type arguments. @@ -1099,7 +1099,7 @@ class ArithTraitsTesterComplexBase protected: virtual int testHostImpl(std::ostream& out) const { using std::endl; - typedef Kokkos::ArithTraits AT; + typedef KokkosKernels::ArithTraits AT; int success = 1; if (!AT::is_complex) { @@ -1107,7 +1107,7 @@ class ArithTraitsTesterComplexBase FAILURE(); } typedef typename AT::mag_type mag_type; - const mag_type one = Kokkos::ArithTraits::one(); + const mag_type one = KokkosKernels::ArithTraits::one(); // This presumes that ScalarType, being a complex number, has a // constructor which takes two mag_type arguments. @@ -1143,19 +1143,19 @@ class ArithTraitsTesterComplexBase /// \tparam DeviceType A Kokkos parallel device type. /// /// Kokkos reduction operator for testing those attributes of -/// Kokkos::ArithTraits relevant to floating-point types. +/// KokkosKernels::ArithTraits relevant to floating-point types. /// /// The tests include those suitable for execution on the parallel /// device (operator()) and those suitable for execution on the host /// (testHost()). The device-based test is a reduction over redundant /// executions of the test. All redundant executions must return /// '1' (passed). -template ::is_exact> +template ::is_exact> class ArithTraitsTesterFloatingPointBase - : public ArithTraitsTesterComplexBase::is_complex> { + : public ArithTraitsTesterComplexBase::is_complex> { private: //! The base class of this class. - typedef ArithTraitsTesterComplexBase::is_complex> base_type; + typedef ArithTraitsTesterComplexBase::is_complex> base_type; public: typedef DeviceType execution_space; @@ -1178,10 +1178,10 @@ class ArithTraitsTesterFloatingPointBase // template class ArithTraitsTesterFloatingPointBase - : public ArithTraitsTesterComplexBase::is_complex> { + : public ArithTraitsTesterComplexBase::is_complex> { private: //! The base class of this class. - typedef ArithTraitsTesterComplexBase::is_complex> base_type; + typedef ArithTraitsTesterComplexBase::is_complex> base_type; public: typedef typename DeviceType::execution_space execution_space; @@ -1194,7 +1194,7 @@ class ArithTraitsTesterFloatingPointBase KOKKOS_INLINE_FUNCTION void operator()(size_type iwork, value_type& dst) const { TRACE(); - typedef Kokkos::ArithTraits AT; + typedef KokkosKernels::ArithTraits AT; (void)iwork; // forestall compiler warning for unused variable int success = 1; @@ -1262,7 +1262,7 @@ class ArithTraitsTesterFloatingPointBase protected: virtual int testHostImpl(std::ostream& out) const { - typedef Kokkos::ArithTraits AT; + typedef KokkosKernels::ArithTraits AT; using std::endl; int success = 1; @@ -1337,10 +1337,10 @@ class ArithTraitsTesterFloatingPointBase // template class ArithTraitsTesterFloatingPointBase - : public ArithTraitsTesterComplexBase::is_complex> { + : public ArithTraitsTesterComplexBase::is_complex> { private: //! The base class of this class. - typedef ArithTraitsTesterComplexBase::is_complex> base_type; + typedef ArithTraitsTesterComplexBase::is_complex> base_type; public: typedef typename DeviceType::execution_space execution_space; @@ -1353,7 +1353,7 @@ class ArithTraitsTesterFloatingPointBase KOKKOS_INLINE_FUNCTION void operator()(size_type iwork, value_type& dst) const { TRACE(); - typedef Kokkos::ArithTraits AT; + typedef KokkosKernels::ArithTraits AT; (void)iwork; // forestall compiler warning for unused variable int success = 1; @@ -1374,7 +1374,7 @@ class ArithTraitsTesterFloatingPointBase protected: virtual int testHostImpl(std::ostream& out) const { - typedef Kokkos::ArithTraits AT; + typedef KokkosKernels::ArithTraits AT; using std::endl; int success = 1; @@ -1393,8 +1393,8 @@ class ArithTraitsTesterFloatingPointBase }; /// \class ArithTraitsTester -/// \brief Tests for Kokkos::ArithTraits -/// \tparam ScalarType Any type for which Kokkos::ArithTraits +/// \brief Tests for KokkosKernels::ArithTraits +/// \tparam ScalarType Any type for which KokkosKernels::ArithTraits /// has a specialization, and which can be executed on the parallel /// device. /// \tparam DeviceType A Kokkos parallel device type. @@ -1409,9 +1409,9 @@ class ArithTraitsTesterFloatingPointBase /// for host functions do use run-time polymorphism. /// /// This class (through its base class) provides a Kokkos reduction -/// operator for testing Kokkos::ArithTraits. This test +/// operator for testing KokkosKernels::ArithTraits. This test /// works for any type ScalarType for which -/// Kokkos::ArithTraits has a specialization, and which can +/// KokkosKernels::ArithTraits has a specialization, and which can /// be executed on the parallel device. /// /// The tests include those suitable for execution on the parallel @@ -1431,8 +1431,8 @@ class ArithTraitsTester : public ArithTraitsTesterFloatingPointBase::name() << " passed" << endl; + if (verbose) out << KokkosKernels::ArithTraits::name() << " passed" << endl; } else { - out << Kokkos::ArithTraits::name() << " FAILED" << endl; + out << KokkosKernels::ArithTraits::name() << " FAILED" << endl; } return success; } -/// \brief Run the Kokkos::ArithTraits tests on the host. -/// \tparam ScalarType Any type for which Kokkos::ArithTraits +/// \brief Run the KokkosKernels::ArithTraits tests on the host. +/// \tparam ScalarType Any type for which KokkosKernels::ArithTraits /// has a specialization. /// \tparam DeviceType A Kokkos parallel device type. /// @@ -1470,14 +1470,14 @@ int testArithTraitsOnHost(std::ostream& out, const int verbose) { const int localSuccess = f.testHost(out); if (localSuccess) { - if (verbose) out << Kokkos::ArithTraits::name() << " passed" << endl; + if (verbose) out << KokkosKernels::ArithTraits::name() << " passed" << endl; } else { - out << Kokkos::ArithTraits::name() << " FAILED" << endl; + out << KokkosKernels::ArithTraits::name() << " FAILED" << endl; } return localSuccess; } -/// \brief Run the Kokkos::ArithTraits tests for all (valid) +/// \brief Run the KokkosKernels::ArithTraits tests for all (valid) /// scalar types, on the given parallel device. /// \tparam DeviceType A Kokkos parallel device type. /// @@ -1566,7 +1566,7 @@ int runAllArithTraitsDeviceTests(std::ostream& out, const int verbose) { return success && curSuccess; } -/// \brief Run the Kokkos::ArithTraits tests for all scalar +/// \brief Run the KokkosKernels::ArithTraits tests for all scalar /// types, on the host. /// \tparam DeviceType A Kokkos parallel device type. /// diff --git a/common/unit_test/Test_Common_Sorting.hpp b/common/unit_test/Test_Common_Sorting.hpp index e4e62e5936..8bc1b058fa 100644 --- a/common/unit_test/Test_Common_Sorting.hpp +++ b/common/unit_test/Test_Common_Sorting.hpp @@ -74,7 +74,7 @@ are some specializations template T getRandom() { - return rand() % Kokkos::ArithTraits::max(); + return rand() % KokkosKernels::ArithTraits::max(); } // Generate a uniform double between (-5, 5) diff --git a/docs/source/API/blas/blas1_rot.rst b/docs/source/API/blas/blas1_rot.rst index 76e183e2a2..4536d2a802 100644 --- a/docs/source/API/blas/blas1_rot.rst +++ b/docs/source/API/blas/blas1_rot.rst @@ -43,7 +43,7 @@ Type Requirements - `MagnitudeView` must be a Kokkos `View `_ of rank 0 that satisfies: - ``Kokkos::SpaceAccessibility::accessible == true`` - - ``!Kokkos::ArithTraits::is_complex`` + - ``!KokkosKernels::ArithTraits::is_complex`` - `ScalarView` must be a Kokkos `View `_ of rank 0 that satisfies: diff --git a/docs/source/API/blas/blas1_rotg.rst b/docs/source/API/blas/blas1_rotg.rst index e6a0632e23..17f3609370 100644 --- a/docs/source/API/blas/blas1_rotg.rst +++ b/docs/source/API/blas/blas1_rotg.rst @@ -37,7 +37,7 @@ Type Requirements - `MViewType` must be a Kokkos `View `_ of rank 0 that satisfies: - ``Kokkos::SpaceAccessibility::accessible == true`` - - ``!Kokkos::ArithTraits::is_complex`` + - ``!KokkosKernels::ArithTraits::is_complex`` Example ======= diff --git a/docs/source/API/blas/blas1_rotm.rst b/docs/source/API/blas/blas1_rotm.rst index 8c23c47de0..a195f47201 100644 --- a/docs/source/API/blas/blas1_rotm.rst +++ b/docs/source/API/blas/blas1_rotm.rst @@ -39,13 +39,13 @@ Type Requirements - ``Kokkos::SpaceAccessibility::accessible == true`` - ``std::is_same_v == true`` - - ``!Kokkos::ArithTraits::is_complex`` + - ``!KokkosKernels::ArithTraits::is_complex`` - `ParamView` must be a Kokkos `View `_ of rank 1 and compile-time extent 5 that satisfies: - ``Kokkos::SpaceAccessibility::accessible == true`` - ``std::is_same_v == true`` - - ``!Kokkos::ArithTraits::is_complex`` + - ``!KokkosKernels::ArithTraits::is_complex`` Example ======= diff --git a/docs/source/API/blas/blas1_rotmg.rst b/docs/source/API/blas/blas1_rotmg.rst index 931dce6d5b..3df8388bc3 100644 --- a/docs/source/API/blas/blas1_rotmg.rst +++ b/docs/source/API/blas/blas1_rotmg.rst @@ -63,18 +63,18 @@ Type Requirements - ``Kokkos::SpaceAccessibility::accessible == true`` - ``std::is_same_v == true`` - - ``!Kokkos::ArithTraits::is_complex`` + - ``!KokkosKernels::ArithTraits::is_complex`` - `YView` must be a Kokkos `View `_ of rank 0 that satisfies: - ``Kokkos::SpaceAccessibility::accessible == true`` - - ``!Kokkos::ArithTraits::is_complex`` + - ``!KokkosKernels::ArithTraits::is_complex`` - `PView` must be a Kokkos `View `_ of rank 1 and compile-time extent 5 that satisfies: - ``Kokkos::SpaceAccessibility::accessible == true`` - ``std::is_same_v == true`` - - ``!Kokkos::ArithTraits::is_complex`` + - ``!KokkosKernels::ArithTraits::is_complex`` Example ======= diff --git a/docs/source/API/sparse/bsr_row_view.rst b/docs/source/API/sparse/bsr_row_view.rst index 26ab92924e..86b1b8f708 100644 --- a/docs/source/API/sparse/bsr_row_view.rst +++ b/docs/source/API/sparse/bsr_row_view.rst @@ -189,9 +189,9 @@ findRelBlockOffset KOKKOS_INLINE_FUNCTION ordinal_type findRelBlockOffset(const ordinal_type idx_to_match, bool /*is_sorted*/ = false) const; -Return offset into ``colidx_`` for the requested block idx. If none found, return ``Kokkos::ArithTraits::max()``. +Return offset into ``colidx_`` for the requested block idx. If none found, return ``KokkosKernels::ArithTraits::max()``. Parameters ^^^^^^^^^^ -:id_to_math: The index to find in the row, if the index is not found ``Kokkos::ArithTraits::max()`` is returned. +:id_to_math: The index to find in the row, if the index is not found ``KokkosKernels::ArithTraits::max()`` is returned. diff --git a/docs/source/API/sparse/par_ilut.rst b/docs/source/API/sparse/par_ilut.rst index 43eb3c61e9..d6070b5ccf 100644 --- a/docs/source/API/sparse/par_ilut.rst +++ b/docs/source/API/sparse/par_ilut.rst @@ -172,7 +172,7 @@ Example using sp_matrix_type = KokkosSparse::CrsMatrix; using KernelHandle = KokkosKernels::Experimental::KokkosKernelsHandle; - using float_t = typename Kokkos::ArithTraits::mag_type; + using float_t = typename KokkosKernels::ArithTraits::mag_type; // Create a diagonally dominant sparse matrix to test: // par_ilut settings max_iters, res_delta_stop, fill_in_limit, and diff --git a/docs/source/API/sparse/sort_crs.rst b/docs/source/API/sparse/sort_crs.rst index 1e118a6c88..c75ccbdc4f 100644 --- a/docs/source/API/sparse/sort_crs.rst +++ b/docs/source/API/sparse/sort_crs.rst @@ -57,7 +57,7 @@ sort_crs_matrix void sort_crs_matrix(const execution_space& exec, const rowmap_t& rowmap, const entries_t& entries, const values_t& values, typename entries_t::non_const_value_type numCols = - Kokkos::ArithTraits::max(), + KokkosKernels::ArithTraits::max(), SortAlgorithm option = SortAlgorithm::DEFAULT); Sorts the adjacent column list for each row of a CRS matrix into ascending order. Permutes the values accordingly. @@ -91,7 +91,7 @@ sort_bsr_matrix void sort_bsr_matrix(const execution_space& exec, Ordinal blockSize, const rowmap_t& rowmap, const entries_t& entries, const values_t& values, typename entries_t::non_const_value_type numCols = - Kokkos::ArithTraits::max()); + KokkosKernels::ArithTraits::max()); Sorts the rows of a Block Row Storage (BRS) matrix, permuting the values accordingly. @@ -124,7 +124,7 @@ sort_crs_graph template void sort_crs_graph(const execution_space& exec, const rowmap_t& rowmap, const entries_t& entries, typename entries_t::non_const_value_type numCols = - Kokkos::ArithTraits::max(), + KokkosKernels::ArithTraits::max(), SortAlgorithm option = SortAlgorithm::DEFAULT); Sorts the adjacent column list for each row of a CRS graph into ascending order. @@ -157,7 +157,7 @@ sort_and_merge_matrix const entries_t& entries_in, const values_t& values_in, rowmap_t& rowmap_out, entries_t& entries_out, values_t& values_out, typename entries_t::const_value_type& numCols = - Kokkos::ArithTraits::max(), + KokkosKernels::ArithTraits::max(), SortAlgorithm option = SortAlgorithm::DEFAULT); Produces a new CRS matrix that is sorted and has no duplicate entries. Values for duplicate entries are summed. @@ -194,7 +194,7 @@ sort_and_merge_graph void sort_and_merge_graph(const exec_space& exec, const typename rowmap_t::const_type& rowmap_in, const entries_t& entries_in, rowmap_t& rowmap_out, entries_t& entries_out, typename entries_t::const_value_type& numCols = - Kokkos::ArithTraits::max(), + KokkosKernels::ArithTraits::max(), SortAlgorithm option = SortAlgorithm::DEFAULT); Produces a new CRS graph that is sorted and has no duplicate entries. diff --git a/example/batched_solve/team_GMRES.cpp b/example/batched_solve/team_GMRES.cpp index f231268c15..f94f8e0050 100644 --- a/example/batched_solve/team_GMRES.cpp +++ b/example/batched_solve/team_GMRES.cpp @@ -204,7 +204,7 @@ int main(int /*argc*/, char ** /*argv*/) { using Layout = typename AMatrixValueView::array_layout; using EXSP = typename AMatrixValueView::execution_space; - using MagnitudeType = typename Kokkos::ArithTraits::mag_type; + using MagnitudeType = typename KokkosKernels::ArithTraits::mag_type; using Norm2DViewType = Kokkos::View; using Scalar3DViewType = Kokkos::View; diff --git a/example/wiki/blas/KokkosBlas1_wiki_iamax.cpp b/example/wiki/blas/KokkosBlas1_wiki_iamax.cpp index 7c264d6a8c..53e06ec095 100644 --- a/example/wiki/blas/KokkosBlas1_wiki_iamax.cpp +++ b/example/wiki/blas/KokkosBlas1_wiki_iamax.cpp @@ -13,7 +13,7 @@ int main(int argc, char* argv[]) { using ViewType = Kokkos::View; using Scalar = typename ViewType::non_const_value_type; - using AT = Kokkos::ArithTraits; + using AT = KokkosKernels::ArithTraits; using mag_type = typename AT::mag_type; using size_type = typename ViewType::size_type; @@ -28,7 +28,7 @@ int main(int argc, char* argv[]) { size_type max_loc = KokkosBlas::iamax(x); - mag_type expected_result = Kokkos::ArithTraits::min(); + mag_type expected_result = KokkosKernels::ArithTraits::min(); size_type expected_max_loc = 0; for (int i = 0; i < N; i++) { mag_type val = AT::abs(h_x(i)); diff --git a/example/wiki/blas/KokkosBlas2_wiki_ger.cpp b/example/wiki/blas/KokkosBlas2_wiki_ger.cpp index 89eaaf9292..efc000e514 100644 --- a/example/wiki/blas/KokkosBlas2_wiki_ger.cpp +++ b/example/wiki/blas/KokkosBlas2_wiki_ger.cpp @@ -15,7 +15,7 @@ int main(int argc, char* argv[]) { Kokkos::deep_copy(x, 3.0); Kokkos::deep_copy(y, 1.3); - const double alpha = Kokkos::ArithTraits::one(); + const double alpha = KokkosKernels::ArithTraits::one(); KokkosBlas::ger("T", alpha, x, y, A); } diff --git a/example/wiki/sparse/KokkosSparse_wiki_bsrmatrix.cpp b/example/wiki/sparse/KokkosSparse_wiki_bsrmatrix.cpp index b59e54b051..7d004ff40c 100644 --- a/example/wiki/sparse/KokkosSparse_wiki_bsrmatrix.cpp +++ b/example/wiki/sparse/KokkosSparse_wiki_bsrmatrix.cpp @@ -40,7 +40,7 @@ int main() { using entries_type = typename graph_type::entries_type; using values_type = typename matrix_type::values_type; - const Scalar SC_ONE = Kokkos::ArithTraits::one(); + const Scalar SC_ONE = KokkosKernels::ArithTraits::one(); Ordinal numRows = 10; diff --git a/example/wiki/sparse/KokkosSparse_wiki_crsmatrix.cpp b/example/wiki/sparse/KokkosSparse_wiki_crsmatrix.cpp index cc4db57a6c..c1430590fa 100644 --- a/example/wiki/sparse/KokkosSparse_wiki_crsmatrix.cpp +++ b/example/wiki/sparse/KokkosSparse_wiki_crsmatrix.cpp @@ -37,7 +37,7 @@ int main() { using entries_type = typename graph_type::entries_type; using values_type = typename matrix_type::values_type; - const Scalar SC_ONE = Kokkos::ArithTraits::one(); + const Scalar SC_ONE = KokkosKernels::ArithTraits::one(); Ordinal numRows = 10; diff --git a/example/wiki/sparse/KokkosSparse_wiki_gauss_seidel.cpp b/example/wiki/sparse/KokkosSparse_wiki_gauss_seidel.cpp index dbf486bc50..800e869e4d 100644 --- a/example/wiki/sparse/KokkosSparse_wiki_gauss_seidel.cpp +++ b/example/wiki/sparse/KokkosSparse_wiki_gauss_seidel.cpp @@ -31,7 +31,7 @@ // Helper to print out colors in the shape of the grid int main() { using Scalar = KokkosKernels::default_scalar; - using Mag = Kokkos::ArithTraits::mag_type; + using Mag = KokkosKernels::ArithTraits::mag_type; using Ordinal = KokkosKernels::default_lno_t; using Offset = KokkosKernels::default_size_type; using ExecSpace = Kokkos::DefaultExecutionSpace; @@ -42,8 +42,8 @@ int main() { using Matrix = KokkosSparse::CrsMatrix; using Vector = typename Matrix::values_type; constexpr Ordinal numRows = 10000; - const Scalar one = Kokkos::ArithTraits::one(); - const Mag magOne = Kokkos::ArithTraits::one(); + const Scalar one = KokkosKernels::ArithTraits::one(); + const Mag magOne = KokkosKernels::ArithTraits::one(); // Solve tolerance const Mag tolerance = 1e-6 * magOne; Kokkos::initialize(); diff --git a/example/wiki/sparse/KokkosSparse_wiki_spmv.cpp b/example/wiki/sparse/KokkosSparse_wiki_spmv.cpp index 1caeec7e54..753f7bfbf7 100644 --- a/example/wiki/sparse/KokkosSparse_wiki_spmv.cpp +++ b/example/wiki/sparse/KokkosSparse_wiki_spmv.cpp @@ -29,7 +29,7 @@ using Layout = KokkosKernels::default_layout; template struct check_spmv_functor { Yvector y; - const Scalar SC_ONE = Kokkos::ArithTraits::one(); + const Scalar SC_ONE = KokkosKernels::ArithTraits::one(); check_spmv_functor(Yvector y_) : y(y_){}; @@ -52,7 +52,7 @@ int main() { int return_value = 0; { - const Scalar SC_ONE = Kokkos::ArithTraits::one(); + const Scalar SC_ONE = KokkosKernels::ArithTraits::one(); // The mat_structure view is used to generate a matrix using // finite difference (FD) or finite element (FE) discretization diff --git a/lapack/impl/KokkosLapack_svd_spec.hpp b/lapack/impl/KokkosLapack_svd_spec.hpp index 01adc5cff2..00b596c78e 100644 --- a/lapack/impl/KokkosLapack_svd_spec.hpp +++ b/lapack/impl/KokkosLapack_svd_spec.hpp @@ -48,7 +48,7 @@ struct svd_eti_spec_avail { EXEC_SPACE_TYPE, \ Kokkos::View, \ Kokkos::MemoryTraits>, \ - Kokkos::View::mag_type *, Kokkos::LayoutLeft, \ + Kokkos::View::mag_type *, Kokkos::LayoutLeft, \ Kokkos::Device, Kokkos::MemoryTraits>, \ Kokkos::View, \ Kokkos::MemoryTraits>, \ @@ -106,7 +106,7 @@ struct SVD, \ Kokkos::MemoryTraits>, \ - Kokkos::View::mag_type *, Kokkos::LayoutLeft, \ + Kokkos::View::mag_type *, Kokkos::LayoutLeft, \ Kokkos::Device, Kokkos::MemoryTraits>, \ Kokkos::View, \ Kokkos::MemoryTraits>, \ @@ -119,7 +119,7 @@ struct SVD, \ Kokkos::MemoryTraits>, \ - Kokkos::View::mag_type *, Kokkos::LayoutLeft, \ + Kokkos::View::mag_type *, Kokkos::LayoutLeft, \ Kokkos::Device, Kokkos::MemoryTraits>, \ Kokkos::View, \ Kokkos::MemoryTraits>, \ diff --git a/lapack/tpls/KokkosLapack_Host_tpl.hpp b/lapack/tpls/KokkosLapack_Host_tpl.hpp index 092f9ac9f0..669076fc91 100644 --- a/lapack/tpls/KokkosLapack_Host_tpl.hpp +++ b/lapack/tpls/KokkosLapack_Host_tpl.hpp @@ -33,8 +33,8 @@ struct HostLapack { static void gesv(int n, int rhs, T *a, int lda, int *ipiv, T *b, int ldb, int info); static void gesvd(const char jobu, const char jobvt, const int m, const int n, T *A, const int lda, - typename Kokkos::ArithTraits::mag_type *S, T *U, const int ldu, T *Vt, const int ldvt, T *work, - int lwork, typename Kokkos::ArithTraits::mag_type *rwork, int info); + typename KokkosKernels::ArithTraits::mag_type *S, T *U, const int ldu, T *Vt, const int ldvt, T *work, + int lwork, typename KokkosKernels::ArithTraits::mag_type *rwork, int info); static int trtri(const char uplo, const char diag, int n, const T *a, int lda); }; diff --git a/lapack/tpls/KokkosLapack_gesv_tpl_spec_decl.hpp b/lapack/tpls/KokkosLapack_gesv_tpl_spec_decl.hpp index 7185f385cd..6c2f9ea9bd 100644 --- a/lapack/tpls/KokkosLapack_gesv_tpl_spec_decl.hpp +++ b/lapack/tpls/KokkosLapack_gesv_tpl_spec_decl.hpp @@ -59,8 +59,8 @@ void lapackGesvWrapper(const AViewType& A, const BViewType& B, const IPIVViewTyp int info = 0; if (with_pivot) { - if constexpr (Kokkos::ArithTraits::is_complex) { - using MagType = typename Kokkos::ArithTraits::mag_type; + if constexpr (KokkosKernels::ArithTraits::is_complex) { + using MagType = typename KokkosKernels::ArithTraits::mag_type; HostLapack>::gesv(N, NRHS, reinterpret_cast*>(A.data()), LDA, IPIV.data(), reinterpret_cast*>(B.data()), LDB, @@ -138,7 +138,7 @@ template void magmaGesvWrapper(const ExecSpace& space, const AViewType& A, const BViewType& B, const IPIVViewType& IPIV) { using scalar_type = typename AViewType::non_const_value_type; - Kokkos::Profiling::pushRegion("KokkosLapack::gesv[TPL_MAGMA," + Kokkos::ArithTraits::name() + "]"); + Kokkos::Profiling::pushRegion("KokkosLapack::gesv[TPL_MAGMA," + KokkosKernels::ArithTraits::name() + "]"); gesv_print_specialization(); const bool with_pivot = !((IPIV.extent(0) == 0) && (IPIV.data() == nullptr)); diff --git a/lapack/tpls/KokkosLapack_svd_tpl_spec_avail.hpp b/lapack/tpls/KokkosLapack_svd_tpl_spec_avail.hpp index d3317c0760..2a775396d6 100644 --- a/lapack/tpls/KokkosLapack_svd_tpl_spec_avail.hpp +++ b/lapack/tpls/KokkosLapack_svd_tpl_spec_avail.hpp @@ -33,7 +33,7 @@ struct svd_tpl_spec_avail { EXECSPACE, \ Kokkos::View, \ Kokkos::MemoryTraits>, \ - Kokkos::View::mag_type*, Kokkos::LayoutLeft, \ + Kokkos::View::mag_type*, Kokkos::LayoutLeft, \ Kokkos::Device, Kokkos::MemoryTraits>, \ Kokkos::View, \ Kokkos::MemoryTraits>, \ @@ -72,7 +72,7 @@ KOKKOSLAPACK_SVD_TPL_SPEC_AVAIL_LAPACK(Kokkos::complex, Kokkos::LayoutLe struct svd_tpl_spec_avail< \ Kokkos::Cuda, \ Kokkos::View, Kokkos::MemoryTraits>, \ - Kokkos::View::mag_type*, Kokkos::LayoutLeft, Kokkos::Device, \ + Kokkos::View::mag_type*, Kokkos::LayoutLeft, Kokkos::Device, \ Kokkos::MemoryTraits>, \ Kokkos::View, Kokkos::MemoryTraits>, \ Kokkos::View, \ @@ -100,7 +100,7 @@ KOKKOSLAPACK_SVD_TPL_SPEC_AVAIL_CUSOLVER(Kokkos::complex, Kokkos::Layout struct svd_tpl_spec_avail< \ Kokkos::HIP, \ Kokkos::View, Kokkos::MemoryTraits>, \ - Kokkos::View::mag_type*, Kokkos::LayoutLeft, Kokkos::Device, \ + Kokkos::View::mag_type*, Kokkos::LayoutLeft, Kokkos::Device, \ Kokkos::MemoryTraits>, \ Kokkos::View, Kokkos::MemoryTraits>, \ Kokkos::View, \ diff --git a/lapack/tpls/KokkosLapack_svd_tpl_spec_decl.hpp b/lapack/tpls/KokkosLapack_svd_tpl_spec_decl.hpp index ff6b38d2b6..8a2d155c6b 100644 --- a/lapack/tpls/KokkosLapack_svd_tpl_spec_decl.hpp +++ b/lapack/tpls/KokkosLapack_svd_tpl_spec_decl.hpp @@ -73,7 +73,7 @@ void lapackSvdWrapper(const ExecutionSpace& /* space */, const char jobu[], cons int lwork = -1, info = 0; Kokkos::View rwork("svd rwork buffer", 5 * Kokkos::min(m, n)); Kokkos::View work("svd work buffer", 1); - if constexpr (Kokkos::ArithTraits::is_complex) { + if constexpr (KokkosKernels::ArithTraits::is_complex) { HostLapack>::gesvd( jobu[0], jobvt[0], m, n, reinterpret_cast*>(A.data()), lda, S.data(), reinterpret_cast*>(U.data()), ldu, @@ -105,7 +105,7 @@ void lapackSvdWrapper(const ExecutionSpace& /* space */, const char jobu[], cons struct SVD, \ Kokkos::MemoryTraits>, \ - Kokkos::View::mag_type*, Kokkos::LayoutLeft, \ + Kokkos::View::mag_type*, Kokkos::LayoutLeft, \ Kokkos::Device, Kokkos::MemoryTraits>, \ Kokkos::View, \ Kokkos::MemoryTraits>, \ @@ -116,7 +116,7 @@ void lapackSvdWrapper(const ExecutionSpace& /* space */, const char jobu[], cons EXEC_SPACE, \ Kokkos::View, \ Kokkos::MemoryTraits>, \ - Kokkos::View::mag_type*, Kokkos::LayoutLeft, \ + Kokkos::View::mag_type*, Kokkos::LayoutLeft, \ Kokkos::Device, Kokkos::MemoryTraits>, \ Kokkos::View, \ Kokkos::MemoryTraits>, \ @@ -125,7 +125,7 @@ void lapackSvdWrapper(const ExecutionSpace& /* space */, const char jobu[], cons using AMatrix = Kokkos::View, \ Kokkos::MemoryTraits>; \ using SVector = \ - Kokkos::View::mag_type*, Kokkos::LayoutLeft, \ + Kokkos::View::mag_type*, Kokkos::LayoutLeft, \ Kokkos::Device, Kokkos::MemoryTraits>; \ using UMatrix = Kokkos::View, \ Kokkos::MemoryTraits>; \ @@ -229,7 +229,7 @@ void mklSvdWrapper(const ExecutionSpace& /* space */, const char jobu[], const c struct SVD, \ Kokkos::MemoryTraits>, \ - Kokkos::View::mag_type*, Kokkos::LayoutLeft, \ + Kokkos::View::mag_type*, Kokkos::LayoutLeft, \ Kokkos::Device, Kokkos::MemoryTraits>, \ Kokkos::View, \ Kokkos::MemoryTraits>, \ @@ -240,7 +240,7 @@ void mklSvdWrapper(const ExecutionSpace& /* space */, const char jobu[], const c EXEC_SPACE, \ Kokkos::View, \ Kokkos::MemoryTraits>, \ - Kokkos::View::mag_type*, Kokkos::LayoutLeft, \ + Kokkos::View::mag_type*, Kokkos::LayoutLeft, \ Kokkos::Device, Kokkos::MemoryTraits>, \ Kokkos::View, \ Kokkos::MemoryTraits>, \ @@ -249,7 +249,7 @@ void mklSvdWrapper(const ExecutionSpace& /* space */, const char jobu[], const c using AMatrix = Kokkos::View, \ Kokkos::MemoryTraits>; \ using SVector = \ - Kokkos::View::mag_type*, Kokkos::LayoutLeft, \ + Kokkos::View::mag_type*, Kokkos::LayoutLeft, \ Kokkos::Device, Kokkos::MemoryTraits>; \ using UMatrix = Kokkos::View, \ Kokkos::MemoryTraits>; \ @@ -369,7 +369,7 @@ void cusolverSvdWrapper(const ExecutionSpace& space, const char jobu[], const ch struct SVD, \ Kokkos::MemoryTraits>, \ - Kokkos::View::mag_type*, Kokkos::LayoutLeft, \ + Kokkos::View::mag_type*, Kokkos::LayoutLeft, \ Kokkos::Device, Kokkos::MemoryTraits>, \ Kokkos::View, \ Kokkos::MemoryTraits>, \ @@ -380,7 +380,7 @@ void cusolverSvdWrapper(const ExecutionSpace& space, const char jobu[], const ch Kokkos::Cuda, \ Kokkos::View, \ Kokkos::MemoryTraits>, \ - Kokkos::View::mag_type*, Kokkos::LayoutLeft, \ + Kokkos::View::mag_type*, Kokkos::LayoutLeft, \ Kokkos::Device, Kokkos::MemoryTraits>, \ Kokkos::View, \ Kokkos::MemoryTraits>, \ @@ -388,7 +388,7 @@ void cusolverSvdWrapper(const ExecutionSpace& space, const char jobu[], const ch Kokkos::MemoryTraits>>::value> { \ using AMatrix = Kokkos::View, \ Kokkos::MemoryTraits>; \ - using SVector = Kokkos::View::mag_type*, Kokkos::LayoutLeft, \ + using SVector = Kokkos::View::mag_type*, Kokkos::LayoutLeft, \ Kokkos::Device, Kokkos::MemoryTraits>; \ using UMatrix = Kokkos::View, \ Kokkos::MemoryTraits>; \ @@ -506,7 +506,7 @@ void rocsolverSvdWrapper(const ExecutionSpace& space, const char jobu[], const c struct SVD< \ Kokkos::HIP, \ Kokkos::View, Kokkos::MemoryTraits>, \ - Kokkos::View::mag_type*, Kokkos::LayoutLeft, Kokkos::Device, \ + Kokkos::View::mag_type*, Kokkos::LayoutLeft, Kokkos::Device, \ Kokkos::MemoryTraits>, \ Kokkos::View, Kokkos::MemoryTraits>, \ Kokkos::View, Kokkos::MemoryTraits>, \ @@ -515,7 +515,7 @@ void rocsolverSvdWrapper(const ExecutionSpace& space, const char jobu[], const c Kokkos::HIP, \ Kokkos::View, \ Kokkos::MemoryTraits>, \ - Kokkos::View::mag_type*, Kokkos::LayoutLeft, \ + Kokkos::View::mag_type*, Kokkos::LayoutLeft, \ Kokkos::Device, Kokkos::MemoryTraits>, \ Kokkos::View, \ Kokkos::MemoryTraits>, \ @@ -523,7 +523,7 @@ void rocsolverSvdWrapper(const ExecutionSpace& space, const char jobu[], const c Kokkos::MemoryTraits>>::value> { \ using AMatrix = Kokkos::View, \ Kokkos::MemoryTraits>; \ - using SVector = Kokkos::View::mag_type*, Kokkos::LayoutLeft, \ + using SVector = Kokkos::View::mag_type*, Kokkos::LayoutLeft, \ Kokkos::Device, Kokkos::MemoryTraits>; \ using UMatrix = Kokkos::View, \ Kokkos::MemoryTraits>; \ diff --git a/lapack/unit_test/Test_Lapack_gesv.hpp b/lapack/unit_test/Test_Lapack_gesv.hpp index f14434d294..428063f5a5 100644 --- a/lapack/unit_test/Test_Lapack_gesv.hpp +++ b/lapack/unit_test/Test_Lapack_gesv.hpp @@ -38,7 +38,7 @@ template void impl_test_gesv(const char* mode, const char* padding, int N) { using execution_space = typename Device::execution_space; using ScalarA = typename ViewTypeA::value_type; - using ats = Kokkos::ArithTraits; + using ats = KokkosKernels::ArithTraits; execution_space space{}; @@ -146,7 +146,7 @@ template void impl_test_gesv_mrhs(const char* mode, const char* padding, int N, int nrhs) { using execution_space = typename Device::execution_space; using ScalarA = typename ViewTypeA::value_type; - using ats = Kokkos::ArithTraits; + using ats = KokkosKernels::ArithTraits; execution_space space{}; diff --git a/lapack/unit_test/Test_Lapack_svd.hpp b/lapack/unit_test/Test_Lapack_svd.hpp index 85d7e40552..cad48a4fd0 100644 --- a/lapack/unit_test/Test_Lapack_svd.hpp +++ b/lapack/unit_test/Test_Lapack_svd.hpp @@ -27,7 +27,7 @@ namespace Test { template void check_triple_product(const AMatrix& A, const SVector& S, const UMatrix& U, const VMatrix& Vt, - typename Kokkos::ArithTraits::mag_type tol) { + typename KokkosKernels::ArithTraits::mag_type tol) { // After a successful SVD decomposition we have A=U*S*V // So using gemm we should be able to compare the above // triple product to the original matrix A. @@ -66,7 +66,7 @@ void check_triple_product(const AMatrix& A, const SVector& S, const UMatrix& U, template void check_unitary_orthogonal_matrix( - const Matrix& M, typename Kokkos::ArithTraits::mag_type tol) { + const Matrix& M, typename KokkosKernels::ArithTraits::mag_type tol) { // After a successful SVD decomposition the matrices // U and V are unitary matrices. Thus we can check // the property UUt=UtU=I and VVt=VtV=I using gemm. @@ -79,9 +79,9 @@ void check_unitary_orthogonal_matrix( for (int rowIdx = 0; rowIdx < M.extent_int(0); ++rowIdx) { for (int colIdx = 0; colIdx < M.extent_int(0); ++colIdx) { if (rowIdx == colIdx) { - EXPECT_NEAR_KK_REL(I0_h(rowIdx, colIdx), Kokkos::ArithTraits::one(), tol); + EXPECT_NEAR_KK_REL(I0_h(rowIdx, colIdx), KokkosKernels::ArithTraits::one(), tol); } else { - EXPECT_NEAR_KK(I0_h(rowIdx, colIdx), Kokkos::ArithTraits::zero(), tol); + EXPECT_NEAR_KK(I0_h(rowIdx, colIdx), KokkosKernels::ArithTraits::zero(), tol); } } } @@ -93,9 +93,9 @@ void check_unitary_orthogonal_matrix( for (int rowIdx = 0; rowIdx < M.extent_int(1); ++rowIdx) { for (int colIdx = 0; colIdx < M.extent_int(1); ++colIdx) { if (rowIdx == colIdx) { - EXPECT_NEAR_KK_REL(I1_h(rowIdx, colIdx), Kokkos::ArithTraits::one(), tol); + EXPECT_NEAR_KK_REL(I1_h(rowIdx, colIdx), KokkosKernels::ArithTraits::one(), tol); } else { - EXPECT_NEAR_KK(I1_h(rowIdx, colIdx), Kokkos::ArithTraits::zero(), tol); + EXPECT_NEAR_KK(I1_h(rowIdx, colIdx), KokkosKernels::ArithTraits::zero(), tol); } } } @@ -104,9 +104,9 @@ void check_unitary_orthogonal_matrix( template int impl_analytic_2x2_svd() { using scalar_type = typename AMatrix::value_type; - using mag_type = typename Kokkos::ArithTraits::mag_type; + using mag_type = typename KokkosKernels::ArithTraits::mag_type; using vector_type = Kokkos::View; - using KAT_S = Kokkos::ArithTraits; + using KAT_S = KokkosKernels::ArithTraits; const mag_type eps = KAT_S::eps(); @@ -203,9 +203,9 @@ int impl_analytic_2x2_svd() { template int impl_analytic_2x3_svd() { using scalar_type = typename AMatrix::value_type; - using mag_type = typename Kokkos::ArithTraits::mag_type; + using mag_type = typename KokkosKernels::ArithTraits::mag_type; using vector_type = Kokkos::View; - using KAT_S = Kokkos::ArithTraits; + using KAT_S = KokkosKernels::ArithTraits; const mag_type tol = 100 * KAT_S::eps(); @@ -332,9 +332,9 @@ int impl_analytic_2x3_svd() { template int impl_analytic_3x2_svd() { using scalar_type = typename AMatrix::value_type; - using mag_type = typename Kokkos::ArithTraits::mag_type; + using mag_type = typename KokkosKernels::ArithTraits::mag_type; using vector_type = Kokkos::View; - using KAT_S = Kokkos::ArithTraits; + using KAT_S = KokkosKernels::ArithTraits; const mag_type tol = 100 * KAT_S::eps(); @@ -450,7 +450,7 @@ template int impl_test_svd(const int m, const int n) { using execution_space = typename Device::execution_space; using scalar_type = typename AMatrix::value_type; - using KAT_S = Kokkos::ArithTraits; + using KAT_S = KokkosKernels::ArithTraits; using mag_type = typename KAT_S::mag_type; using vector_type = Kokkos::View; diff --git a/lapack/unit_test/Test_Lapack_trtri.hpp b/lapack/unit_test/Test_Lapack_trtri.hpp index 1eb98ff6a5..44192936e7 100644 --- a/lapack/unit_test/Test_Lapack_trtri.hpp +++ b/lapack/unit_test/Test_Lapack_trtri.hpp @@ -54,7 +54,7 @@ struct VanillaGEMM { typedef typename ViewTypeA::value_type ScalarA; typedef typename ViewTypeB::value_type ScalarB; typedef typename ViewTypeC::value_type ScalarC; - typedef Kokkos::ArithTraits APT; + typedef KokkosKernels::ArithTraits APT; typedef typename APT::mag_type mag_type; ScalarA alpha; ScalarC beta; @@ -96,7 +96,7 @@ template int impl_test_trtri(int bad_diag_idx, const char* uplo, const char* diag, const int M, const int N) { using execution_space = typename ViewTypeA::device_type::execution_space; using ScalarA = typename ViewTypeA::value_type; - using APT = Kokkos::ArithTraits; + using APT = KokkosKernels::ArithTraits; using mag_type = typename APT::mag_type; double machine_eps = APT::epsilon(); diff --git a/ode/impl/KokkosODE_BDF_impl.hpp b/ode/impl/KokkosODE_BDF_impl.hpp index 106eb798bd..7b14016ed7 100644 --- a/ode/impl/KokkosODE_BDF_impl.hpp +++ b/ode/impl/KokkosODE_BDF_impl.hpp @@ -205,7 +205,7 @@ template ; + using KAT = KokkosKernels::ArithTraits; // Extract subviews to store intermediate data auto scale = Kokkos::subview(temp, Kokkos::ALL(), 1); @@ -317,10 +317,10 @@ KOKKOS_FUNCTION void BDFStep(ode_type& ode, scalar_type& t, scalar_type& dt, sca BDF_system_wrapper2 sys(ode, psi, update, t, dt); const newton_params param( max_newton_iters, atol, - Kokkos::max(10 * Kokkos::ArithTraits::eps() / rtol, Kokkos::min(0.03, Kokkos::sqrt(rtol)))); + Kokkos::max(10 * KokkosKernels::ArithTraits::eps() / rtol, Kokkos::min(0.03, Kokkos::sqrt(rtol)))); - scalar_type max_step = Kokkos::ArithTraits::max(); - scalar_type min_step = Kokkos::ArithTraits::min(); + scalar_type max_step = KokkosKernels::ArithTraits::max(); + scalar_type min_step = KokkosKernels::ArithTraits::min(); scalar_type safety = 0.675, error_norm = 0.0; if (dt > max_step) { update_D(order, max_step / dt, coeffs, tempD, D); @@ -436,7 +436,7 @@ KOKKOS_FUNCTION void BDFStep(ode_type& ode, scalar_type& t, scalar_type& dt, sca } error_low = Kokkos::sqrt(error_low) / Kokkos::sqrt(sys.neqs); } else { - error_low = Kokkos::ArithTraits::max(); + error_low = KokkosKernels::ArithTraits::max(); } if (order < max_order) { @@ -445,7 +445,7 @@ KOKKOS_FUNCTION void BDFStep(ode_type& ode, scalar_type& t, scalar_type& dt, sca } error_high = Kokkos::sqrt(error_high) / Kokkos::sqrt(sys.neqs); } else { - error_high = Kokkos::ArithTraits::max(); + error_high = KokkosKernels::ArithTraits::max(); } double factor_low, factor_mid, factor_high, factor; diff --git a/ode/impl/KokkosODE_Newton_impl.hpp b/ode/impl/KokkosODE_Newton_impl.hpp index 507a1b191f..2f208369a4 100644 --- a/ode/impl/KokkosODE_Newton_impl.hpp +++ b/ode/impl/KokkosODE_Newton_impl.hpp @@ -44,19 +44,19 @@ KOKKOS_FUNCTION KokkosODE::Experimental::newton_solver_status NewtonSolve( typename Kokkos::Details::InnerProductSpaceTraits::mag_type; sys.residual(y0, rhs); const norm_type norm0 = KokkosBlas::serial_nrm2(rhs); - norm_type norm = Kokkos::ArithTraits::zero(); - norm_type norm_old = Kokkos::ArithTraits::zero(); - norm_type norm_new = Kokkos::ArithTraits::zero(); - norm_type rate = Kokkos::ArithTraits::zero(); + norm_type norm = KokkosKernels::ArithTraits::zero(); + norm_type norm_old = KokkosKernels::ArithTraits::zero(); + norm_type norm_new = KokkosKernels::ArithTraits::zero(); + norm_type rate = KokkosKernels::ArithTraits::zero(); - const norm_type tol = Kokkos::max(10 * Kokkos::ArithTraits::eps() / params.rel_tol, + const norm_type tol = Kokkos::max(10 * KokkosKernels::ArithTraits::eps() / params.rel_tol, Kokkos::min(0.03, Kokkos::sqrt(params.rel_tol))); // LBV - 07/24/2023: for now assume that we take // a full Newton step. Eventually this value can // be computed using a line search algorithm to // improve convergence for difficult problems. - const value_type alpha = Kokkos::ArithTraits::one(); + const value_type alpha = KokkosKernels::ArithTraits::one(); // Iterate until maxIts or the tolerance is reached for (int it = 0; it < params.max_iters; ++it) { // handle.maxIters; ++it) { @@ -83,7 +83,7 @@ KOKKOS_FUNCTION KokkosODE::Experimental::newton_solver_status NewtonSolve( norm_new = (update(idx) * update(idx)) / (scale(idx) * scale(idx)); } norm_new = Kokkos::sqrt(norm_new / sys.neqs); - if ((it > 0) && norm_old > Kokkos::ArithTraits::zero()) { + if ((it > 0) && norm_old > KokkosKernels::ArithTraits::zero()) { rate = norm_new / norm_old; if ((rate >= 1) || Kokkos::pow(rate, params.max_iters - it) / (1 - rate) * norm_new > tol) { return newton_solver_status::NLS_DIVERGENCE; diff --git a/ode/impl/KokkosODE_RungeKutta_impl.hpp b/ode/impl/KokkosODE_RungeKutta_impl.hpp index 533914477d..bbe0fba74b 100644 --- a/ode/impl/KokkosODE_RungeKutta_impl.hpp +++ b/ode/impl/KokkosODE_RungeKutta_impl.hpp @@ -39,7 +39,7 @@ template ; + using KAT = KokkosKernels::ArithTraits; // Extract subviews to store intermediate data auto f1 = Kokkos::subview(temp, 1, Kokkos::ALL()); diff --git a/ode/src/KokkosODE_BDF.hpp b/ode/src/KokkosODE_BDF.hpp index 2afb6e46e2..43e1986c08 100644 --- a/ode/src/KokkosODE_BDF.hpp +++ b/ode/src/KokkosODE_BDF.hpp @@ -159,7 +159,7 @@ template KOKKOS_FUNCTION void BDFSolve(const ode_type& ode, const scalar_type t_start, const scalar_type t_end, const scalar_type initial_step, const scalar_type max_step, const vec_type& y0, const vec_type& y_new, mat_type& temp, mat_type& temp2) { - using KAT = Kokkos::ArithTraits; + using KAT = KokkosKernels::ArithTraits; // This needs to go away and be pulled out of temp instead... auto rhs = Kokkos::subview(temp, Kokkos::ALL(), 0); diff --git a/ode/unit_test/Test_ODE_BDF.hpp b/ode/unit_test/Test_ODE_BDF.hpp index dfee9b62a0..b3b72c99bb 100644 --- a/ode/unit_test/Test_ODE_BDF.hpp +++ b/ode/unit_test/Test_ODE_BDF.hpp @@ -670,7 +670,7 @@ template void test_adaptive_BDF_v2() { using vec_type = Kokkos::View; using mat_type = Kokkos::View; - using KAT = Kokkos::ArithTraits; + using KAT = KokkosKernels::ArithTraits; std::cout << "\n\n\nBDF_v2 test starting\n" << std::endl; @@ -700,7 +700,7 @@ void test_BDF_adaptive_stiff() { using execution_space = typename Device::execution_space; using vec_type = Kokkos::View; using mat_type = Kokkos::View; - using KAT = Kokkos::ArithTraits; + using KAT = KokkosKernels::ArithTraits; StiffChemistry mySys{}; diff --git a/ode/unit_test/Test_ODE_Newton.hpp b/ode/unit_test/Test_ODE_Newton.hpp index c37142ee8f..bf2eeb32ad 100644 --- a/ode/unit_test/Test_ODE_Newton.hpp +++ b/ode/unit_test/Test_ODE_Newton.hpp @@ -410,7 +410,7 @@ void test_simple_systems() { scalar_type init_vals[2] = {0.0, 1.0}; scalar_type solutions[2] = { - Kokkos::ArithTraits::one() / + KokkosKernels::ArithTraits::one() / Kokkos::sqrt(static_cast(4 + Kokkos::sqrt(static_cast(12.0)) / 2)), Kokkos::sqrt(static_cast((4 + Kokkos::sqrt(static_cast(12.0))) / 2))}; run_newton_test(mySys, params, init_vals, solutions); diff --git a/ode/unit_test/Test_ODE_RK.hpp b/ode/unit_test/Test_ODE_RK.hpp index 405eecf0c8..ff28fa72db 100644 --- a/ode/unit_test/Test_ODE_RK.hpp +++ b/ode/unit_test/Test_ODE_RK.hpp @@ -50,7 +50,7 @@ struct duho { template KOKKOS_FUNCTION void solution(const double t, const vec_type& y0, const vec_type& y) const { - using KAT = Kokkos::ArithTraits; + using KAT = KokkosKernels::ArithTraits; const double gamma = c / (2 * m); const double omega = KAT::sqrt(k / m - gamma * gamma); diff --git a/perf_test/batched/dense/KokkosBatched_Test_BlockJacobi_Tutorial.cpp b/perf_test/batched/dense/KokkosBatched_Test_BlockJacobi_Tutorial.cpp index 5081017e46..fa638a013d 100644 --- a/perf_test/batched/dense/KokkosBatched_Test_BlockJacobi_Tutorial.cpp +++ b/perf_test/batched/dense/KokkosBatched_Test_BlockJacobi_Tutorial.cpp @@ -71,7 +71,7 @@ val_type computeResidual(const ManyMatrixType &A, const ManyVectorType &x, const val_type sum(0); Kokkos::parallel_reduce( Kokkos::TeamThreadRange(member, rr.extent(0)), - [&](const int &k, val_type &lsum) { lsum += Kokkos::ArithTraits::abs(rr(k)); }, sum); + [&](const int &k, val_type &lsum) { lsum += KokkosKernels::ArithTraits::abs(rr(k)); }, sum); Kokkos::single(Kokkos::PerTeam(member), [&]() { update += sum; }); }, residual); diff --git a/perf_test/batched/dense/KokkosBatched_Test_BlockTridiagDirect.cpp b/perf_test/batched/dense/KokkosBatched_Test_BlockTridiagDirect.cpp index 810112baa3..5359af2db5 100644 --- a/perf_test/batched/dense/KokkosBatched_Test_BlockTridiagDirect.cpp +++ b/perf_test/batched/dense/KokkosBatched_Test_BlockTridiagDirect.cpp @@ -233,7 +233,7 @@ int main(int argc, char *argv[]) { #endif Kokkos::print_configuration(std::cout); - // typedef Kokkos::ArithTraits ats; + // typedef KokkosKernels::ArithTraits ats; Kokkos::Timer timer; /// diff --git a/perf_test/batched/dense/KokkosBatched_Test_BlockTridiagJacobi.cpp b/perf_test/batched/dense/KokkosBatched_Test_BlockTridiagJacobi.cpp index 629c73924e..aa179e2ba6 100644 --- a/perf_test/batched/dense/KokkosBatched_Test_BlockTridiagJacobi.cpp +++ b/perf_test/batched/dense/KokkosBatched_Test_BlockTridiagJacobi.cpp @@ -170,7 +170,7 @@ int main(int argc, char *argv[]) { #endif Kokkos::print_configuration(std::cout); - // typedef Kokkos::ArithTraits ats; + // typedef KokkosKernels::ArithTraits ats; Kokkos::Timer timer; /// diff --git a/perf_test/batched/dense/do-not-use/KokkosBatched_Test_Gemm_Cuda.cpp b/perf_test/batched/dense/do-not-use/KokkosBatched_Test_Gemm_Cuda.cpp index 9ac7e82d3a..da2f05a0ab 100644 --- a/perf_test/batched/dense/do-not-use/KokkosBatched_Test_Gemm_Cuda.cpp +++ b/perf_test/batched/dense/do-not-use/KokkosBatched_Test_Gemm_Cuda.cpp @@ -305,7 +305,7 @@ void Gemm(const int NN, const int BlkSize) { for (int i = 0, iend = cref.extent(0); i < iend; ++i) for (int j = 0, jend = cref.extent(1); j < jend; ++j) for (int k = 0, kend = cref.extent(2); k < kend; ++k) - diff += Kokkos::ArithTraits::abs(cref(i, j, k) - csol(i, j, k)); + diff += KokkosKernels::ArithTraits::abs(cref(i, j, k) - csol(i, j, k)); std::cout << std::setw(8) << "Kokkos" << std::setw(8) << "Range" << " BlkSize = " << std::setw(3) << BlkSize << " TeamSize = N/A" @@ -367,7 +367,7 @@ void Gemm(const int NN, const int BlkSize) { for (int i = 0, iend = cref.extent(0); i < iend; ++i) for (int j = 0, jend = cref.extent(1); j < jend; ++j) for (int k = 0, kend = cref.extent(2); k < kend; ++k) - diff += Kokkos::ArithTraits::abs(cref(i, j, k) - csol(i, j, k)); + diff += KokkosKernels::ArithTraits::abs(cref(i, j, k) - csol(i, j, k)); std::cout << std::setw(8) << "Kokkos" << std::setw(8) << "Team V1" << " BlkSize = " << std::setw(3) << BlkSize << " TeamSize = " << std::setw(3) << team_size @@ -432,7 +432,7 @@ void Gemm(const int NN, const int BlkSize) { for (int i = 0, iend = cref.extent(0); i < iend; ++i) for (int j = 0, jend = cref.extent(1); j < jend; ++j) for (int k = 0, kend = cref.extent(2); k < kend; ++k) - diff += Kokkos::ArithTraits::abs(cref(i, j, k) - csol(i, j, k)); + diff += KokkosKernels::ArithTraits::abs(cref(i, j, k) - csol(i, j, k)); std::cout << std::setw(8) << "Kokkos" << std::setw(8) << "Team V2" << " BlkSize = " << std::setw(3) << BlkSize << " TeamSize = " << std::setw(3) << team_size @@ -502,7 +502,7 @@ void Gemm(const int NN, const int BlkSize) { for (int i = 0, iend = cref.extent(0); i < iend; ++i) for (int j = 0, jend = cref.extent(1); j < jend; ++j) for (int k = 0, kend = cref.extent(2); k < kend; ++k) - diff += Kokkos::ArithTraits::abs(cref(i, j, k) - csol(i, j, k)); + diff += KokkosKernels::ArithTraits::abs(cref(i, j, k) - csol(i, j, k)); std::cout << std::setw(8) << "Kokkos" << std::setw(8) << "Team V3" << " BlkSize = " << std::setw(3) << BlkSize << " TeamSize = " << std::setw(3) << team_size @@ -567,7 +567,7 @@ void Gemm(const int NN, const int BlkSize) { for (int i = 0, iend = cref.extent(0); i < iend; ++i) for (int j = 0, jend = cref.extent(1); j < jend; ++j) for (int k = 0, kend = cref.extent(2); k < kend; ++k) - diff += Kokkos::ArithTraits::abs(cref(i, j, k) - csol(i, j, k)); + diff += KokkosKernels::ArithTraits::abs(cref(i, j, k) - csol(i, j, k)); std::cout << std::setw(8) << "Kokkos" << std::setw(8) << "Team HM" << " BlkSize = " << std::setw(3) << BlkSize << " TeamSize = " << std::setw(3) << team_size diff --git a/perf_test/batched/dense/do-not-use/KokkosBatched_Test_Gemv_Host.hpp b/perf_test/batched/dense/do-not-use/KokkosBatched_Test_Gemv_Host.hpp index fe0cd43f69..2962d8d132 100644 --- a/perf_test/batched/dense/do-not-use/KokkosBatched_Test_Gemv_Host.hpp +++ b/perf_test/batched/dense/do-not-use/KokkosBatched_Test_Gemv_Host.hpp @@ -195,7 +195,7 @@ void Gemv(const int NN) { for (int i = 0, iend = yref.extent(0); i < iend; ++i) for (int j = 0, jend = yref.extent(1); j < jend; ++j) for (int k = 0, kend = yref.extent(2); k < kend; ++k) - diff += Kokkos::ArithTraits::abs(yref(i, j, k) - y(i, j, k)); + diff += KokkosKernels::ArithTraits::abs(yref(i, j, k) - y(i, j, k)); std::cout << std::setw(12) << "Plain" << " BlkSize = " << std::setw(3) << BlkSize << " NumVecs = " << std::setw(3) << NumVecs @@ -259,7 +259,7 @@ void Gemv(const int NN) { for (int i = 0, iend = yref.extent(0); i < iend; ++i) for (int j = 0, jend = yref.extent(1); j < jend; ++j) for (int k = 0, kend = yref.extent(2); k < kend; ++k) - diff += Kokkos::ArithTraits::abs(yref(i, j, k) - y(i / VectorLength, j, k)[i % VectorLength]); + diff += KokkosKernels::ArithTraits::abs(yref(i, j, k) - y(i / VectorLength, j, k)[i % VectorLength]); std::cout << std::setw(12) << "Serial SIMD" << " BlkSize = " << std::setw(3) << BlkSize << " NumVecs = " << std::setw(3) << NumVecs diff --git a/perf_test/batched/dense/do-not-use/KokkosBatched_Test_LU_Cuda.cpp b/perf_test/batched/dense/do-not-use/KokkosBatched_Test_LU_Cuda.cpp index 68f4f75891..1e4124bf8e 100644 --- a/perf_test/batched/dense/do-not-use/KokkosBatched_Test_LU_Cuda.cpp +++ b/perf_test/batched/dense/do-not-use/KokkosBatched_Test_LU_Cuda.cpp @@ -292,7 +292,7 @@ void LU(const int NN, const int BlkSize) { for (int i = 0, iend = aref.extent(0); i < iend; ++i) for (int j = 0, jend = aref.extent(1); j < jend; ++j) for (int k = 0, kend = aref.extent(2); k < kend; ++k) - diff += Kokkos::ArithTraits::abs(aref(i, j, k) - asol(i, j, k)); + diff += KokkosKernels::ArithTraits::abs(aref(i, j, k) - asol(i, j, k)); std::cout << std::setw(8) << "Kokkos" << std::setw(8) << "Range" << " BlkSize = " << std::setw(3) << BlkSize << " TeamSize = N/A" @@ -347,7 +347,7 @@ void LU(const int NN, const int BlkSize) { for (int i = 0, iend = aref.extent(0); i < iend; ++i) for (int j = 0, jend = aref.extent(1); j < jend; ++j) for (int k = 0, kend = aref.extent(2); k < kend; ++k) - diff += Kokkos::ArithTraits::abs(aref(i, j, k) - asol(i, j, k)); + diff += KokkosKernels::ArithTraits::abs(aref(i, j, k) - asol(i, j, k)); std::cout << std::setw(8) << "Kokkos" << std::setw(8) << "Team V1" << " BlkSize = " << std::setw(3) << BlkSize << " TeamSize = " << std::setw(3) << team_size @@ -411,7 +411,7 @@ void LU(const int NN, const int BlkSize) { for (int i = 0, iend = aref.extent(0); i < iend; ++i) for (int j = 0, jend = aref.extent(1); j < jend; ++j) for (int k = 0, kend = aref.extent(2); k < kend; ++k) - diff += Kokkos::ArithTraits::abs(aref(i, j, k) - asol(i, j, k)); + diff += KokkosKernels::ArithTraits::abs(aref(i, j, k) - asol(i, j, k)); std::cout << std::setw(8) << "Kokkos" << std::setw(8) << "Team V2" << " BlkSize = " << std::setw(3) << BlkSize << " TeamSize = " << std::setw(3) << team_size @@ -479,7 +479,7 @@ void LU(const int NN, const int BlkSize) { for (int i = 0, iend = aref.extent(0); i < iend; ++i) for (int j = 0, jend = aref.extent(1); j < jend; ++j) for (int k = 0, kend = aref.extent(2); k < kend; ++k) - diff += Kokkos::ArithTraits::abs(aref(i, j, k) - asol(i, j, k)); + diff += KokkosKernels::ArithTraits::abs(aref(i, j, k) - asol(i, j, k)); std::cout << std::setw(8) << "Kokkos" << std::setw(8) << "Team V3" << " BlkSize = " << std::setw(3) << BlkSize << " TeamSize = " << std::setw(3) << team_size diff --git a/perf_test/batched/dense/do-not-use/KokkosBatched_Test_Trsm_Cuda.cpp b/perf_test/batched/dense/do-not-use/KokkosBatched_Test_Trsm_Cuda.cpp index ce553b04d1..ef46f7d52b 100644 --- a/perf_test/batched/dense/do-not-use/KokkosBatched_Test_Trsm_Cuda.cpp +++ b/perf_test/batched/dense/do-not-use/KokkosBatched_Test_Trsm_Cuda.cpp @@ -425,7 +425,7 @@ void Trsm(const int NN, const int BlkSize, const int NumCols) { for (int i = 0, iend = bref.extent(0); i < iend; ++i) for (int j = 0, jend = bref.extent(1); j < jend; ++j) for (int k = 0, kend = bref.extent(2); k < kend; ++k) - diff += Kokkos::ArithTraits::abs(bref(i, j, k) - bsol(i, j, k)); + diff += KokkosKernels::ArithTraits::abs(bref(i, j, k) - bsol(i, j, k)); std::cout << std::setw(8) << "Kokkos" << std::setw(8) << "Range" << " BlkSize = " << std::setw(3) << BlkSize << " NumCols = " << std::setw(3) << NumCols @@ -483,7 +483,7 @@ void Trsm(const int NN, const int BlkSize, const int NumCols) { for (int i = 0, iend = bref.extent(0); i < iend; ++i) for (int j = 0, jend = bref.extent(1); j < jend; ++j) for (int k = 0, kend = bref.extent(2); k < kend; ++k) - diff += Kokkos::ArithTraits::abs(bref(i, j, k) - bsol(i, j, k)); + diff += KokkosKernels::ArithTraits::abs(bref(i, j, k) - bsol(i, j, k)); std::cout << std::setw(8) << "Kokkos" << std::setw(8) << "Team V1" << " BlkSize = " << std::setw(3) << BlkSize << " NumCols = " << std::setw(3) << NumCols @@ -546,7 +546,7 @@ void Trsm(const int NN, const int BlkSize, const int NumCols) { for (int i = 0, iend = bref.extent(0); i < iend; ++i) for (int j = 0, jend = bref.extent(1); j < jend; ++j) for (int k = 0, kend = bref.extent(2); k < kend; ++k) - diff += Kokkos::ArithTraits::abs(bref(i, j, k) - bsol(i, j, k)); + diff += KokkosKernels::ArithTraits::abs(bref(i, j, k) - bsol(i, j, k)); std::cout << std::setw(8) << "Kokkos" << std::setw(8) << "Team V2" << " BlkSize = " << std::setw(3) << BlkSize << " NumCols = " << std::setw(3) << NumCols @@ -613,7 +613,7 @@ void Trsm(const int NN, const int BlkSize, const int NumCols) { for (int i = 0, iend = bref.extent(0); i < iend; ++i) for (int j = 0, jend = bref.extent(1); j < jend; ++j) for (int k = 0, kend = bref.extent(2); k < kend; ++k) - diff += Kokkos::ArithTraits::abs(bref(i, j, k) - bsol(i, j, k)); + diff += KokkosKernels::ArithTraits::abs(bref(i, j, k) - bsol(i, j, k)); std::cout << std::setw(8) << "Kokkos" << std::setw(8) << "Team V3" << " BlkSize = " << std::setw(3) << BlkSize << " NumCols = " << std::setw(3) << NumCols diff --git a/perf_test/batched/dense/do-not-use/KokkosBatched_Test_Trsm_Host.hpp b/perf_test/batched/dense/do-not-use/KokkosBatched_Test_Trsm_Host.hpp index 9315bb337a..1b4c8c2723 100644 --- a/perf_test/batched/dense/do-not-use/KokkosBatched_Test_Trsm_Host.hpp +++ b/perf_test/batched/dense/do-not-use/KokkosBatched_Test_Trsm_Host.hpp @@ -200,7 +200,7 @@ void Trsm(const int NN) { double sum = 0; for (int i = 0, iend = b.extent(0); i < iend; ++i) for (int j = 0, jend = b.extent(1); j < jend; ++j) - for (int k = 0, kend = b.extent(2); k < kend; ++k) sum += Kokkos::ArithTraits::abs(bmat(i, j, k)); + for (int k = 0, kend = b.extent(2); k < kend; ++k) sum += KokkosKernels::ArithTraits::abs(bmat(i, j, k)); std::cout << std::setw(10) << "MKL TRSM" << " BlkSize = " << std::setw(3) << BlkSize << " NumCols = " << std::setw(3) << NumCols @@ -309,7 +309,7 @@ void Trsm(const int NN) { for (int i = 0, iend = bref.extent(0); i < iend; ++i) for (int j = 0, jend = bref.extent(1); j < jend; ++j) for (int k = 0, kend = bref.extent(2); k < kend; ++k) - diff += Kokkos::ArithTraits::abs(bref(i, j, k) - b(i, j, k)); + diff += KokkosKernels::ArithTraits::abs(bref(i, j, k) - b(i, j, k)); std::cout << std::setw(10) << "MKL Batch" << " BlkSize = " << std::setw(3) << BlkSize << " NumCols = " << std::setw(3) << NumCols @@ -416,7 +416,7 @@ void Trsm(const int NN) { for (int i = 0, iend = bref.extent(0); i < iend; ++i) for (int j = 0, jend = bref.extent(1); j < jend; ++j) for (int k = 0, kend = bref.extent(2); k < kend; ++k) - diff += Kokkos::ArithTraits::abs(bref(i, j, k) - b(i / VectorLength, j, k)[i % VectorLength]); + diff += KokkosKernels::ArithTraits::abs(bref(i, j, k) - b(i / VectorLength, j, k)[i % VectorLength]); std::cout << std::setw(10) << "MKL Cmpt" << " BlkSize = " << std::setw(3) << BlkSize << " NumCols = " << std::setw(3) << NumCols @@ -492,7 +492,7 @@ void Trsm(const int NN) { // for (int i=0,iend=bref.extent(0);i::abs(bref(i,j,k) - + // diff += KokkosKernels::ArithTraits::abs(bref(i,j,k) - // b(i,j,k)); // std::cout << std::setw(10) << "KK Scalar" @@ -566,7 +566,7 @@ void Trsm(const int NN) { for (int i = 0, iend = bref.extent(0); i < iend; ++i) for (int j = 0, jend = bref.extent(1); j < jend; ++j) for (int k = 0, kend = bref.extent(2); k < kend; ++k) - diff += Kokkos::ArithTraits::abs(bref(i, j, k) - b(i / VectorLength, j, k)[i % VectorLength]); + diff += KokkosKernels::ArithTraits::abs(bref(i, j, k) - b(i / VectorLength, j, k)[i % VectorLength]); std::cout << std::setw(10) << "KK Vector" << " BlkSize = " << std::setw(3) << BlkSize << " NumCols = " << std::setw(3) << NumCols diff --git a/perf_test/batched/sparse/CG/KokkosBatched_Test_CG.cpp b/perf_test/batched/sparse/CG/KokkosBatched_Test_CG.cpp index e0440ddbfd..d0a9d34639 100644 --- a/perf_test/batched/sparse/CG/KokkosBatched_Test_CG.cpp +++ b/perf_test/batched/sparse/CG/KokkosBatched_Test_CG.cpp @@ -46,7 +46,7 @@ int main(int argc, char *argv[]) { #endif Kokkos::print_configuration(std::cout); - // typedef Kokkos::ArithTraits ats; + // typedef KokkosKernels::ArithTraits ats; Kokkos::Timer timer; /// @@ -202,7 +202,7 @@ int main(int argc, char *argv[]) { using Layout = typename AMatrixValueViewLL::array_layout; using EXSP = typename AMatrixValueViewLL::execution_space; - using MagnitudeType = typename Kokkos::ArithTraits::mag_type; + using MagnitudeType = typename KokkosKernels::ArithTraits::mag_type; using Norm2DViewType = Kokkos::View; using Scalar3DViewType = Kokkos::View; diff --git a/perf_test/batched/sparse/GMRES/KokkosBatched_Test_GMRES.cpp b/perf_test/batched/sparse/GMRES/KokkosBatched_Test_GMRES.cpp index f69ccadd7e..a979c02027 100644 --- a/perf_test/batched/sparse/GMRES/KokkosBatched_Test_GMRES.cpp +++ b/perf_test/batched/sparse/GMRES/KokkosBatched_Test_GMRES.cpp @@ -50,7 +50,7 @@ int main(int argc, char *argv[]) { #endif Kokkos::print_configuration(std::cout); - // typedef Kokkos::ArithTraits ats; + // typedef KokkosKernels::ArithTraits ats; /// /// input arguments parsing @@ -225,7 +225,7 @@ int main(int argc, char *argv[]) { using Layout = typename AMatrixValueViewLL::array_layout; using EXSP = typename AMatrixValueViewLL::execution_space; - using MagnitudeType = typename Kokkos::ArithTraits::mag_type; + using MagnitudeType = typename KokkosKernels::ArithTraits::mag_type; using Norm2DViewType = Kokkos::View; using Scalar3DViewType = Kokkos::View; diff --git a/perf_test/batched/sparse/SPMV/KokkosBatched_SPMV_View.hpp b/perf_test/batched/sparse/SPMV/KokkosBatched_SPMV_View.hpp index c1cdec2778..91de2bf0c6 100644 --- a/perf_test/batched/sparse/SPMV/KokkosBatched_SPMV_View.hpp +++ b/perf_test/batched/sparse/SPMV/KokkosBatched_SPMV_View.hpp @@ -22,7 +22,7 @@ struct BSPMV_Functor_View { typedef typename Kokkos::TeamPolicy team_policy; typedef typename team_policy::member_type team_member; typedef typename AMatrix::non_const_value_type entries_type; - typedef Kokkos::ArithTraits ATV; + typedef KokkosKernels::ArithTraits ATV; const value_type* alpha; const AMatrix m_A_values; diff --git a/perf_test/batched/sparse/SPMV/KokkosBatched_Test_SPMV.cpp b/perf_test/batched/sparse/SPMV/KokkosBatched_Test_SPMV.cpp index 21fabd0202..c7d508f8b2 100644 --- a/perf_test/batched/sparse/SPMV/KokkosBatched_Test_SPMV.cpp +++ b/perf_test/batched/sparse/SPMV/KokkosBatched_Test_SPMV.cpp @@ -107,7 +107,7 @@ int main(int argc, char *argv[]) { #endif Kokkos::print_configuration(std::cout); - // typedef Kokkos::ArithTraits ats; + // typedef KokkosKernels::ArithTraits ats; Kokkos::Timer timer; /// diff --git a/perf_test/batched/sparse/cusolver/KokkosBatched_Test_cusolverDn.cpp b/perf_test/batched/sparse/cusolver/KokkosBatched_Test_cusolverDn.cpp index 5e9bf13f8c..dc815a63c0 100644 --- a/perf_test/batched/sparse/cusolver/KokkosBatched_Test_cusolverDn.cpp +++ b/perf_test/batched/sparse/cusolver/KokkosBatched_Test_cusolverDn.cpp @@ -151,7 +151,7 @@ int main(int argc, char *argv[]) { #endif Kokkos::print_configuration(std::cout); - // typedef Kokkos::ArithTraits ats; + // typedef KokkosKernels::ArithTraits ats; /// /// input arguments parsing diff --git a/perf_test/batched/sparse/cusolver/KokkosBatched_Test_cusolverSp.cpp b/perf_test/batched/sparse/cusolver/KokkosBatched_Test_cusolverSp.cpp index b3e1fd2aba..f987fcface 100644 --- a/perf_test/batched/sparse/cusolver/KokkosBatched_Test_cusolverSp.cpp +++ b/perf_test/batched/sparse/cusolver/KokkosBatched_Test_cusolverSp.cpp @@ -350,7 +350,7 @@ int main(int argc, char *argv[]) { #endif Kokkos::print_configuration(std::cout); - // typedef Kokkos::ArithTraits ats; + // typedef KokkosKernels::ArithTraits ats; /// /// input arguments parsing diff --git a/perf_test/blas/blas3/KokkosBlas3_gemm_perf_test.hpp b/perf_test/blas/blas3/KokkosBlas3_gemm_perf_test.hpp index a3798f7c66..0849859b70 100644 --- a/perf_test/blas/blas3/KokkosBlas3_gemm_perf_test.hpp +++ b/perf_test/blas/blas3/KokkosBlas3_gemm_perf_test.hpp @@ -1369,7 +1369,7 @@ static inline bool gemm_print_compare_failure(ViewType h_expected, ViewType h_ac */ template static inline bool gemm_do_compare(view_type_3d expected, view_type_3d actual) { - double epsilon = Kokkos::ArithTraits::eps() * 1e3; + double epsilon = KokkosKernels::ArithTraits::eps() * 1e3; STATUS; diff --git a/perf_test/graph/KokkosGraph_mis_d2.cpp b/perf_test/graph/KokkosGraph_mis_d2.cpp index 952f28e64c..6c60ca29b6 100644 --- a/perf_test/graph/KokkosGraph_mis_d2.cpp +++ b/perf_test/graph/KokkosGraph_mis_d2.cpp @@ -220,7 +220,7 @@ void run_mis2(const MIS2Parameters& params) { crsMat_t At_in = KokkosSparse::Impl::transpose_matrix(A_in); crsMat_t A; KKH kkh; - const scalar_type one = Kokkos::ArithTraits::one(); + const scalar_type one = KokkosKernels::ArithTraits::one(); kkh.create_spadd_handle(false); KokkosSparse::spadd_symbolic(&kkh, A_in, At_in, A); KokkosSparse::spadd_numeric(&kkh, one, A_in, one, At_in, A); diff --git a/perf_test/sparse/KokkosSparse_kk_spmv.cpp b/perf_test/sparse/KokkosSparse_kk_spmv.cpp index cb5a9fa2df..439156181a 100644 --- a/perf_test/sparse/KokkosSparse_kk_spmv.cpp +++ b/perf_test/sparse/KokkosSparse_kk_spmv.cpp @@ -35,7 +35,7 @@ using Scalar = KokkosKernels::default_scalar; using Ordinal = KokkosKernels::default_lno_t; using Offset = KokkosKernels::default_size_type; -using KAT = Kokkos::ArithTraits; +using KAT = KokkosKernels::ArithTraits; struct SPMVBenchmarking { // note: CLI currently only allows square matrices to be randomly generated diff --git a/perf_test/sparse/KokkosSparse_mdf.cpp b/perf_test/sparse/KokkosSparse_mdf.cpp index 0cd33f2eca..fadf0d21e7 100644 --- a/perf_test/sparse/KokkosSparse_mdf.cpp +++ b/perf_test/sparse/KokkosSparse_mdf.cpp @@ -132,7 +132,7 @@ void run_experiment(int argc, char** argv, CommonInputParams /*params*/) { // Generate the values of A Kokkos::Random_XorShift64_Pool rand_pool(13718); - Kokkos::fill_random(valuesA, rand_pool, 10 * Kokkos::ArithTraits::one()); + Kokkos::fill_random(valuesA, rand_pool, 10 * KokkosKernels::ArithTraits::one()); // Actually put A together graph_t graph(entriesA, rowmapA); diff --git a/perf_test/sparse/KokkosSparse_spmv_bsr.cpp b/perf_test/sparse/KokkosSparse_spmv_bsr.cpp index d4ed176d44..9360008146 100644 --- a/perf_test/sparse/KokkosSparse_spmv_bsr.cpp +++ b/perf_test/sparse/KokkosSparse_spmv_bsr.cpp @@ -201,8 +201,8 @@ int test_bsr_matrix_single_vec(const char fOp[], Kokkos::deep_copy(h_ybsr, ybsr); double error = 0.0, maxNorm = 0.0; for (size_t ir = 0; ir < h_ycrs.extent(0); ++ir) { - maxNorm = std::max(maxNorm, Kokkos::ArithTraits::abs(h_ycrs(ir))); - error = std::max(error, Kokkos::ArithTraits::abs(h_ycrs(ir) - h_ybsr(ir))); + maxNorm = std::max(maxNorm, KokkosKernels::ArithTraits::abs(h_ycrs(ir))); + error = std::max(error, KokkosKernels::ArithTraits::abs(h_ycrs(ir) - h_ybsr(ir))); } double tol = (mat_val.size() / nRow) * std::numeric_limits::epsilon(); @@ -349,8 +349,8 @@ int test_bsr_matrix_vec(const char fOp[], KokkosSparse::CrsMatrix::abs(h_ycrs(ir, jc))); - error = std::max(error, Kokkos::ArithTraits::abs(h_ycrs(ir, jc) - h_ybsr(ir, jc))); + maxNorm = std::max(maxNorm, KokkosKernels::ArithTraits::abs(h_ycrs(ir, jc))); + error = std::max(error, KokkosKernels::ArithTraits::abs(h_ycrs(ir, jc) - h_ybsr(ir, jc))); } if (error > tol * maxNorm) { num_errors += 1; diff --git a/perf_test/sparse/KokkosSparse_spmv_merge.cpp b/perf_test/sparse/KokkosSparse_spmv_merge.cpp index 1aad6b4286..c3a58328db 100644 --- a/perf_test/sparse/KokkosSparse_spmv_merge.cpp +++ b/perf_test/sparse/KokkosSparse_spmv_merge.cpp @@ -224,7 +224,7 @@ int main(int argc, char** argv) { using matrix_type = KokkosSparse::CrsMatrix; using values_type = typename matrix_type::values_type::non_const_type; using handle_type = KokkosSparse::SPMVHandle; - const Scalar SC_ONE = Kokkos::ArithTraits::one(); + const Scalar SC_ONE = KokkosKernels::ArithTraits::one(); const Scalar alpha = SC_ONE + SC_ONE; const Scalar beta = alpha + SC_ONE; diff --git a/perf_test/sparse/KokkosSparse_sptrsv_aux.hpp b/perf_test/sparse/KokkosSparse_sptrsv_aux.hpp index f6659cdef2..36bc8cccd1 100644 --- a/perf_test/sparse/KokkosSparse_sptrsv_aux.hpp +++ b/perf_test/sparse/KokkosSparse_sptrsv_aux.hpp @@ -63,7 +63,7 @@ bool check_errors(mag_t tol, crsmat_t &Mtx, scalar_view_t rhs, scalar_view_t sol using lno_t = typename entries_view_t::non_const_value_type; using values_view_t = typename crsmat_t::values_type::non_const_type; using scalar_t = typename values_view_t::value_type; - using STS = Kokkos::ArithTraits; + using STS = KokkosKernels::ArithTraits; using execution_space = typename scalar_view_t::execution_space; diff --git a/perf_test/sparse/KokkosSparse_sptrsv_cholmod.cpp b/perf_test/sparse/KokkosSparse_sptrsv_cholmod.cpp index 69725ad9fb..72b6ea7dcc 100644 --- a/perf_test/sparse/KokkosSparse_sptrsv_cholmod.cpp +++ b/perf_test/sparse/KokkosSparse_sptrsv_cholmod.cpp @@ -139,7 +139,7 @@ void free_cholmod(cholmod_factor *L, cholmod_common *cm) { template int test_sptrsv_perf(std::vector tests, std::string &filename, bool u_in_csr, bool invert_diag, bool invert_offdiag, int block_size, int loop) { - using STS = Kokkos::ArithTraits; + using STS = KokkosKernels::ArithTraits; using mag_type = typename STS::mag_type; // using cholmod_int_type = long; diff --git a/perf_test/sparse/KokkosSparse_sptrsv_superlu.cpp b/perf_test/sparse/KokkosSparse_sptrsv_superlu.cpp index 15aea65e4d..c9566c6478 100644 --- a/perf_test/sparse/KokkosSparse_sptrsv_superlu.cpp +++ b/perf_test/sparse/KokkosSparse_sptrsv_superlu.cpp @@ -270,7 +270,7 @@ int test_sptrsv_perf(std::vector tests, bool verbose, std::string &filename int panel_size, int relax_size, int block_size, int loop) { using ordinal_type = int; using size_type = int; - using STS = Kokkos::ArithTraits; + using STS = KokkosKernels::ArithTraits; using mag_type = typename STS::mag_type; // Default spaces diff --git a/perf_test/sparse/KokkosSparse_sptrsv_supernode.cpp b/perf_test/sparse/KokkosSparse_sptrsv_supernode.cpp index faded52471..abefbb9b5a 100644 --- a/perf_test/sparse/KokkosSparse_sptrsv_supernode.cpp +++ b/perf_test/sparse/KokkosSparse_sptrsv_supernode.cpp @@ -42,7 +42,7 @@ int test_sptrsv_perf(std::vector tests, bool verbose, std::string& lower_fi std::string& supernode_filename, bool merge, bool invert_offdiag, bool u_in_csr, int loop) { using ordinal_type = int; using size_type = int; - using STS = Kokkos::ArithTraits; + using STS = KokkosKernels::ArithTraits; using mag_type = typename STS::mag_type; // Default spaces diff --git a/perf_test/sparse/spmv/Kokkos_SPMV.hpp b/perf_test/sparse/spmv/Kokkos_SPMV.hpp index 6e4578f93e..71f5d1987c 100644 --- a/perf_test/sparse/spmv/Kokkos_SPMV.hpp +++ b/perf_test/sparse/spmv/Kokkos_SPMV.hpp @@ -24,7 +24,7 @@ struct SPMV_Functor { typedef typename AMatrix::non_const_value_type value_type; typedef typename Kokkos::TeamPolicy team_policy; typedef typename team_policy::member_type team_member; - typedef Kokkos::ArithTraits ATV; + typedef KokkosKernels::ArithTraits ATV; const value_type alpha; AMatrix m_A; diff --git a/perf_test/sparse/spmv/Kokkos_SPMV_Inspector.hpp b/perf_test/sparse/spmv/Kokkos_SPMV_Inspector.hpp index 258f1a1087..b229c4cc63 100644 --- a/perf_test/sparse/spmv/Kokkos_SPMV_Inspector.hpp +++ b/perf_test/sparse/spmv/Kokkos_SPMV_Inspector.hpp @@ -27,7 +27,7 @@ struct SPMV_Inspector_Functor { typedef typename AMatrix::non_const_size_type size_type; typedef typename Kokkos::TeamPolicy team_policy; typedef typename team_policy::member_type team_member; - typedef Kokkos::ArithTraits ATV; + typedef KokkosKernels::ArithTraits ATV; const value_type alpha; AMatrix m_A; diff --git a/sparse/impl/KokkosSparse_cluster_gauss_seidel_impl.hpp b/sparse/impl/KokkosSparse_cluster_gauss_seidel_impl.hpp index de2a4716f4..881bd4eb7c 100644 --- a/sparse/impl/KokkosSparse_cluster_gauss_seidel_impl.hpp +++ b/sparse/impl/KokkosSparse_cluster_gauss_seidel_impl.hpp @@ -230,7 +230,7 @@ class ClusterGaussSeidel { nnz_lno_t color_set_end_, nnz_lno_persistent_work_view_t color_adj_, nnz_lno_persistent_work_view_t cluster_offsets_, nnz_lno_persistent_work_view_t cluster_verts_, scalar_persistent_work_view_t inverse_diagonal_, nnz_lno_t clusters_per_team_, - nnz_scalar_t omega_ = Kokkos::ArithTraits::one()) + nnz_scalar_t omega_ = KokkosKernels::ArithTraits::one()) : _xadj(xadj_), _adj(adj_), _adj_vals(adj_vals_), @@ -607,7 +607,7 @@ class ClusterGaussSeidel { _diagonals(diagonals_), num_total_rows(num_total_rows_), rows_per_team(rows_per_team_), - one(Kokkos::ArithTraits::one()) {} + one(KokkosKernels::ArithTraits::one()) {} KOKKOS_INLINE_FUNCTION void operator()(const nnz_lno_t row_id) const { @@ -686,7 +686,7 @@ class ClusterGaussSeidel { template void apply(x_value_array_type x_lhs_output_vec, y_value_array_type y_rhs_input_vec, bool init_zero_x_vector = false, - int numIter = 1, nnz_scalar_t omega = Kokkos::ArithTraits::one(), bool apply_forward = true, + int numIter = 1, nnz_scalar_t omega = KokkosKernels::ArithTraits::one(), bool apply_forward = true, bool apply_backward = true, bool /*update_y_vector*/ = true) { auto gsHandle = get_gs_handle(); diff --git a/sparse/impl/KokkosSparse_crs_to_bsr_impl.hpp b/sparse/impl/KokkosSparse_crs_to_bsr_impl.hpp index a5c8187e19..02214184d3 100644 --- a/sparse/impl/KokkosSparse_crs_to_bsr_impl.hpp +++ b/sparse/impl/KokkosSparse_crs_to_bsr_impl.hpp @@ -28,10 +28,10 @@ Bsr expand_crs_to_bsr(const Crs &crs, size_t blockSize) { { size_t nnz = crs.nnz() * blockSize * blockSize; - if (nnz > size_t(Kokkos::ArithTraits::max())) { + if (nnz > size_t(KokkosKernels::ArithTraits::max())) { std::stringstream ss; ss << "expanding " << crs.nnz() << " non-zeros of CrsMatrix into blocks of " << blockSize - << " would overflow size_type of requested BsrMatrix " << Kokkos::ArithTraits::name(); + << " would overflow size_type of requested BsrMatrix " << KokkosKernels::ArithTraits::name(); throw std::runtime_error(ss.str()); } } diff --git a/sparse/impl/KokkosSparse_gauss_seidel_impl.hpp b/sparse/impl/KokkosSparse_gauss_seidel_impl.hpp index d3b705149b..230ba1ce09 100644 --- a/sparse/impl/KokkosSparse_gauss_seidel_impl.hpp +++ b/sparse/impl/KokkosSparse_gauss_seidel_impl.hpp @@ -233,7 +233,7 @@ class PointGaussSeidel { scalar_persistent_work_view2d_t Yvector, nnz_lno_t color_set_begin, nnz_lno_t color_set_end, scalar_persistent_work_view_t permuted_inverse_diagonal_, pool_memory_space pms, nnz_lno_t _num_max_vals_in_l1 = 0, nnz_lno_t _num_max_vals_in_l2 = 0, - nnz_scalar_t omega_ = Kokkos::ArithTraits::one(), + nnz_scalar_t omega_ = KokkosKernels::ArithTraits::one(), nnz_lno_t block_size_ = 1, nnz_lno_t team_work_size_ = 1, size_t shared_memory_size_ = 16, int suggested_team_size_ = 1, int vector_size_ = 1) @@ -1111,7 +1111,7 @@ class PointGaussSeidel { rows_per_team(rows_per_team_), block_size(block_size_), block_matrix_size(block_matrix_size_), - one(Kokkos::ArithTraits::one()) {} + one(KokkosKernels::ArithTraits::one()) {} KOKKOS_INLINE_FUNCTION void operator()(const nnz_lno_t& row_id) const { @@ -1297,7 +1297,7 @@ class PointGaussSeidel { template void block_apply(x_value_array_type x_lhs_output_vec, y_value_array_type y_rhs_input_vec, bool init_zero_x_vector = false, int numIter = 1, - nnz_scalar_t omega = Kokkos::ArithTraits::one(), bool apply_forward = true, + nnz_scalar_t omega = KokkosKernels::ArithTraits::one(), bool apply_forward = true, bool apply_backward = true, bool update_y_vector = true) { auto gsHandle = this->get_gs_handle(); if (gsHandle->is_numeric_called() == false) { @@ -1401,7 +1401,7 @@ class PointGaussSeidel { template void point_apply(x_value_array_type x_lhs_output_vec, y_value_array_type y_rhs_input_vec, bool init_zero_x_vector = false, int numIter = 1, - nnz_scalar_t omega = Kokkos::ArithTraits::one(), bool apply_forward = true, + nnz_scalar_t omega = KokkosKernels::ArithTraits::one(), bool apply_forward = true, bool apply_backward = true, bool update_y_vector = true) { auto gsHandle = get_gs_handle(); auto my_exec_space = gsHandle->get_execution_space(); @@ -1467,7 +1467,7 @@ class PointGaussSeidel { template void apply(x_value_array_type x_lhs_output_vec, y_value_array_type y_rhs_input_vec, bool init_zero_x_vector = false, - int numIter = 1, nnz_scalar_t omega = Kokkos::ArithTraits::one(), bool apply_forward = true, + int numIter = 1, nnz_scalar_t omega = KokkosKernels::ArithTraits::one(), bool apply_forward = true, bool apply_backward = true, bool update_y_vector = true) { auto gsHandle = get_gs_handle(); if (gsHandle->is_numeric_called() == false) { diff --git a/sparse/impl/KokkosSparse_getDiagCopyWithOffsets_impl.hpp b/sparse/impl/KokkosSparse_getDiagCopyWithOffsets_impl.hpp index 0c20595892..9048403d94 100644 --- a/sparse/impl/KokkosSparse_getDiagCopyWithOffsets_impl.hpp +++ b/sparse/impl/KokkosSparse_getDiagCopyWithOffsets_impl.hpp @@ -66,7 +66,7 @@ struct CrsMatrixGetDiagCopyWithOffsetsFunctor { /// \param lclRow [in] The current (local) row of the sparse matrix. KOKKOS_INLINE_FUNCTION void operator()(const LO& lclRow) const { const offset_type INV = KokkosSparse::OrdinalTraits::invalid(); - const scalar_type ZERO = Kokkos::ArithTraits::zero(); + const scalar_type ZERO = KokkosKernels::ArithTraits::zero(); // If the row lacks a stored diagonal entry, then its value is zero. D_(lclRow) = ZERO; diff --git a/sparse/impl/KokkosSparse_gmres_impl.hpp b/sparse/impl/KokkosSparse_gmres_impl.hpp index d7b0b02f98..6cfa141b8b 100644 --- a/sparse/impl/KokkosSparse_gmres_impl.hpp +++ b/sparse/impl/KokkosSparse_gmres_impl.hpp @@ -48,7 +48,7 @@ struct GmresWrap { using HandleDeviceRowMapType = typename GmresHandle::nnz_row_view_t; using HandleDeviceValueType = typename GmresHandle::nnz_value_view_t; using HandleDevice2dValueType = typename GmresHandle::nnz_value_view2d_t; - using karith = typename Kokkos::ArithTraits; + using karith = typename KokkosKernels::ArithTraits; using device_t = typename HandleDeviceEntriesType::device_type; /** diff --git a/sparse/impl/KokkosSparse_mdf_impl.hpp b/sparse/impl/KokkosSparse_mdf_impl.hpp index d40e6f5198..a1ed5648e4 100644 --- a/sparse/impl/KokkosSparse_mdf_impl.hpp +++ b/sparse/impl/KokkosSparse_mdf_impl.hpp @@ -30,7 +30,7 @@ namespace Impl { template struct MDF_types { using scalar_type = typename crs_matrix_type::value_type; - using KAS = typename Kokkos::ArithTraits; + using KAS = typename KokkosKernels::ArithTraits; using scalar_mag_type = typename KAS::mag_type; using values_mag_type = Kokkos::View; @@ -41,7 +41,7 @@ struct MDF_count_lower { using col_ind_type = typename crs_matrix_type::StaticCrsGraphType::entries_type::non_const_type; using size_type = typename crs_matrix_type::ordinal_type; using value_type = typename crs_matrix_type::size_type; - using KAV = typename Kokkos::ArithTraits; + using KAV = typename KokkosKernels::ArithTraits; crs_matrix_type A; col_ind_type permutation; @@ -86,9 +86,9 @@ struct MDF_discarded_fill_norm { using size_type = typename crs_matrix_type::size_type; using ordinal_type = typename crs_matrix_type::ordinal_type; using scalar_type = typename crs_matrix_type::value_type; - using KAS = typename Kokkos::ArithTraits; + using KAS = typename KokkosKernels::ArithTraits; using scalar_mag_type = typename KAS::mag_type; - using KAM = typename Kokkos::ArithTraits; + using KAM = typename KokkosKernels::ArithTraits; using permutation_set_type = Kokkos::UnorderedMap; crs_matrix_type A, At; @@ -411,7 +411,7 @@ struct MDF_factorize_row { // Only one of the values will match selected so can just sum all contribs const auto rowView = A.rowConst(selected_row); - value_type diag = Kokkos::ArithTraits::zero(); + value_type diag = KokkosKernels::ArithTraits::zero(); Kokkos::parallel_reduce( Kokkos::TeamVectorRange(team, rowView.length), [&](const size_type ind, value_type& running_diag) { @@ -520,7 +520,7 @@ struct MDF_compute_list_length { Kokkos::single(Kokkos::PerTeam(team), [&] { selected_row = permutation(selected_row_idx); - discarded_fill(selected_row) = Kokkos::ArithTraits::max(); + discarded_fill(selected_row) = KokkosKernels::ArithTraits::max(); // Swap entries in permutation vectors permutation(selected_row_idx) = permutation(factorization_step); @@ -530,7 +530,7 @@ struct MDF_compute_list_length { // Diagonal value of L entriesL(L_entryIdx) = selected_row; - valuesL(L_entryIdx) = Kokkos::ArithTraits::one(); + valuesL(L_entryIdx) = KokkosKernels::ArithTraits::one(); // Insert into permutation set for later const auto res = permutation_set.insert(selected_row); @@ -547,7 +547,7 @@ struct MDF_compute_list_length { // Insert the upper part of the selected row in U // including the diagonal term. ordinal_type updateIdx = 0; - value_type diag = Kokkos::ArithTraits::zero(); + value_type diag = KokkosKernels::ArithTraits::zero(); { Kokkos::parallel_scan(Kokkos::TeamThreadRange(team, rowView.length), [&](const size_type alpha, ordinal_type& running_update, bool is_final) { diff --git a/sparse/impl/KokkosSparse_par_ilut_numeric_impl.hpp b/sparse/impl/KokkosSparse_par_ilut_numeric_impl.hpp index 1ef2006352..433899149f 100644 --- a/sparse/impl/KokkosSparse_par_ilut_numeric_impl.hpp +++ b/sparse/impl/KokkosSparse_par_ilut_numeric_impl.hpp @@ -47,7 +47,7 @@ struct IlutWrap { using HandleDeviceEntriesType = typename IlutHandle::nnz_lno_view_t; using HandleDeviceRowMapType = typename IlutHandle::nnz_row_view_t; using HandleDeviceValueType = typename IlutHandle::nnz_value_view_t; - using karith = typename Kokkos::ArithTraits; + using karith = typename KokkosKernels::ArithTraits; using policy_type = typename IlutHandle::TeamPolicy; using member_type = typename policy_type::member_type; using range_policy = typename IlutHandle::RangePolicy; diff --git a/sparse/impl/KokkosSparse_sor_sequential_impl.hpp b/sparse/impl/KokkosSparse_sor_sequential_impl.hpp index d835473d2a..cd405035f0 100644 --- a/sparse/impl/KokkosSparse_sor_sequential_impl.hpp +++ b/sparse/impl/KokkosSparse_sor_sequential_impl.hpp @@ -74,7 +74,7 @@ void gaussSeidel(const LocalOrdinal numRows, const LocalOrdinal numCols, const O const LocalOrdinal* const ind, const MatrixScalar* const val, const DomainScalar* const B, const OffsetType b_stride, RangeScalar* const X, const OffsetType x_stride, const MatrixScalar* const D, const MatrixScalar omega, const char direction[]) { - using Kokkos::ArithTraits; + using KokkosKernels::ArithTraits; typedef LocalOrdinal LO; const OffsetType theNumRows = static_cast(numRows); const OffsetType theNumCols = static_cast(numCols); @@ -238,7 +238,7 @@ void reorderedGaussSeidel(const LocalOrdinal numRows, const LocalOrdinal numCols const MatrixScalar* const D, const LocalOrdinal* const rowInd, const LocalOrdinal numRowInds, // length of rowInd const MatrixScalar omega, const char direction[]) { - using Kokkos::ArithTraits; + using KokkosKernels::ArithTraits; typedef LocalOrdinal LO; const OffsetType theNumRows = static_cast(numRows); const OffsetType theNumCols = static_cast(numCols); @@ -314,7 +314,7 @@ void reorderedGaussSeidel(const LocalOrdinal numRows, const LocalOrdinal numCols for (LO ii = 0; ii < numRowInds; ++ii) { LO i = rowInd[ii]; for (OffsetType c = 0; c < theNumCols; ++c) { - x_temp[c] = Kokkos::ArithTraits::zero(); + x_temp[c] = KokkosKernels::ArithTraits::zero(); } for (OffsetType k = ptr[i]; k < ptr[i + 1]; ++k) { const LO j = ind[k]; @@ -334,7 +334,7 @@ void reorderedGaussSeidel(const LocalOrdinal numRows, const LocalOrdinal numCols for (LO ii = numRowInds - 1; ii != 0; --ii) { LO i = rowInd[ii]; for (OffsetType c = 0; c < theNumCols; ++c) { - x_temp[c] = Kokkos::ArithTraits::zero(); + x_temp[c] = KokkosKernels::ArithTraits::zero(); } for (OffsetType k = ptr[i]; k < ptr[i + 1]; ++k) { const LO j = ind[k]; @@ -351,7 +351,7 @@ void reorderedGaussSeidel(const LocalOrdinal numRows, const LocalOrdinal numCols const LO ii = 0; LO i = rowInd[ii]; for (OffsetType c = 0; c < theNumCols; ++c) { - x_temp[c] = Kokkos::ArithTraits::zero(); + x_temp[c] = KokkosKernels::ArithTraits::zero(); } for (OffsetType k = ptr[i]; k < ptr[i + 1]; ++k) { const LO j = ind[k]; diff --git a/sparse/impl/KokkosSparse_spadd_numeric_impl.hpp b/sparse/impl/KokkosSparse_spadd_numeric_impl.hpp index 6456688565..a22b0623e8 100644 --- a/sparse/impl/KokkosSparse_spadd_numeric_impl.hpp +++ b/sparse/impl/KokkosSparse_spadd_numeric_impl.hpp @@ -47,7 +47,7 @@ struct SortedNumericSumFunctor { beta(beta_) {} KOKKOS_INLINE_FUNCTION void operator()(const ordinal_type i) const { - const ordinal_type ORDINAL_MAX = Kokkos::ArithTraits::max(); + const ordinal_type ORDINAL_MAX = KokkosKernels::ArithTraits::max(); // count the union of nonzeros in Arow and Brow size_type ai = 0; @@ -64,7 +64,7 @@ struct SortedNumericSumFunctor { // Eat all entries in both A and B which have this column // This also results in Acol/Bcol being updated to following entries for // next loop iter - CscalarT accum = Kokkos::ArithTraits::zero(); + CscalarT accum = KokkosKernels::ArithTraits::zero(); while (Acol == Ccol) { accum += static_cast(alpha * Avalues(Arowstart + ai)); ai++; @@ -131,7 +131,7 @@ struct UnsortedNumericSumFunctor { size_type ArowEnd = Arowptrs(i + 1); size_type BrowStart = Browptrs(i); size_type BrowEnd = Browptrs(i + 1); - for (size_type j = CrowStart; j < CrowEnd; j++) Cvalues(j) = Kokkos::ArithTraits::zero(); + for (size_type j = CrowStart; j < CrowEnd; j++) Cvalues(j) = KokkosKernels::ArithTraits::zero(); // add in A entries, while setting C colinds for (size_type j = ArowStart; j < ArowEnd; j++) { Cvalues(CrowStart + Apos(j)) += alpha * Avalues(j); diff --git a/sparse/impl/KokkosSparse_spadd_symbolic_impl.hpp b/sparse/impl/KokkosSparse_spadd_symbolic_impl.hpp index 4d3507b202..d40d9d121f 100644 --- a/sparse/impl/KokkosSparse_spadd_symbolic_impl.hpp +++ b/sparse/impl/KokkosSparse_spadd_symbolic_impl.hpp @@ -44,7 +44,7 @@ struct SortedCountEntriesRange { Crowcounts(Crowcounts_) {} KOKKOS_INLINE_FUNCTION void operator()(const ordinal_type i) const { - const ordinal_type ORDINAL_MAX = Kokkos::ArithTraits::max(); + const ordinal_type ORDINAL_MAX = KokkosKernels::ArithTraits::max(); // count the union of nonzeros in Arow and Brow size_type numEntries = 0; @@ -93,7 +93,7 @@ struct SortedCountEntriesTeam { using TeamMem = typename TeamPol::member_type; KOKKOS_INLINE_FUNCTION void longRowFallback(const ordinal_type i) const { - const ordinal_type ORDINAL_MAX = Kokkos::ArithTraits::max(); + const ordinal_type ORDINAL_MAX = KokkosKernels::ArithTraits::max(); // count the union of nonzeros in Arow and Brow size_type numEntries = 0; @@ -151,7 +151,7 @@ struct SortedCountEntriesTeam { // Fill space between A and B with ORDINAL_MAX, // to maintain a valid bitonic sequence of power-of-two length Kokkos::parallel_for(Kokkos::ThreadVectorRange(t, npot - n), - [&](ordinal_type j) { scratch[Arowlen + j] = Kokkos::ArithTraits::max(); }); + [&](ordinal_type j) { scratch[Arowlen + j] = KokkosKernels::ArithTraits::max(); }); // npot = 2^levels for (ordinal_type level = 0; level < levels; level++) { // npot/2 pairs of items are compared in parallel diff --git a/sparse/impl/KokkosSparse_spiluk_numeric_impl.hpp b/sparse/impl/KokkosSparse_spiluk_numeric_impl.hpp index 2f8eb103eb..37ff6175d9 100644 --- a/sparse/impl/KokkosSparse_spiluk_numeric_impl.hpp +++ b/sparse/impl/KokkosSparse_spiluk_numeric_impl.hpp @@ -55,7 +55,7 @@ struct IlukWrap { using WorkViewType = typename IlukHandle::work_view_t; using LevelHostViewType = typename IlukHandle::nnz_lno_view_host_t; using LevelViewType = typename IlukHandle::nnz_lno_view_t; - using karith = typename Kokkos::ArithTraits; + using karith = typename KokkosKernels::ArithTraits; using team_policy = typename IlukHandle::TeamPolicy; using member_type = typename team_policy::member_type; using range_policy = typename IlukHandle::RangePolicy; diff --git a/sparse/impl/KokkosSparse_spmv_bsrmatrix_impl.hpp b/sparse/impl/KokkosSparse_spmv_bsrmatrix_impl.hpp index e465d011da..da6b895fc8 100644 --- a/sparse/impl/KokkosSparse_spmv_bsrmatrix_impl.hpp +++ b/sparse/impl/KokkosSparse_spmv_bsrmatrix_impl.hpp @@ -480,7 +480,7 @@ struct BSR_GEMV_Functor { typedef typename AMatrix::non_const_value_type value_type; typedef typename Kokkos::TeamPolicy team_policy; typedef typename team_policy::member_type team_member; - typedef Kokkos::ArithTraits ATV; + typedef KokkosKernels::ArithTraits ATV; //! Nonconst version of the type of column indices in the sparse matrix. typedef typename AMatrix::non_const_ordinal_type ordinal_type; @@ -519,7 +519,7 @@ struct BSR_GEMV_Functor { for (ordinal_type ii = 0; ii < block_dim; ++ii) { value_type t(0); for (ordinal_type jj = 0; jj < block_dim; ++jj) { - const auto aval = Kokkos::ArithTraits::conj(Aview(ii, jj)); + const auto aval = KokkosKernels::ArithTraits::conj(Aview(ii, jj)); t += aval * m_x(xstart + jj); } m_y(ystart + ii) += alpha * t; @@ -545,7 +545,7 @@ struct BSR_GEMV_Functor { const size_type Y_ptEnd = Y_ptBeg + block_dim; auto Y_cur = Kokkos::subview(m_y, ::Kokkos::make_pair(Y_ptBeg, Y_ptEnd)); - const y_value_type val_one = Kokkos::ArithTraits::one(); + const y_value_type val_one = KokkosKernels::ArithTraits::one(); if (beta != val_one) { KokkosBlas::Impl::TeamVectorScaleInternal::invoke(dev, block_dim, beta, Y_cur.data(), static_cast(Y_cur.stride(0))); @@ -598,9 +598,9 @@ void spMatVec_no_transpose( // This is required to maintain semantics of KokkosKernels native SpMV: // if y contains NaN but beta = 0, the result y should be filled with 0. // For example, this is useful for passing in uninitialized y and beta=0. - if (beta == Kokkos::ArithTraits::zero()) - Kokkos::deep_copy(exec, y, Kokkos::ArithTraits::zero()); - else if (beta != Kokkos::ArithTraits::one()) + if (beta == KokkosKernels::ArithTraits::zero()) + Kokkos::deep_copy(exec, y, KokkosKernels::ArithTraits::zero()); + else if (beta != KokkosKernels::ArithTraits::one()) KokkosBlas::scal(exec, y, beta, y); // @@ -710,7 +710,7 @@ struct BSR_GEMV_Transpose_Functor { typedef typename AMatrix::non_const_value_type value_type; typedef typename Kokkos::TeamPolicy team_policy; typedef typename team_policy::member_type team_member; - typedef Kokkos::ArithTraits ATV; + typedef KokkosKernels::ArithTraits ATV; //! Nonconst version of the type of column indices in the sparse matrix. typedef typename AMatrix::non_const_ordinal_type ordinal_type; @@ -752,7 +752,7 @@ struct BSR_GEMV_Transpose_Functor { for (ordinal_type jj = 0; jj < block_dim; ++jj) { value_type t(0); for (ordinal_type ii = 0; ii < block_dim; ++ii) { - const auto aval = Kokkos::ArithTraits::conj(Aview(ii, jj)); + const auto aval = KokkosKernels::ArithTraits::conj(Aview(ii, jj)); t += aval * xview(ii); } t *= alpha; @@ -787,7 +787,7 @@ struct BSR_GEMV_Transpose_Functor { const auto myRow = m_A.block_row_Const(iBlock); const auto count = myRow.length; - const y_value_type val_zero = Kokkos::ArithTraits::zero(); + const y_value_type val_zero = KokkosKernels::ArithTraits::zero(); y_value_type *shared_y = (y_value_type *)dev.team_shmem().get_shmem(block_dim * sizeof(y_value_type)); if (conjugate) { @@ -847,12 +847,12 @@ void spMatVec_transpose( // This is required to maintain semantics of KokkosKernels native SpMV: // if y contains NaN but beta = 0, the result y should be filled with 0. // For example, this is useful for passing in uninitialized y and beta=0. - if (beta == Kokkos::ArithTraits::zero()) - Kokkos::deep_copy(exec, y, Kokkos::ArithTraits::zero()); - else if (beta != Kokkos::ArithTraits::one()) + if (beta == KokkosKernels::ArithTraits::zero()) + Kokkos::deep_copy(exec, y, KokkosKernels::ArithTraits::zero()); + else if (beta != KokkosKernels::ArithTraits::one()) KokkosBlas::scal(exec, y, beta, y); - if (alpha == Kokkos::ArithTraits::zero()) return; + if (alpha == KokkosKernels::ArithTraits::zero()) return; // // Treat the case y <- alpha * A^T * x + beta * y @@ -896,9 +896,9 @@ void spMatVec_transpose(const typename AMatrix::execution_space &exec, Handle *h const auto block_dim = A.blockDim(); - if (beta == Kokkos::ArithTraits::zero()) - Kokkos::deep_copy(exec, y, Kokkos::ArithTraits::zero()); - else if (beta != Kokkos::ArithTraits::one()) + if (beta == KokkosKernels::ArithTraits::zero()) + Kokkos::deep_copy(exec, y, KokkosKernels::ArithTraits::zero()); + else if (beta != KokkosKernels::ArithTraits::one()) KokkosBlas::scal(exec, y, beta, y); bool use_dynamic_schedule = handle->force_dynamic_schedule; @@ -965,7 +965,7 @@ struct BSR_GEMM_Functor { typedef typename AMatrix::non_const_value_type value_type; typedef typename Kokkos::TeamPolicy team_policy; typedef typename team_policy::member_type team_member; - typedef Kokkos::ArithTraits ATV; + typedef KokkosKernels::ArithTraits ATV; //! Nonconst version of the type of column indices in the sparse matrix. typedef typename AMatrix::non_const_ordinal_type ordinal_type; @@ -1016,7 +1016,7 @@ struct BSR_GEMM_Functor { for (ordinal_type ii = 0; ii < block_dim; ++ii) { value_type t(0); for (ordinal_type jj = 0; jj < block_dim; ++jj) { - const auto aval = Kokkos::ArithTraits::conj(Aview(ii, jj)); + const auto aval = KokkosKernels::ArithTraits::conj(Aview(ii, jj)); t += aval * m_x(xstart + jj, jr); } m_y(ystart + ii, jr) += alpha * t; @@ -1046,7 +1046,7 @@ struct BSR_GEMM_Functor { const size_type Y_ptEnd = Y_ptBeg + block_dim; auto Y_cur = Kokkos::subview(m_y, ::Kokkos::make_pair(Y_ptBeg, Y_ptEnd), Kokkos::ALL()); - const y_value_type val_one = Kokkos::ArithTraits::one(); + const y_value_type val_one = KokkosKernels::ArithTraits::one(); if (beta != val_one) { KokkosBlas::Impl::TeamVectorScaleInternal::invoke(dev, block_dim, num_rhs, beta, Y_cur.data(), static_cast(Y_cur.stride(0)), @@ -1103,9 +1103,9 @@ void spMatMultiVec_no_transpose( // This is required to maintain semantics of KokkosKernels native SpMV: // if y contains NaN but beta = 0, the result y should be filled with 0. // For example, this is useful for passing in uninitialized y and beta=0. - if (beta == Kokkos::ArithTraits::zero()) - Kokkos::deep_copy(exec, y, Kokkos::ArithTraits::zero()); - else if (beta != Kokkos::ArithTraits::one()) + if (beta == KokkosKernels::ArithTraits::zero()) + Kokkos::deep_copy(exec, y, KokkosKernels::ArithTraits::zero()); + else if (beta != KokkosKernels::ArithTraits::one()) KokkosBlas::scal(exec, y, beta, y); // // Treat the case y <- alpha * A * x + beta * y @@ -1211,7 +1211,7 @@ struct BSR_GEMM_Transpose_Functor { typedef typename AMatrix::non_const_value_type value_type; typedef typename Kokkos::TeamPolicy team_policy; typedef typename team_policy::member_type team_member; - typedef Kokkos::ArithTraits ATV; + typedef KokkosKernels::ArithTraits ATV; //! Nonconst version of the type of column indices in the sparse matrix. typedef typename AMatrix::non_const_ordinal_type ordinal_type; @@ -1260,7 +1260,7 @@ struct BSR_GEMM_Transpose_Functor { for (ordinal_type jj = 0; jj < block_dim; ++jj) { value_type t(0); for (ordinal_type ii = 0; ii < block_dim; ++ii) { - const auto aval = Kokkos::ArithTraits::conj(Aview(ii, jj)); + const auto aval = KokkosKernels::ArithTraits::conj(Aview(ii, jj)); t += aval * xview(ii, jr); } t *= alpha; @@ -1298,7 +1298,7 @@ struct BSR_GEMM_Transpose_Functor { const auto myRow = m_A.block_row_Const(iBlock); const auto count = myRow.length; - const y_value_type val_zero = Kokkos::ArithTraits::zero(); + const y_value_type val_zero = KokkosKernels::ArithTraits::zero(); y_value_type *shared_y = (y_value_type *)dev.team_shmem().get_shmem(block_dim * num_rhs * sizeof(y_value_type)); if (conjugate) { @@ -1362,9 +1362,9 @@ void spMatMultiVec_transpose( // This is required to maintain semantics of KokkosKernels native SpMV: // if y contains NaN but beta = 0, the result y should be filled with 0. // For example, this is useful for passing in uninitialized y and beta=0. - if (beta == Kokkos::ArithTraits::zero()) - Kokkos::deep_copy(exec, y, Kokkos::ArithTraits::zero()); - else if (beta != Kokkos::ArithTraits::one()) + if (beta == KokkosKernels::ArithTraits::zero()) + Kokkos::deep_copy(exec, y, KokkosKernels::ArithTraits::zero()); + else if (beta != KokkosKernels::ArithTraits::one()) KokkosBlas::scal(exec, y, beta, y); // // Treat the case y <- alpha * A^T * x + beta * y @@ -1399,9 +1399,9 @@ void spMatMultiVec_transpose(const execution_space &exec, Handle *handle, const return; } - if (beta == Kokkos::ArithTraits::zero()) - Kokkos::deep_copy(exec, y, Kokkos::ArithTraits::zero()); - else if (beta != Kokkos::ArithTraits::one()) + if (beta == KokkosKernels::ArithTraits::zero()) + Kokkos::deep_copy(exec, y, KokkosKernels::ArithTraits::zero()); + else if (beta != KokkosKernels::ArithTraits::one()) KokkosBlas::scal(exec, y, beta, y); bool use_dynamic_schedule = handle->force_dynamic_schedule; diff --git a/sparse/impl/KokkosSparse_spmv_impl.hpp b/sparse/impl/KokkosSparse_spmv_impl.hpp index 8f8b5b4826..0b9ca1ec15 100644 --- a/sparse/impl/KokkosSparse_spmv_impl.hpp +++ b/sparse/impl/KokkosSparse_spmv_impl.hpp @@ -39,7 +39,7 @@ struct SPMV_Transpose_Functor { typedef typename AMatrix::non_const_value_type value_type; typedef typename Kokkos::TeamPolicy team_policy; typedef typename team_policy::member_type team_member; - typedef Kokkos::ArithTraits ATV; + typedef KokkosKernels::ArithTraits ATV; typedef typename YVector::non_const_value_type coefficient_type; typedef typename YVector::non_const_value_type y_value_type; @@ -89,7 +89,7 @@ struct SPMV_Functor { typedef typename AMatrix::non_const_value_type value_type; typedef typename Kokkos::TeamPolicy team_policy; typedef typename team_policy::member_type team_member; - typedef Kokkos::ArithTraits ATV; + typedef KokkosKernels::ArithTraits ATV; typedef typename YVector::non_const_value_type coefficient_type; const coefficient_type alpha; @@ -235,7 +235,7 @@ static void spmv_beta_no_transpose(const execution_space& exec, Handle* handle, /// serial impl typedef typename AMatrix::non_const_value_type value_type; typedef typename AMatrix::non_const_size_type size_type; - typedef Kokkos::ArithTraits ATV; + typedef KokkosKernels::ArithTraits ATV; const size_type* KOKKOS_RESTRICT row_map_ptr = A.graph.row_map.data(); const ordinal_type* KOKKOS_RESTRICT col_idx_ptr = A.graph.entries.data(); @@ -406,7 +406,7 @@ static void spmv_beta_transpose(const execution_space& exec, typename YVector::c if (exec.concurrency() == 1) { /// serial impl typedef typename AMatrix::non_const_value_type value_type; - typedef Kokkos::ArithTraits ATV; + typedef KokkosKernels::ArithTraits ATV; const size_type* KOKKOS_RESTRICT row_map_ptr = A.graph.row_map.data(); const ordinal_type* KOKKOS_RESTRICT col_idx_ptr = A.graph.entries.data(); const value_type* KOKKOS_RESTRICT values_ptr = A.values.data(); @@ -572,7 +572,7 @@ struct SPMV_MV_Transpose_Functor { for (ordinal_type iEntry = 0; iEntry < row_length; iEntry++) { const A_value_type val = - conjugate ? Kokkos::ArithTraits::conj(row.value(iEntry)) : row.value(iEntry); + conjugate ? KokkosKernels::ArithTraits::conj(row.value(iEntry)) : row.value(iEntry); const ordinal_type ind = row.colidx(iEntry); if (doalpha != 1) { @@ -608,7 +608,7 @@ struct SPMV_MV_Transpose_Functor { Kokkos::parallel_for(Kokkos::ThreadVectorRange(dev, row_length), [&](ordinal_type iEntry) { const A_value_type val = - conjugate ? Kokkos::ArithTraits::conj(row.value(iEntry)) : row.value(iEntry); + conjugate ? KokkosKernels::ArithTraits::conj(row.value(iEntry)) : row.value(iEntry); const ordinal_type ind = row.colidx(iEntry); if (doalpha != 1) { @@ -674,7 +674,7 @@ struct SPMV_MV_LayoutLeft_Functor { #pragma unroll #endif for (int k = 0; k < UNROLL; ++k) { - sum[k] = Kokkos::ArithTraits::zero(); + sum[k] = KokkosKernels::ArithTraits::zero(); } const auto row = m_A.rowConst(iRow); @@ -686,7 +686,7 @@ struct SPMV_MV_LayoutLeft_Functor { Kokkos::parallel_for(Kokkos::ThreadVectorRange(dev, row.length), [&](ordinal_type iEntry) { const A_value_type val = - conjugate ? Kokkos::ArithTraits::conj(row.value(iEntry)) : row.value(iEntry); + conjugate ? KokkosKernels::ArithTraits::conj(row.value(iEntry)) : row.value(iEntry); const ordinal_type ind = row.colidx(iEntry); #ifdef KOKKOS_ENABLE_PRAGMA_UNROLL #pragma unroll @@ -753,7 +753,7 @@ struct SPMV_MV_LayoutLeft_Functor { #pragma unroll #endif for (int k = 0; k < UNROLL; ++k) { - sum[k] = Kokkos::ArithTraits::zero(); + sum[k] = KokkosKernels::ArithTraits::zero(); } const auto row = m_A.rowConst(iRow); @@ -765,7 +765,7 @@ struct SPMV_MV_LayoutLeft_Functor { for (ordinal_type iEntry = 0; iEntry < row.length; iEntry++) { const A_value_type val = - conjugate ? Kokkos::ArithTraits::conj(row.value(iEntry)) : row.value(iEntry); + conjugate ? KokkosKernels::ArithTraits::conj(row.value(iEntry)) : row.value(iEntry); const ordinal_type ind = row.colidx(iEntry); #ifdef KOKKOS_ENABLE_PRAGMA_UNROLL #pragma unroll @@ -804,7 +804,7 @@ struct SPMV_MV_LayoutLeft_Functor { Kokkos::ThreadVectorRange(dev, row.length), [&](ordinal_type iEntry, y_value_type& lsum) { const A_value_type val = - conjugate ? Kokkos::ArithTraits::conj(row.value(iEntry)) : row.value(iEntry); + conjugate ? KokkosKernels::ArithTraits::conj(row.value(iEntry)) : row.value(iEntry); lsum += val * m_x(row.colidx(iEntry), 0); }, sum); @@ -838,7 +838,7 @@ struct SPMV_MV_LayoutLeft_Functor { y_value_type sum = y_value_type(); for (ordinal_type iEntry = 0; iEntry < row.length; iEntry++) { const A_value_type val = - conjugate ? Kokkos::ArithTraits::conj(row.value(iEntry)) : row.value(iEntry); + conjugate ? KokkosKernels::ArithTraits::conj(row.value(iEntry)) : row.value(iEntry); sum += val * m_x(row.colidx(iEntry), 0); } if (doalpha == -1) { @@ -1256,7 +1256,7 @@ void spmv_alpha_mv(const execution_space& exec, const char mode[], const typenam const AMatrix& A, const XVector& x, const typename YVector::non_const_value_type& beta, const YVector& y) { typedef typename YVector::non_const_value_type coefficient_type; - typedef Kokkos::ArithTraits KAT; + typedef KokkosKernels::ArithTraits KAT; if (beta == KAT::zero()) { spmv_alpha_beta_mv(exec, mode, alpha, A, x, beta, y); diff --git a/sparse/impl/KokkosSparse_spmv_impl_merge.hpp b/sparse/impl/KokkosSparse_spmv_impl_merge.hpp index e6c2ce60cb..0b27d0fd7e 100644 --- a/sparse/impl/KokkosSparse_spmv_impl_merge.hpp +++ b/sparse/impl/KokkosSparse_spmv_impl_merge.hpp @@ -59,7 +59,7 @@ struct SpmvMergeHierarchical { using DSR = typename KokkosSparse::Impl::MergeMatrixDiagonal::position_type; - using KAT = Kokkos::ArithTraits; + using KAT = KokkosKernels::ArithTraits; // results of a lower-bound and upper-bound diagonal search struct Chunk { diff --git a/sparse/impl/KokkosSparse_spmv_spec.hpp b/sparse/impl/KokkosSparse_spmv_spec.hpp index d9a0175ea6..e935351526 100644 --- a/sparse/impl/KokkosSparse_spmv_spec.hpp +++ b/sparse/impl/KokkosSparse_spmv_spec.hpp @@ -143,7 +143,7 @@ struct SPMV KAT; + typedef KokkosKernels::ArithTraits KAT; if (beta == KAT::zero()) { spmv_beta(space, handle, mode, alpha, A, x, beta, y); @@ -167,7 +167,7 @@ struct SPMV_MV KAT; + typedef KokkosKernels::ArithTraits KAT; if (alpha == KAT::zero()) { spmv_alpha_mv(space, mode, alpha, A, x, beta, y); } else if (alpha == KAT::one()) { diff --git a/sparse/impl/KokkosSparse_spmv_struct_impl.hpp b/sparse/impl/KokkosSparse_spmv_struct_impl.hpp index e3283fe532..1f90926490 100644 --- a/sparse/impl/KokkosSparse_spmv_struct_impl.hpp +++ b/sparse/impl/KokkosSparse_spmv_struct_impl.hpp @@ -37,7 +37,7 @@ struct SPMV_Struct_Transpose_Functor { typedef typename AMatrix::non_const_value_type value_type; typedef typename Kokkos::TeamPolicy team_policy; typedef typename team_policy::member_type team_member; - typedef Kokkos::ArithTraits ATV; + typedef KokkosKernels::ArithTraits ATV; typedef typename YVector::non_const_value_type coefficient_type; typedef typename YVector::non_const_value_type y_value_type; @@ -85,7 +85,7 @@ struct SPMV_Struct_Functor { typedef typename KokkosSparse::SparseRowViewConst row_view_const; typedef typename Kokkos::TeamPolicy team_policy; typedef typename team_policy::member_type team_member; - typedef Kokkos::ArithTraits ATV; + typedef KokkosKernels::ArithTraits ATV; typedef Kokkos::View > shared_ordinal_1d; using y_value_type = typename YVector::non_const_value_type; @@ -818,7 +818,7 @@ struct SPMV_MV_Struct_Transpose_Functor { Kokkos::parallel_for(Kokkos::ThreadVectorRange(dev, row_length), [&](ordinal_type iEntry) { const A_value_type val = - conjugate ? Kokkos::ArithTraits::conj(row.value(iEntry)) : row.value(iEntry); + conjugate ? KokkosKernels::ArithTraits::conj(row.value(iEntry)) : row.value(iEntry); const ordinal_type ind = row.colidx(iEntry); if (doalpha != 1) { @@ -881,14 +881,14 @@ struct SPMV_MV_Struct_LayoutLeft_Functor { #pragma unroll #endif for (int k = 0; k < UNROLL; ++k) { - sum[k] = Kokkos::ArithTraits::zero(); + sum[k] = KokkosKernels::ArithTraits::zero(); } const auto row = m_A.rowConst(iRow); Kokkos::parallel_for(Kokkos::ThreadVectorRange(dev, row.length), [&](ordinal_type iEntry) { const A_value_type val = - conjugate ? Kokkos::ArithTraits::conj(row.value(iEntry)) : row.value(iEntry); + conjugate ? KokkosKernels::ArithTraits::conj(row.value(iEntry)) : row.value(iEntry); const ordinal_type ind = row.colidx(iEntry); #ifdef KOKKOS_ENABLE_PRAGMA_UNROLL @@ -956,7 +956,7 @@ struct SPMV_MV_Struct_LayoutLeft_Functor { Kokkos::ThreadVectorRange(dev, row.length), [&](ordinal_type iEntry, y_value_type& lsum) { const A_value_type val = - conjugate ? Kokkos::ArithTraits::conj(row.value(iEntry)) : row.value(iEntry); + conjugate ? KokkosKernels::ArithTraits::conj(row.value(iEntry)) : row.value(iEntry); lsum += val * m_x(row.colidx(iEntry), 0); }, sum); @@ -1238,7 +1238,7 @@ void spmv_alpha_mv_struct(const execution_space& exec, const char mode[], const typename YVector::non_const_value_type& alpha, const AMatrix& A, const XVector& x, const typename YVector::non_const_value_type& beta, const YVector& y) { typedef typename YVector::non_const_value_type coefficient_type; - typedef Kokkos::ArithTraits KAT; + typedef KokkosKernels::ArithTraits KAT; if (beta == KAT::zero()) { spmv_alpha_beta_mv_struct(exec, mode, alpha, A, x, beta, y); diff --git a/sparse/impl/KokkosSparse_spmv_struct_spec.hpp b/sparse/impl/KokkosSparse_spmv_struct_spec.hpp index ac0bc580f4..7a5360358c 100644 --- a/sparse/impl/KokkosSparse_spmv_struct_spec.hpp +++ b/sparse/impl/KokkosSparse_spmv_struct_spec.hpp @@ -143,9 +143,9 @@ struct SPMV_STRUCT& structure, const coefficient_type& alpha, const AMatrix& A, const XVector& x, const coefficient_type& beta, const YVector& y) { - typedef Kokkos::ArithTraits KAT; + typedef KokkosKernels::ArithTraits KAT; - typedef Kokkos::ArithTraits KAT; + typedef KokkosKernels::ArithTraits KAT; if (alpha == KAT::zero()) { if (beta != KAT::one()) { @@ -178,7 +178,7 @@ struct SPMV_MV_STRUCT KAT; + typedef KokkosKernels::ArithTraits KAT; if (alpha == KAT::zero()) { spmv_alpha_mv_struct(space, mode, alpha, A, x, beta, y); diff --git a/sparse/impl/KokkosSparse_sptrsv_solve_impl.hpp b/sparse/impl/KokkosSparse_sptrsv_solve_impl.hpp index 01fef9d086..ace9dde6b5 100644 --- a/sparse/impl/KokkosSparse_sptrsv_solve_impl.hpp +++ b/sparse/impl/KokkosSparse_sptrsv_solve_impl.hpp @@ -72,7 +72,7 @@ struct SptrsvWrap { using values_t = typename TriSolveHandle::nnz_scalar_view_t; using work_view_t = Kokkos::View>; using work_view_int_t = Kokkos::View>; - using karith = typename Kokkos::ArithTraits; + using karith = typename KokkosKernels::ArithTraits; using team_policy = typename TriSolveHandle::TeamPolicy; using member_type = typename team_policy::member_type; using range_policy = typename TriSolveHandle::RangePolicy; diff --git a/sparse/impl/KokkosSparse_trsv_impl.hpp b/sparse/impl/KokkosSparse_trsv_impl.hpp index d166024049..a1ff872604 100644 --- a/sparse/impl/KokkosSparse_trsv_impl.hpp +++ b/sparse/impl/KokkosSparse_trsv_impl.hpp @@ -40,7 +40,7 @@ struct TrsvWrap { using scalar_t = typename CrsMatrixType::values_type::non_const_value_type; using device_t = typename CrsMatrixType::device_type; using sview_1d = typename Kokkos::View; - using STS = Kokkos::ArithTraits; + using STS = KokkosKernels::ArithTraits; static inline void manual_copy(RangeMultiVectorType X, DomainMultiVectorType Y) { auto numRows = X.extent(0); diff --git a/sparse/impl/KokkosSparse_twostage_gauss_seidel_impl.hpp b/sparse/impl/KokkosSparse_twostage_gauss_seidel_impl.hpp index d5afdb8c59..58e8dbd747 100644 --- a/sparse/impl/KokkosSparse_twostage_gauss_seidel_impl.hpp +++ b/sparse/impl/KokkosSparse_twostage_gauss_seidel_impl.hpp @@ -75,7 +75,7 @@ class TwostageGaussSeidel { using single_vector_view_t = Kokkos::View; using internal_vector_view_t = typename TwoStageGaussSeidelHandleType::vector_view_t; - using ST = Kokkos::ArithTraits; + using ST = KokkosKernels::ArithTraits; using mag_t = typename ST::mag_type; private: @@ -387,7 +387,7 @@ class TwostageGaussSeidel { // functor for storing both valuesL & valuesU (with parallel_for) KOKKOS_INLINE_FUNCTION void operator()(const Tag_valuesLU &, const ordinal_t i) const { - const_scalar_t one = Kokkos::ArithTraits::one(); + const_scalar_t one = KokkosKernels::ArithTraits::one(); ordinal_t nnzL = row_map(i); ordinal_t nnzU = row_map2(i); ordinal_t nnzLa = 0; @@ -779,8 +779,8 @@ class TwostageGaussSeidel { y_value_array_type localB, // in bool init_zero_x_vector = false, int numIter = 1, scalar_t omega = ST::one(), bool apply_forward = true, bool apply_backward = true, bool /*update_y_vector*/ = true) { - const_scalar_t one = Kokkos::ArithTraits::one(); - const_scalar_t zero = Kokkos::ArithTraits::zero(); + const_scalar_t one = KokkosKernels::ArithTraits::one(); + const_scalar_t zero = KokkosKernels::ArithTraits::zero(); #ifdef KOKKOSSPARSE_IMPL_TIME_TWOSTAGE_GS double tic; Kokkos::Timer timer; diff --git a/sparse/src/KokkosSparse_BsrMatrix.hpp b/sparse/src/KokkosSparse_BsrMatrix.hpp index 7f3fcc10bc..359f41760e 100644 --- a/sparse/src/KokkosSparse_BsrMatrix.hpp +++ b/sparse/src/KokkosSparse_BsrMatrix.hpp @@ -145,11 +145,11 @@ struct BsrRowView { } /// \brief Return offset into colidx_ for the requested block idx - /// If none found, return Kokkos::ArithTraits::max + /// If none found, return KokkosKernels::ArithTraits::max /// \param idx_to_match [in] local block idx within block-row KOKKOS_INLINE_FUNCTION ordinal_type findRelBlockOffset(const ordinal_type idx_to_match, bool /*is_sorted*/ = false) const { - ordinal_type offset = Kokkos::ArithTraits::max(); + ordinal_type offset = KokkosKernels::ArithTraits::max(); for (ordinal_type blk_offset = 0; blk_offset < length; ++blk_offset) { ordinal_type idx = colidx_[blk_offset]; if (idx == idx_to_match) { @@ -269,12 +269,12 @@ struct BsrRowViewConst { } /// \brief Return offset into colidx_ for the requested block idx - /// If none found, return Kokkos::ArithTraits::max + /// If none found, return KokkosKernels::ArithTraits::max /// \param idx_to_match [in] local block idx within block-row KOKKOS_INLINE_FUNCTION ordinal_type findRelBlockOffset(const ordinal_type& idx_to_match, bool /*is_sorted*/ = false) const { typedef typename std::remove_cv::type non_const_ordinal_type; - non_const_ordinal_type offset = Kokkos::ArithTraits::max(); + non_const_ordinal_type offset = KokkosKernels::ArithTraits::max(); for (non_const_ordinal_type blk_offset = 0; blk_offset < length; ++blk_offset) { ordinal_type idx = colidx_[blk_offset]; if (idx == idx_to_match) { @@ -961,7 +961,7 @@ class BsrMatrix { // + 1] (not global offset) colidx_ and values_ are already offset to the // beginning of blockrow rowi auto blk_offset = row_view.findRelBlockOffset(cols[i], is_sorted); - if (blk_offset != Kokkos::ArithTraits::max()) { + if (blk_offset != KokkosKernels::ArithTraits::max()) { ordinal_type offset_into_vals = i * block_size * block_size; // stride == 1 assumed between elements for (ordinal_type lrow = 0; lrow < block_size; ++lrow) { auto local_row_values = diff --git a/sparse/src/KokkosSparse_IOUtils.hpp b/sparse/src/KokkosSparse_IOUtils.hpp index 8ae4e91b65..7649365359 100644 --- a/sparse/src/KokkosSparse_IOUtils.hpp +++ b/sparse/src/KokkosSparse_IOUtils.hpp @@ -114,7 +114,7 @@ void kk_diagonally_dominant_sparseMatrix_generate(OrdinalType nrows, OrdinalType OrdinalType row_size_variance, OrdinalType bandwidth, ScalarType *&values, SizeType *&rowPtr, OrdinalType *&colInd, ScalarType diagDominance = 10 * - Kokkos::ArithTraits::one()) { + KokkosKernels::ArithTraits::one()) { rowPtr = new SizeType[nrows + 1]; OrdinalType elements_per_row = nnz / nrows; // Set a hard limit to the actual entries in any one row, so that the @@ -168,7 +168,7 @@ void kk_diagonally_dominant_sparseMatrix_generate(OrdinalType nrows, OrdinalType entriesInRow.insert(pos); colInd[k] = pos; values[k] = 100.0 * rand() / RAND_MAX - 50.0; - total_values += Kokkos::ArithTraits::abs(values[k]); + total_values += KokkosKernels::ArithTraits::abs(values[k]); break; } } @@ -231,7 +231,7 @@ crsMat_t kk_generate_diagonally_dominant_sparse_matrix( typename crsMat_t::non_const_size_type &nnz, typename crsMat_t::const_ordinal_type row_size_variance, typename crsMat_t::const_ordinal_type bandwidth, typename crsMat_t::const_value_type diagDominance = 10 * - Kokkos::ArithTraits::one()) { + KokkosKernels::ArithTraits::one()) { typedef typename crsMat_t::StaticCrsGraphType graph_t; typedef typename graph_t::row_map_type::non_const_type row_map_view_t; typedef typename graph_t::entries_type::non_const_type cols_view_t; @@ -1138,7 +1138,7 @@ int read_hb(const char *fileName, lno_t &nrows, lno_t &ncols, size_type &ne, siz } else { // Initialize to one for (size_type i = 0; i < nnz_raw; ++i) { - raw_vals[i] = Kokkos::ArithTraits::one(); + raw_vals[i] = KokkosKernels::ArithTraits::one(); } } diff --git a/sparse/src/KokkosSparse_LUPrec.hpp b/sparse/src/KokkosSparse_LUPrec.hpp index e1fdae358b..6cb11a0a8c 100644 --- a/sparse/src/KokkosSparse_LUPrec.hpp +++ b/sparse/src/KokkosSparse_LUPrec.hpp @@ -48,7 +48,7 @@ class LUPrec : public KokkosSparse::Experimental::Preconditioner { using EXSP = typename CRS::execution_space; using MEMSP = typename CRS::memory_space; using DEVICE = typename Kokkos::Device; - using karith = typename Kokkos::ArithTraits; + using karith = typename KokkosKernels::ArithTraits; using View1d = typename Kokkos::View; private: diff --git a/sparse/src/KokkosSparse_MatrixPrec.hpp b/sparse/src/KokkosSparse_MatrixPrec.hpp index 5d9bde148b..d8a11b4d17 100644 --- a/sparse/src/KokkosSparse_MatrixPrec.hpp +++ b/sparse/src/KokkosSparse_MatrixPrec.hpp @@ -51,7 +51,7 @@ class MatrixPrec : public KokkosSparse::Experimental::Preconditioner { using ScalarType = typename std::remove_const::type; using EXSP = typename CRS::execution_space; using MEMSP = typename CRS::memory_space; - using karith = typename Kokkos::ArithTraits; + using karith = typename KokkosKernels::ArithTraits; //! Constructor: template diff --git a/sparse/src/KokkosSparse_Preconditioner.hpp b/sparse/src/KokkosSparse_Preconditioner.hpp index 7520afe671..b85252d287 100644 --- a/sparse/src/KokkosSparse_Preconditioner.hpp +++ b/sparse/src/KokkosSparse_Preconditioner.hpp @@ -54,7 +54,7 @@ class Preconditioner { using ScalarType = typename std::remove_const::type; using EXSP = typename CRS::execution_space; using MEMSP = typename CRS::memory_space; - using karith = typename Kokkos::ArithTraits; + using karith = typename KokkosKernels::ArithTraits; //! Constructor: Preconditioner() {} diff --git a/sparse/src/KokkosSparse_SortCrs.hpp b/sparse/src/KokkosSparse_SortCrs.hpp index 5217bafd67..284693d7a3 100644 --- a/sparse/src/KokkosSparse_SortCrs.hpp +++ b/sparse/src/KokkosSparse_SortCrs.hpp @@ -44,7 +44,7 @@ template ::max(), + KokkosKernels::ArithTraits::max(), SortAlgorithm option = SortAlgorithm::DEFAULT) { static_assert(Kokkos::SpaceAccessibility::accessible, "sort_crs_matrix: rowmap_t is not accessible from the given execution " @@ -82,7 +82,7 @@ void sort_crs_matrix(const execution_space& exec, const rowmap_t& rowmap, const Ordinal maxDeg = KokkosSparse::Impl::graph_max_degree(exec, rowmap); if (KokkosSparse::Impl::useBulkSortHeuristic(avgDeg, maxDeg)) { // Calculate the true number of columns if user didn't pass it in - if (numCols == Kokkos::ArithTraits::max()) { + if (numCols == KokkosKernels::ArithTraits::max()) { KokkosKernels::Impl::kk_view_reduce_max(exec, entries.extent(0), entries, numCols); numCols++; } @@ -122,7 +122,7 @@ void sort_crs_matrix(const execution_space& exec, const rowmap_t& rowmap, const template void sort_crs_matrix( const rowmap_t& rowmap, const entries_t& entries, const values_t& values, - typename entries_t::const_value_type numCols = Kokkos::ArithTraits::max(), + typename entries_t::const_value_type numCols = KokkosKernels::ArithTraits::max(), SortAlgorithm option = SortAlgorithm::DEFAULT) { sort_crs_matrix(execution_space(), rowmap, entries, values, numCols, option); } @@ -130,7 +130,7 @@ void sort_crs_matrix( template void sort_crs_matrix( const rowmap_t& rowmap, const entries_t& entries, const values_t& values, - typename entries_t::const_value_type numCols = Kokkos::ArithTraits::max(), + typename entries_t::const_value_type numCols = KokkosKernels::ArithTraits::max(), SortAlgorithm option = SortAlgorithm::DEFAULT) { sort_crs_matrix(typename entries_t::execution_space(), rowmap, entries, values, numCols, option); } @@ -154,7 +154,7 @@ template ::max()) { + KokkosKernels::ArithTraits::max()) { static_assert(std::is_same_v, "sort_bsr_matrix: Ordinal type must match nonconst value type of " "entries_t (default template parameter)"); @@ -162,7 +162,7 @@ void sort_bsr_matrix(const execution_space& exec, Ordinal blockSize, const rowma return; } Ordinal numRows = rowmap.extent(0) ? rowmap.extent(0) - 1 : 0; - if (numCols == Kokkos::ArithTraits::max()) { + if (numCols == KokkosKernels::ArithTraits::max()) { KokkosKernels::Impl::kk_view_reduce_max(exec, entries.extent(0), entries, numCols); numCols++; } @@ -185,7 +185,7 @@ void sort_bsr_matrix(const execution_space& exec, Ordinal blockSize, const rowma template void sort_bsr_matrix(Ordinal blockdim, const rowmap_t& rowmap, const entries_t& entries, const values_t& values, - Ordinal numCols = Kokkos::ArithTraits::max()) { + Ordinal numCols = KokkosKernels::ArithTraits::max()) { sort_bsr_matrix(execution_space(), blockdim, rowmap, entries, values, numCols); } @@ -209,7 +209,7 @@ void sort_bsr_matrix(const bsrMat_t& A) { template void sort_crs_graph(const execution_space& exec, const rowmap_t& rowmap, const entries_t& entries, typename entries_t::non_const_value_type numCols = - Kokkos::ArithTraits::max(), + KokkosKernels::ArithTraits::max(), SortAlgorithm option = SortAlgorithm::DEFAULT) { using Ordinal = typename entries_t::non_const_value_type; static_assert(Kokkos::SpaceAccessibility::accessible, @@ -240,7 +240,7 @@ void sort_crs_graph(const execution_space& exec, const rowmap_t& rowmap, const e Ordinal maxDeg = KokkosSparse::Impl::graph_max_degree(exec, rowmap); if (KokkosSparse::Impl::useBulkSortHeuristic(avgDeg, maxDeg)) { // Calculate the true number of columns if user didn't pass it in - if (numCols == Kokkos::ArithTraits::max()) { + if (numCols == KokkosKernels::ArithTraits::max()) { KokkosKernels::Impl::kk_view_reduce_max(exec, entries.extent(0), entries, numCols); numCols++; } @@ -271,14 +271,14 @@ void sort_crs_graph(const execution_space& exec, const rowmap_t& rowmap, const e template void sort_crs_graph(const rowmap_t& rowmap, const entries_t& entries, SortAlgorithm option = SortAlgorithm::DEFAULT) { sort_crs_graph(execution_space(), rowmap, entries, - Kokkos::ArithTraits::max(), option); + KokkosKernels::ArithTraits::max(), option); } template typename std::enable_if_t> sort_crs_graph( const rowmap_t& rowmap, const entries_t& entries, typename entries_t::const_value_type& numCols = - Kokkos::ArithTraits::max(), + KokkosKernels::ArithTraits::max(), SortAlgorithm option = SortAlgorithm::DEFAULT) { sort_crs_graph(typename entries_t::execution_space(), rowmap, entries, numCols, option); } @@ -287,7 +287,7 @@ template typename std::enable_if_t> sort_crs_graph( const execution_space& exec, const crsGraph_t& G, typename crsGraph_t::entries_type::const_value_type& numCols = - Kokkos::ArithTraits::max(), + KokkosKernels::ArithTraits::max(), SortAlgorithm option = SortAlgorithm::DEFAULT) { sort_crs_graph(exec, G.row_map, G.entries, numCols, option); } @@ -295,7 +295,7 @@ typename std::enable_if_t> sort_cr template void sort_crs_graph(const crsGraph_t& G, typename crsGraph_t::entries_type::const_value_type& numCols = - Kokkos::ArithTraits::max(), + KokkosKernels::ArithTraits::max(), SortAlgorithm option = SortAlgorithm::DEFAULT) { sort_crs_graph(typename crsGraph_t::execution_space(), G, numCols, option); } @@ -305,7 +305,7 @@ void sort_and_merge_matrix(const exec_space& exec, const typename rowmap_t::cons const entries_t& entries_in, const values_t& values_in, rowmap_t& rowmap_out, entries_t& entries_out, values_t& values_out, typename entries_t::const_value_type& numCols = - Kokkos::ArithTraits::max(), + KokkosKernels::ArithTraits::max(), SortAlgorithm option = SortAlgorithm::DEFAULT) { using nc_rowmap_t = typename rowmap_t::non_const_type; using Offset = typename nc_rowmap_t::value_type; @@ -406,7 +406,7 @@ void sort_and_merge_matrix(const typename rowmap_t::const_type& rowmap_in, const const values_t& values_in, rowmap_t& rowmap_out, entries_t& entries_out, values_t& values_out, typename entries_t::const_value_type& numCols = - Kokkos::ArithTraits::max(), + KokkosKernels::ArithTraits::max(), SortAlgorithm option = SortAlgorithm::DEFAULT) { sort_and_merge_matrix(exec_space(), rowmap_in, entries_in, values_in, rowmap_out, entries_out, values_out, numCols, option); @@ -417,7 +417,7 @@ void sort_and_merge_matrix(const typename rowmap_t::const_type& rowmap_in, const const values_t& values_in, rowmap_t& rowmap_out, entries_t& entries_out, values_t& values_out, typename entries_t::const_value_type& numCols = - Kokkos::ArithTraits::max(), + KokkosKernels::ArithTraits::max(), SortAlgorithm option = SortAlgorithm::DEFAULT) { sort_and_merge_matrix(typename entries_t::execution_space(), rowmap_in, entries_in, values_in, rowmap_out, entries_out, values_out, numCols, option); @@ -427,7 +427,7 @@ template void sort_and_merge_graph(const exec_space& exec, const typename rowmap_t::const_type& rowmap_in, const entries_t& entries_in, rowmap_t& rowmap_out, entries_t& entries_out, typename entries_t::const_value_type& numCols = - Kokkos::ArithTraits::max(), + KokkosKernels::ArithTraits::max(), SortAlgorithm option = SortAlgorithm::DEFAULT) { using Offset = typename rowmap_t::non_const_value_type; using Ordinal = typename entries_t::value_type; @@ -494,7 +494,7 @@ template void sort_and_merge_graph(const typename rowmap_t::const_type& rowmap_in, const entries_t& entries_in, rowmap_t& rowmap_out, entries_t& entries_out, typename entries_t::const_value_type& numCols = - Kokkos::ArithTraits::max(), + KokkosKernels::ArithTraits::max(), SortAlgorithm option = SortAlgorithm::DEFAULT) { return sort_and_merge_graph(exec_space(), rowmap_in, entries_in, rowmap_out, entries_out, numCols, option); } @@ -503,7 +503,7 @@ template void sort_and_merge_graph(const typename rowmap_t::const_type& rowmap_in, const entries_t& entries_in, rowmap_t& rowmap_out, entries_t& entries_out, typename entries_t::const_value_type& numCols = - Kokkos::ArithTraits::max(), + KokkosKernels::ArithTraits::max(), SortAlgorithm option = SortAlgorithm::DEFAULT) { return sort_and_merge_graph(typename entries_t::execution_space(), rowmap_in, entries_in, rowmap_out, entries_out, numCols, option); @@ -512,7 +512,7 @@ void sort_and_merge_graph(const typename rowmap_t::const_type& rowmap_in, const template crsGraph_t sort_and_merge_graph(const typename crsGraph_t::execution_space& exec, const crsGraph_t& G, typename crsGraph_t::entries_type::const_value_type& numCols = - Kokkos::ArithTraits::max(), + KokkosKernels::ArithTraits::max(), SortAlgorithm option = SortAlgorithm::DEFAULT) { using rowmap_t = typename crsGraph_t::row_map_type::non_const_type; using entries_t = typename crsGraph_t::entries_type; @@ -527,7 +527,7 @@ crsGraph_t sort_and_merge_graph(const typename crsGraph_t::execution_space& exec template crsGraph_t sort_and_merge_graph(const crsGraph_t& G, typename crsGraph_t::entries_type::const_value_type& numCols = - Kokkos::ArithTraits::max(), + KokkosKernels::ArithTraits::max(), SortAlgorithm option = SortAlgorithm::DEFAULT) { return sort_and_merge_graph(typename crsGraph_t::execution_space(), G, numCols, option); } diff --git a/sparse/src/KokkosSparse_Utils.hpp b/sparse/src/KokkosSparse_Utils.hpp index 49d84dc25f..1a9adbb4e6 100644 --- a/sparse/src/KokkosSparse_Utils.hpp +++ b/sparse/src/KokkosSparse_Utils.hpp @@ -1684,7 +1684,7 @@ struct CountDroppedEntriesFunctor { CountDroppedEntriesFunctor(const Values &values_, Mag tol_) : values(values_), tol(tol_) {} KOKKOS_INLINE_FUNCTION void operator()(int64_t i, Offset &lcount) const { - if (Kokkos::ArithTraits::abs(values(i)) <= tol) lcount++; + if (KokkosKernels::ArithTraits::abs(values(i)) <= tol) lcount++; } Values values; @@ -1741,7 +1741,7 @@ struct DropEntriesFunctor { // i_in is the index of the input entry being processed // i_out (if finalPass == true) is the index of where that same entry goes // in the filtered matrix - bool filter = Kokkos::ArithTraits::abs(valuesIn(i_in)) <= tol; + bool filter = KokkosKernels::ArithTraits::abs(valuesIn(i_in)) <= tol; bool isRowEnd = rowEndMarkers.test(i_in); if (finalPass) { if (!filter) { @@ -1797,7 +1797,7 @@ struct ExpandRowmapFunctor { // Otherwise a new matrix is returned. template Matrix removeCrsMatrixZeros(const Matrix &A, - typename Kokkos::ArithTraits::mag_type tol = 0) { + typename KokkosKernels::ArithTraits::mag_type tol = 0) { using Ordinal = typename Matrix::non_const_ordinal_type; using Offset = typename Matrix::non_const_size_type; using Device = typename Matrix::device_type; diff --git a/sparse/src/KokkosSparse_gmres_handle.hpp b/sparse/src/KokkosSparse_gmres_handle.hpp index 3c292d539c..96fff5a4f4 100644 --- a/sparse/src/KokkosSparse_gmres_handle.hpp +++ b/sparse/src/KokkosSparse_gmres_handle.hpp @@ -54,7 +54,7 @@ class GMRESHandle { using nnz_scalar_t = typename std::remove_const::type; using const_nnz_scalar_t = const nnz_scalar_t; - using float_t = typename Kokkos::ArithTraits::mag_type; + using float_t = typename KokkosKernels::ArithTraits::mag_type; using nnz_row_view_t = typename Kokkos::View; diff --git a/sparse/src/KokkosSparse_mdf.hpp b/sparse/src/KokkosSparse_mdf.hpp index a3785c08c1..d26bc4417e 100644 --- a/sparse/src/KokkosSparse_mdf.hpp +++ b/sparse/src/KokkosSparse_mdf.hpp @@ -61,7 +61,7 @@ void mdf_symbolic(const crs_matrix_type& A, MDF_handle& handle) { template void mdf_print_joined_view(const view_t& dev_view, const char* sep, - ordinal_t max_count = Kokkos::ArithTraits::max()) { + ordinal_t max_count = KokkosKernels::ArithTraits::max()) { const auto host_view = Kokkos::create_mirror_view_and_copy(Kokkos::HostSpace(), dev_view); max_count = max_count > (ordinal_t)host_view.extent(0) ? (ordinal_t)host_view.extent(0) : max_count; @@ -100,8 +100,8 @@ void mdf_numeric(const crs_matrix_type& A, MDF_handle& handle) { ordinal_type update_list_len = 0; col_ind_type update_list("update list", A.numRows()); col_ind_type factored("factored rows", A.numRows()); - Kokkos::deep_copy(discarded_fill, Kokkos::ArithTraits::max()); - Kokkos::deep_copy(deficiency, Kokkos::ArithTraits::max()); + Kokkos::deep_copy(discarded_fill, KokkosKernels::ArithTraits::max()); + Kokkos::deep_copy(deficiency, KokkosKernels::ArithTraits::max()); permutation_set_type permutation_set(A.numRows()); KokkosSparse::Impl::MDF_discarded_fill_norm MDF_df_norm( diff --git a/sparse/src/KokkosSparse_par_ilut_handle.hpp b/sparse/src/KokkosSparse_par_ilut_handle.hpp index dac9544b8c..3392e625c6 100644 --- a/sparse/src/KokkosSparse_par_ilut_handle.hpp +++ b/sparse/src/KokkosSparse_par_ilut_handle.hpp @@ -52,7 +52,7 @@ class PAR_ILUTHandle { using nnz_scalar_t = typename std::remove_const::type; using const_nnz_scalar_t = const nnz_scalar_t; - using float_t = typename Kokkos::ArithTraits::mag_type; + using float_t = typename KokkosKernels::ArithTraits::mag_type; using nnz_row_view_t = typename Kokkos::View; diff --git a/sparse/src/KokkosSparse_spiluk_handle.hpp b/sparse/src/KokkosSparse_spiluk_handle.hpp index 56e358369c..4f111e3cb4 100644 --- a/sparse/src/KokkosSparse_spiluk_handle.hpp +++ b/sparse/src/KokkosSparse_spiluk_handle.hpp @@ -121,14 +121,14 @@ class SPILUKHandle { vector_size(-1) {} void reset_handle(const size_type nrows_, const size_type nnzL_, const size_type nnzU_, - const size_type block_size_ = Kokkos::ArithTraits::max()) { + const size_type block_size_ = KokkosKernels::ArithTraits::max()) { set_nrows(nrows_); set_num_levels(0); set_nnzL(nnzL_); set_nnzU(nnzU_); // user likely does not want to reset block size to 0, so set default // to size_type::max - if (block_size_ != Kokkos::ArithTraits::max()) { + if (block_size_ != KokkosKernels::ArithTraits::max()) { set_block_size(block_size_); } set_level_maxrows(0); diff --git a/sparse/src/KokkosSparse_spmv.hpp b/sparse/src/KokkosSparse_spmv.hpp index e59c73f505..2ca3e7318a 100644 --- a/sparse/src/KokkosSparse_spmv.hpp +++ b/sparse/src/KokkosSparse_spmv.hpp @@ -142,12 +142,12 @@ void spmv(const ExecutionSpace& space, Handle* handle, const char mode[], const } // Efficiently handle cases where alpha*Op(A) is equivalent to the zero matrix - if (alpha == Kokkos::ArithTraits::zero() || m == 0 || n == 0 || A.nnz() == 0) { + if (alpha == KokkosKernels::ArithTraits::zero() || m == 0 || n == 0 || A.nnz() == 0) { // This is required to maintain semantics of KokkosKernels native SpMV: // if y contains NaN but beta = 0, the result y should be filled with 0. // For example, this is useful for passing in uninitialized y and beta=0. - if (beta == Kokkos::ArithTraits::zero()) - Kokkos::deep_copy(space, y, Kokkos::ArithTraits::zero()); + if (beta == KokkosKernels::ArithTraits::zero()) + Kokkos::deep_copy(space, y, KokkosKernels::ArithTraits::zero()); else KokkosBlas::scal(space, y, beta, y); return; @@ -259,7 +259,7 @@ void spmv(const ExecutionSpace& space, Handle* handle, const char mode[], const if (useNative) { // Explicitly call the non-TPL SPMV implementation std::string label = "KokkosSparse::spmv[NATIVE," + - Kokkos::ArithTraits::name() + "]"; + KokkosKernels::ArithTraits::name() + "]"; Kokkos::Profiling::pushRegion(label); Impl::SPMV::spmv( space, handle, mode, alpha, A_i, x_i, beta, y_i); @@ -293,7 +293,7 @@ void spmv(const ExecutionSpace& space, Handle* handle, const char mode[], const if (useNative) { std::string label = "KokkosSparse::spmv[NATIVE,MV," + - Kokkos::ArithTraits::name() + "]"; + KokkosKernels::ArithTraits::name() + "]"; Kokkos::Profiling::pushRegion(label); return Impl::SPMV_MV::value, false>::spmv_mv(space, @@ -335,7 +335,7 @@ void spmv(const ExecutionSpace& space, Handle* handle, const char mode[], const if (useNative) { // Explicitly call the non-TPL SPMV_BSRMATRIX implementation std::string label = "KokkosSparse::spmv[NATIVE,BSRMATRIX," + - Kokkos::ArithTraits::name() + "]"; + KokkosKernels::ArithTraits::name() + "]"; Kokkos::Profiling::pushRegion(label); Impl::SPMV_BSRMATRIX::spmv_bsrmatrix(space, handle, mode, alpha, A_i, x_i, beta, y_i); @@ -363,7 +363,7 @@ void spmv(const ExecutionSpace& space, Handle* handle, const char mode[], const if (useNative) { // Explicitly call the non-TPL SPMV_BSRMATRIX implementation std::string label = "KokkosSparse::spmv[NATIVE,MV,BSMATRIX," + - Kokkos::ArithTraits::name() + "]"; + KokkosKernels::ArithTraits::name() + "]"; Kokkos::Profiling::pushRegion(label); Impl::SPMV_MV_BSRMATRIX::value, diff --git a/sparse/src/KokkosSparse_sptrsv_handle.hpp b/sparse/src/KokkosSparse_sptrsv_handle.hpp index 2cb4079afa..c7febfdf9d 100644 --- a/sparse/src/KokkosSparse_sptrsv_handle.hpp +++ b/sparse/src/KokkosSparse_sptrsv_handle.hpp @@ -476,7 +476,7 @@ class SPTRSVHandle { } #if defined(__clang__) && defined(KOKKOS_ENABLE_CUDA) - if (algm == SPTRSVAlgorithm::SEQLVLSCHD_TP1 && Kokkos::ArithTraits::isComplex && + if (algm == SPTRSVAlgorithm::SEQLVLSCHD_TP1 && KokkosKernels::ArithTraits::isComplex && std::is_same_v && block_size_ != 0) { throw(std::runtime_error( "sptrsv handle: SPTRSV may not work with blocks+clang+cuda+complex due to a compiler bug")); diff --git a/sparse/tpls/KokkosSparse_spadd_numeric_tpl_spec_decl.hpp b/sparse/tpls/KokkosSparse_spadd_numeric_tpl_spec_decl.hpp index 93362d176d..2d6f1415d6 100644 --- a/sparse/tpls/KokkosSparse_spadd_numeric_tpl_spec_decl.hpp +++ b/sparse/tpls/KokkosSparse_spadd_numeric_tpl_spec_decl.hpp @@ -77,7 +77,7 @@ namespace Impl { colidx_view_t colidxB, scalar_view_t valuesB, rowmap_view_t rowmapC, \ non_const_colidx_view_t colidxC, non_const_scalar_view_t valuesC) { \ Kokkos::Profiling::pushRegion("KokkosSparse::spadd_numeric[TPL_CUSPARSE," + \ - Kokkos::ArithTraits::name() + "]"); \ + KokkosKernels::ArithTraits::name() + "]"); \ \ auto addHandle = handle->get_spadd_handle(); \ auto &cuspData = addHandle->cusparseData; \ @@ -177,7 +177,7 @@ KOKKOSSPARSE_SPADD_NUMERIC_TPL_SPEC_DECL_CUSPARSE_EXT(false) colidx_view_t colidxB, scalar_view_t valuesB, rowmap_view_t rowmapC, \ non_const_colidx_view_t colidxC, non_const_scalar_view_t valuesC) { \ Kokkos::Profiling::pushRegion("KokkosSparse::spadd_numeric[TPL_ROCSPARSE," + \ - Kokkos::ArithTraits::name() + "]"); \ + KokkosKernels::ArithTraits::name() + "]"); \ \ auto addHandle = handle->get_spadd_handle(); \ auto &rocData = addHandle->rocsparseData; \ diff --git a/sparse/tpls/KokkosSparse_spadd_symbolic_tpl_spec_decl.hpp b/sparse/tpls/KokkosSparse_spadd_symbolic_tpl_spec_decl.hpp index 878d1dd8e7..e7f1e4fff9 100644 --- a/sparse/tpls/KokkosSparse_spadd_symbolic_tpl_spec_decl.hpp +++ b/sparse/tpls/KokkosSparse_spadd_symbolic_tpl_spec_decl.hpp @@ -58,7 +58,7 @@ namespace Impl { const ORDINAL_TYPE n, rowmap_view_t rowmapA, colidx_view_t colidxA, \ rowmap_view_t rowmapB, colidx_view_t colidxB, non_const_rowmap_view_t rowmapC) { \ Kokkos::Profiling::pushRegion("KokkosSparse::spadd_symbolic[TPL_CUSPARSE," + \ - Kokkos::ArithTraits::name() + "]"); \ + KokkosKernels::ArithTraits::name() + "]"); \ \ auto addHandle = handle->get_spadd_handle(); \ auto& cuspData = addHandle->cusparseData; \ @@ -151,7 +151,7 @@ KOKKOSSPARSE_SPADD_SYMBOLIC_TPL_SPEC_DECL_CUSPARSE_EXT(false) const ORDINAL_TYPE n, rowmap_view_t rowmapA, colidx_view_t colidxA, \ rowmap_view_t rowmapB, colidx_view_t colidxB, non_const_rowmap_view_t rowmapC) { \ Kokkos::Profiling::pushRegion("KokkosSparse::spadd_symbolic[TPL_ROCSPARSE," + \ - Kokkos::ArithTraits::name() + "]"); \ + KokkosKernels::ArithTraits::name() + "]"); \ \ auto addHandle = handle->get_spadd_handle(); \ auto& rocData = addHandle->rocsparseData; \ diff --git a/sparse/tpls/KokkosSparse_spgemm_noreuse_tpl_spec_decl.hpp b/sparse/tpls/KokkosSparse_spgemm_noreuse_tpl_spec_decl.hpp index d54a91000a..af3f5aa0c1 100644 --- a/sparse/tpls/KokkosSparse_spgemm_noreuse_tpl_spec_decl.hpp +++ b/sparse/tpls/KokkosSparse_spgemm_noreuse_tpl_spec_decl.hpp @@ -50,8 +50,8 @@ Matrix spgemm_noreuse_cusparse(const MatrixConst &A, const MatrixConst &B) { int m = A.numRows(); int n = B.numRows(); int k = B.numCols(); - const auto alpha = Kokkos::ArithTraits::one(); - const auto beta = Kokkos::ArithTraits::zero(); + const auto alpha = KokkosKernels::ArithTraits::one(); + const auto beta = KokkosKernels::ArithTraits::zero(); typename Matrix::row_map_type::non_const_type row_mapC(Kokkos::view_alloc(Kokkos::WithoutInitializing, "C rowmap"), m + 1); @@ -123,7 +123,7 @@ Matrix spgemm_noreuse_cusparse(const MatrixConst &A, const MatrixConst &B) { Kokkos::MemoryTraits, const int>; \ static KokkosSparse::CrsMatrix, void, int> spgemm_noreuse( \ const ConstMatrix &A, bool, const ConstMatrix &B, bool) { \ - std::string label = "KokkosSparse::spgemm_noreuse[TPL_CUSPARSE," + Kokkos::ArithTraits::name() + "]"; \ + std::string label = "KokkosSparse::spgemm_noreuse[TPL_CUSPARSE," + KokkosKernels::ArithTraits::name() + "]"; \ Kokkos::Profiling::pushRegion(label); \ Matrix C = spgemm_noreuse_cusparse(A, B); \ Kokkos::Profiling::popRegion(); \ @@ -213,7 +213,7 @@ Matrix spgemm_noreuse_mkl(const MatrixConst &A, const MatrixConst &B) { Kokkos::MemoryTraits, const MKL_INT>; \ static KokkosSparse::CrsMatrix, void, MKL_INT> \ spgemm_noreuse(const ConstMatrix &A, bool, const ConstMatrix &B, bool) { \ - std::string label = "KokkosSparse::spgemm_noreuse[TPL_MKL," + Kokkos::ArithTraits::name() + "]"; \ + std::string label = "KokkosSparse::spgemm_noreuse[TPL_MKL," + KokkosKernels::ArithTraits::name() + "]"; \ Kokkos::Profiling::pushRegion(label); \ Matrix C = spgemm_noreuse_mkl(A, B); \ Kokkos::Profiling::popRegion(); \ diff --git a/sparse/tpls/KokkosSparse_spgemm_numeric_tpl_spec_decl.hpp b/sparse/tpls/KokkosSparse_spgemm_numeric_tpl_spec_decl.hpp index 917704870a..7c41290528 100644 --- a/sparse/tpls/KokkosSparse_spgemm_numeric_tpl_spec_decl.hpp +++ b/sparse/tpls/KokkosSparse_spgemm_numeric_tpl_spec_decl.hpp @@ -94,8 +94,8 @@ void spgemm_numeric_cusparse(KernelHandle *handle, lno_t /*m*/, lno_t /*n*/, lno } // C' = alpha * opA(A) * opB(B) + beta * C - const auto alpha = Kokkos::ArithTraits::one(); - const auto beta = Kokkos::ArithTraits::zero(); + const auto alpha = KokkosKernels::ArithTraits::one(); + const auto beta = KokkosKernels::ArithTraits::zero(); // alpha, beta are on host, but since we use singleton on the cusparse // handle, we save/restore the pointer mode to not interference with @@ -127,8 +127,8 @@ void spgemm_numeric_cusparse(KernelHandle *handle, lno_t /*m*/, lno_t /*n*/, lno cusparseCsrSetPointers(h->descr_B, (void *)row_mapB.data(), (void *)entriesB.data(), (void *)valuesB.data())); KOKKOSSPARSE_IMPL_CUSPARSE_SAFE_CALL( cusparseCsrSetPointers(h->descr_C, (void *)row_mapC.data(), (void *)entriesC.data(), (void *)valuesC.data())); - const auto alpha = Kokkos::ArithTraits::one(); - const auto beta = Kokkos::ArithTraits::zero(); + const auto alpha = KokkosKernels::ArithTraits::one(); + const auto beta = KokkosKernels::ArithTraits::zero(); KOKKOSSPARSE_IMPL_CUSPARSE_SAFE_CALL( cusparseSpGEMM_compute(h->cusparseHandle, h->opA, h->opB, &alpha, h->descr_A, h->descr_B, &beta, h->descr_C, h->scalarType, CUSPARSE_SPGEMM_DEFAULT, h->spgemmDescr, &h->bufferSize4, h->buffer4)); @@ -233,7 +233,7 @@ void spgemm_numeric_cusparse(KernelHandle *handle, lno_t m, lno_t n, lno_t k, co c_int_view_t row_mapA, c_int_view_t entriesA, c_scalar_view_t valuesA, bool, \ c_int_view_t row_mapB, c_int_view_t entriesB, c_scalar_view_t valuesB, bool, \ c_int_view_t row_mapC, int_view_t entriesC, scalar_view_t valuesC) { \ - std::string label = "KokkosSparse::spgemm_numeric[TPL_CUSPARSE," + Kokkos::ArithTraits::name() + "]"; \ + std::string label = "KokkosSparse::spgemm_numeric[TPL_CUSPARSE," + KokkosKernels::ArithTraits::name() + "]"; \ Kokkos::Profiling::pushRegion(label); \ spgemm_numeric_cusparse(handle->get_spgemm_handle(), m, n, k, row_mapA, entriesA, valuesA, row_mapB, entriesB, \ valuesB, row_mapC, entriesC, valuesC); \ @@ -297,8 +297,8 @@ void spgemm_numeric_rocsparse(KernelHandle *handle, typename KernelHandle::nnz_l typename KernelHandle::rocSparseSpgemmHandleType *h = handle->get_rocsparse_spgemm_handle(); - const auto alpha = Kokkos::ArithTraits::one(); - const auto beta = Kokkos::ArithTraits::zero(); + const auto alpha = KokkosKernels::ArithTraits::one(); + const auto beta = KokkosKernels::ArithTraits::zero(); rocsparse_pointer_mode oldPtrMode; auto nnz_A = colidxA.extent(0); @@ -372,7 +372,7 @@ void spgemm_numeric_rocsparse(KernelHandle *handle, typename KernelHandle::nnz_l c_int_view_t row_mapA, c_int_view_t entriesA, c_scalar_view_t valuesA, bool, \ c_int_view_t row_mapB, c_int_view_t entriesB, c_scalar_view_t valuesB, bool, \ c_int_view_t row_mapC, int_view_t entriesC, scalar_view_t valuesC) { \ - std::string label = "KokkosSparse::spgemm_numeric[TPL_ROCSPARSE," + Kokkos::ArithTraits::name() + "]"; \ + std::string label = "KokkosSparse::spgemm_numeric[TPL_ROCSPARSE," + KokkosKernels::ArithTraits::name() + "]"; \ Kokkos::Profiling::pushRegion(label); \ spgemm_numeric_rocsparse(handle->get_spgemm_handle(), m, n, k, row_mapA, entriesA, valuesA, row_mapB, entriesB, \ valuesB, row_mapC, entriesC, valuesC); \ @@ -487,7 +487,7 @@ void spgemm_numeric_mkl(KernelHandle *handle, typename KernelHandle::nnz_lno_t m c_int_view_t row_mapA, c_int_view_t entriesA, c_scalar_view_t valuesA, bool, \ c_int_view_t row_mapB, c_int_view_t entriesB, c_scalar_view_t valuesB, bool, \ c_int_view_t row_mapC, int_view_t entriesC, scalar_view_t valuesC) { \ - std::string label = "KokkosSparse::spgemm_numeric[TPL_MKL," + Kokkos::ArithTraits::name() + "]"; \ + std::string label = "KokkosSparse::spgemm_numeric[TPL_MKL," + KokkosKernels::ArithTraits::name() + "]"; \ Kokkos::Profiling::pushRegion(label); \ spgemm_numeric_mkl(handle->get_spgemm_handle(), m, n, k, row_mapA, entriesA, valuesA, row_mapB, entriesB, \ valuesB, row_mapC, entriesC, valuesC); \ diff --git a/sparse/tpls/KokkosSparse_spgemm_symbolic_tpl_spec_decl.hpp b/sparse/tpls/KokkosSparse_spgemm_symbolic_tpl_spec_decl.hpp index c789a1cf4d..91d2663a64 100644 --- a/sparse/tpls/KokkosSparse_spgemm_symbolic_tpl_spec_decl.hpp +++ b/sparse/tpls/KokkosSparse_spgemm_symbolic_tpl_spec_decl.hpp @@ -175,8 +175,8 @@ void spgemm_symbolic_cusparse(KernelHandle *handle, lno_t m, lno_t n, lno_t k, c const ConstEntriesType &entriesB, const RowMapType &row_mapC, bool computeRowptrs) { using scalar_type = typename KernelHandle::nnz_scalar_t; using ordinal_type = typename KernelHandle::nnz_lno_t; - const auto alpha = Kokkos::ArithTraits::one(); - const auto beta = Kokkos::ArithTraits::zero(); + const auto alpha = KokkosKernels::ArithTraits::one(); + const auto beta = KokkosKernels::ArithTraits::zero(); void *dummyValues_AB = nullptr; bool firstSymbolicCall = false; if (!handle->is_symbolic_called()) { @@ -340,7 +340,7 @@ void spgemm_symbolic_cusparse(KernelHandle *handle, lno_t m, lno_t n, lno_t k, c typename KernelHandle::nnz_lno_t n, typename KernelHandle::nnz_lno_t k, \ c_int_view_t row_mapA, c_int_view_t entriesA, bool, c_int_view_t row_mapB, \ c_int_view_t entriesB, bool, int_view_t row_mapC, bool computeRowptrs) { \ - std::string label = "KokkosSparse::spgemm_symbolic[TPL_CUSPARSE," + Kokkos::ArithTraits::name() + "]"; \ + std::string label = "KokkosSparse::spgemm_symbolic[TPL_CUSPARSE," + KokkosKernels::ArithTraits::name() + "]"; \ Kokkos::Profiling::pushRegion(label); \ spgemm_symbolic_cusparse(handle->get_spgemm_handle(), m, n, k, row_mapA, entriesA, row_mapB, entriesB, row_mapC, \ computeRowptrs); \ @@ -409,8 +409,8 @@ void spgemm_symbolic_rocsparse(KernelHandle *handle, typename KernelHandle::nnz_ // alpha, beta are on host, but since we use singleton on the rocsparse // handle, we save/restore the pointer mode to not interference with // others' use - const auto alpha = Kokkos::ArithTraits::one(); - const auto beta = Kokkos::ArithTraits::zero(); + const auto alpha = KokkosKernels::ArithTraits::one(); + const auto beta = KokkosKernels::ArithTraits::zero(); rocsparse_pointer_mode oldPtrMode; KOKKOSSPARSE_IMPL_ROCSPARSE_SAFE_CALL(rocsparse_get_pointer_mode(h->rocsparseHandle, &oldPtrMode)); @@ -471,7 +471,7 @@ void spgemm_symbolic_rocsparse(KernelHandle *handle, typename KernelHandle::nnz_ typename KernelHandle::nnz_lno_t n, typename KernelHandle::nnz_lno_t k, \ c_int_view_t row_mapA, c_int_view_t entriesA, bool, c_int_view_t row_mapB, \ c_int_view_t entriesB, bool, int_view_t row_mapC, bool) { \ - std::string label = "KokkosSparse::spgemm_symbolic[TPL_ROCSPARSE," + Kokkos::ArithTraits::name() + "]"; \ + std::string label = "KokkosSparse::spgemm_symbolic[TPL_ROCSPARSE," + KokkosKernels::ArithTraits::name() + "]"; \ Kokkos::Profiling::pushRegion(label); \ spgemm_symbolic_rocsparse(handle->get_spgemm_handle(), m, n, k, row_mapA, entriesA, row_mapB, entriesB, \ row_mapC); \ @@ -561,7 +561,7 @@ void spgemm_symbolic_mkl(KernelHandle *handle, typename KernelHandle::nnz_lno_t typename KernelHandle::nnz_lno_t n, typename KernelHandle::nnz_lno_t k, \ c_int_view_t row_mapA, c_int_view_t entriesA, bool, c_int_view_t row_mapB, \ c_int_view_t entriesB, bool, int_view_t row_mapC, bool) { \ - std::string label = "KokkosSparse::spgemm_symbolic[TPL_MKL," + Kokkos::ArithTraits::name() + "]"; \ + std::string label = "KokkosSparse::spgemm_symbolic[TPL_MKL," + KokkosKernels::ArithTraits::name() + "]"; \ Kokkos::Profiling::pushRegion(label); \ spgemm_symbolic_mkl(handle->get_spgemm_handle(), m, n, k, row_mapA, entriesA, row_mapB, entriesB, row_mapC); \ Kokkos::Profiling::popRegion(); \ diff --git a/sparse/tpls/KokkosSparse_spmv_bsrmatrix_tpl_spec_decl.hpp b/sparse/tpls/KokkosSparse_spmv_bsrmatrix_tpl_spec_decl.hpp index d9569a7ba0..9b9eab5b16 100644 --- a/sparse/tpls/KokkosSparse_spmv_bsrmatrix_tpl_spec_decl.hpp +++ b/sparse/tpls/KokkosSparse_spmv_bsrmatrix_tpl_spec_decl.hpp @@ -177,7 +177,7 @@ inline void spmv_mv_bsr_mkl(Handle* handle, sparse_operation_t op, Scalar alpha, \ static void spmv_bsrmatrix(const EXECSPACE&, Handle* handle, const char mode[], const coefficient_type& alpha, \ const AMatrix& A, const XVector& X, const coefficient_type& beta, const YVector& Y) { \ - std::string label = "KokkosSparse::spmv[TPL_MKL,BSRMATRIX," + Kokkos::ArithTraits::name() + "]"; \ + std::string label = "KokkosSparse::spmv[TPL_MKL,BSRMATRIX," + KokkosKernels::ArithTraits::name() + "]"; \ Kokkos::Profiling::pushRegion(label); \ spmv_bsr_mkl(handle, mode_kk_to_mkl(mode[0]), alpha, beta, A.numRows(), A.numCols(), A.blockDim(), \ A.graph.row_map.data(), A.graph.entries.data(), A.values.data(), X.data(), Y.data()); \ @@ -225,7 +225,7 @@ KOKKOSSPARSE_SPMV_MKL(Kokkos::complex, Kokkos::OpenMP) static void spmv_mv_bsrmatrix(const EXECSPACE&, Handle* handle, const char mode[], const coefficient_type& alpha, \ const AMatrix& A, const XVector& X, const coefficient_type& beta, \ const YVector& Y) { \ - std::string label = "KokkosSparse::spmv_mv[TPL_MKL,BSRMATRIX," + Kokkos::ArithTraits::name() + "]"; \ + std::string label = "KokkosSparse::spmv_mv[TPL_MKL,BSRMATRIX," + KokkosKernels::ArithTraits::name() + "]"; \ Kokkos::Profiling::pushRegion(label); \ MKL_INT colx = static_cast(X.extent(1)); \ MKL_INT ldx = static_cast(X.stride(1)); \ @@ -482,7 +482,7 @@ void spmv_mv_bsr_cusparse(const Kokkos::Cuda& exec, Handle* handle, const char m static void spmv_bsrmatrix(const Kokkos::Cuda& exec, Handle* handle, const char mode[], \ const coefficient_type& alpha, const AMatrix& A, const XVector& x, \ const coefficient_type& beta, const YVector& y) { \ - std::string label = "KokkosSparse::spmv[TPL_CUSPARSE,BSRMATRIX," + Kokkos::ArithTraits::name() + "]"; \ + std::string label = "KokkosSparse::spmv[TPL_CUSPARSE,BSRMATRIX," + KokkosKernels::ArithTraits::name() + "]"; \ Kokkos::Profiling::pushRegion(label); \ spmv_bsr_cusparse(exec, handle, mode, alpha, A, x, beta, y); \ Kokkos::Profiling::popRegion(); \ @@ -535,7 +535,7 @@ KOKKOSSPARSE_SPMV_CUSPARSE(Kokkos::complex, int, int, Kokkos::LayoutRight static void spmv_mv_bsrmatrix(const Kokkos::Cuda& exec, Handle* handle, const char mode[], \ const coefficient_type& alpha, const AMatrix& A, const XVector& x, \ const coefficient_type& beta, const YVector& y) { \ - std::string label = "KokkosSparse::spmv_mv[TPL_CUSPARSE,BSRMATRIX," + Kokkos::ArithTraits::name() + "]"; \ + std::string label = "KokkosSparse::spmv_mv[TPL_CUSPARSE,BSRMATRIX," + KokkosKernels::ArithTraits::name() + "]"; \ Kokkos::Profiling::pushRegion(label); \ spmv_mv_bsr_cusparse(exec, handle, mode, alpha, A, x, beta, y); \ Kokkos::Profiling::popRegion(); \ @@ -806,7 +806,7 @@ void spmv_bsr_rocsparse(const Kokkos::HIP& exec, Handle* handle, const char mode static void spmv_bsrmatrix(const Kokkos::HIP& exec, Handle* handle, const char mode[], \ const coefficient_type& alpha, const AMatrix& A, const XVector& x, \ const coefficient_type& beta, const YVector& y) { \ - std::string label = "KokkosSparse::spmv[TPL_ROCSPARSE,BSRMATRIX," + Kokkos::ArithTraits::name() + "]"; \ + std::string label = "KokkosSparse::spmv[TPL_ROCSPARSE,BSRMATRIX," + KokkosKernels::ArithTraits::name() + "]"; \ Kokkos::Profiling::pushRegion(label); \ spmv_bsr_rocsparse(exec, handle, mode, alpha, A, x, beta, y); \ Kokkos::Profiling::popRegion(); \ diff --git a/sparse/tpls/KokkosSparse_spmv_mv_tpl_spec_decl.hpp b/sparse/tpls/KokkosSparse_spmv_mv_tpl_spec_decl.hpp index b5f9ddf7c0..e036a302a3 100644 --- a/sparse/tpls/KokkosSparse_spmv_mv_tpl_spec_decl.hpp +++ b/sparse/tpls/KokkosSparse_spmv_mv_tpl_spec_decl.hpp @@ -217,7 +217,7 @@ void spmv_mv_cusparse(const Kokkos::Cuda &exec, Handle *handle, const char mode[ \ static void spmv_mv(const Kokkos::Cuda &exec, Handle *handle, const char mode[], const coefficient_type &alpha, \ const AMatrix &A, const XVector &x, const coefficient_type &beta, const YVector &y) { \ - std::string label = "KokkosSparse::spmv_mv[TPL_CUSPARSE," + Kokkos::ArithTraits::name() + "]"; \ + std::string label = "KokkosSparse::spmv_mv[TPL_CUSPARSE," + KokkosKernels::ArithTraits::name() + "]"; \ Kokkos::Profiling::pushRegion(label); \ spmv_mv_cusparse(exec, handle, mode, alpha, A, x, beta, y); \ Kokkos::Profiling::popRegion(); \ @@ -409,7 +409,7 @@ void spmv_mv_rocsparse(const Kokkos::HIP &exec, Handle *handle, const char mode[ \ static void spmv_mv(const Kokkos::HIP &exec, Handle *handle, const char mode[], const coefficient_type &alpha, \ const AMatrix &A, const XVector &x, const coefficient_type &beta, const YVector &y) { \ - std::string label = "KokkosSparse::spmv_mv[TPL_ROCSPARSE," + Kokkos::ArithTraits::name() + "]"; \ + std::string label = "KokkosSparse::spmv_mv[TPL_ROCSPARSE," + KokkosKernels::ArithTraits::name() + "]"; \ Kokkos::Profiling::pushRegion(label); \ spmv_mv_rocsparse(exec, handle, mode, alpha, A, x, beta, y); \ Kokkos::Profiling::popRegion(); \ diff --git a/sparse/tpls/KokkosSparse_spmv_tpl_spec_decl.hpp b/sparse/tpls/KokkosSparse_spmv_tpl_spec_decl.hpp index 94abd043fa..42201ecf2c 100644 --- a/sparse/tpls/KokkosSparse_spmv_tpl_spec_decl.hpp +++ b/sparse/tpls/KokkosSparse_spmv_tpl_spec_decl.hpp @@ -54,7 +54,7 @@ void spmv_cusparse(const Kokkos::Cuda& exec, Handle* handle, const char mode[], } // cuSPARSE doesn't directly support mode H with real values, but this is // equivalent to mode T - if (myCusparseOperation == CUSPARSE_OPERATION_CONJUGATE_TRANSPOSE && !Kokkos::ArithTraits::isComplex) + if (myCusparseOperation == CUSPARSE_OPERATION_CONJUGATE_TRANSPOSE && !KokkosKernels::ArithTraits::isComplex) myCusparseOperation = CUSPARSE_OPERATION_TRANSPOSE; // Hopefully this corresponds to CUDA reelase 10.1, which is the first to @@ -217,7 +217,7 @@ void spmv_cusparse(const Kokkos::Cuda& exec, Handle* handle, const char mode[], \ static void spmv(const Kokkos::Cuda& exec, Handle* handle, const char mode[], const coefficient_type& alpha, \ const AMatrix& A, const XVector& x, const coefficient_type& beta, const YVector& y) { \ - std::string label = "KokkosSparse::spmv[TPL_CUSPARSE," + Kokkos::ArithTraits::name() + "]"; \ + std::string label = "KokkosSparse::spmv[TPL_CUSPARSE," + KokkosKernels::ArithTraits::name() + "]"; \ Kokkos::Profiling::pushRegion(label); \ spmv_cusparse(exec, handle, mode, alpha, A, x, beta, y); \ Kokkos::Profiling::popRegion(); \ @@ -408,7 +408,7 @@ void spmv_rocsparse(const Kokkos::HIP& exec, Handle* handle, const char mode[], \ static void spmv(const Kokkos::HIP& exec, Handle* handle, const char mode[], const coefficient_type& alpha, \ const AMatrix& A, const XVector& x, const coefficient_type& beta, const YVector& y) { \ - std::string label = "KokkosSparse::spmv[TPL_ROCSPARSE," + Kokkos::ArithTraits::name() + "]"; \ + std::string label = "KokkosSparse::spmv[TPL_ROCSPARSE," + KokkosKernels::ArithTraits::name() + "]"; \ Kokkos::Profiling::pushRegion(label); \ spmv_rocsparse(exec, handle, mode, alpha, A, x, beta, y); \ Kokkos::Profiling::popRegion(); \ @@ -525,7 +525,7 @@ inline void spmv_mkl(Handle* handle, sparse_operation_t op, Scalar alpha, Scalar \ static void spmv(const EXECSPACE&, Handle* handle, const char mode[], const coefficient_type& alpha, \ const AMatrix& A, const XVector& x, const coefficient_type& beta, const YVector& y) { \ - std::string label = "KokkosSparse::spmv[TPL_MKL," + Kokkos::ArithTraits::name() + "]"; \ + std::string label = "KokkosSparse::spmv[TPL_MKL," + KokkosKernels::ArithTraits::name() + "]"; \ Kokkos::Profiling::pushRegion(label); \ spmv_mkl(handle, mode_kk_to_mkl(mode[0]), alpha, beta, A.numRows(), A.numCols(), A.graph.row_map.data(), \ A.graph.entries.data(), A.values.data(), x.data(), y.data()); \ @@ -571,7 +571,7 @@ inline void spmv_onemkl(const execution_space& exec, Handle* handle, oneapi::mkl // oneAPI doesn't directly support mode H with real values, but this is // equivalent to mode T - if (mkl_mode == oneapi::mkl::transpose::conjtrans && !Kokkos::ArithTraits::isComplex) + if (mkl_mode == oneapi::mkl::transpose::conjtrans && !KokkosKernels::ArithTraits::isComplex) mkl_mode = oneapi::mkl::transpose::trans; OneMKL_SpMV_Data* subhandle; @@ -627,7 +627,7 @@ inline void spmv_onemkl(const execution_space& exec, Handle* handle, oneapi::mkl \ static void spmv(const execution_space& exec, Handle* handle, const char mode[], const coefficient_type& alpha, \ const AMatrix& A, const XVector& x, const coefficient_type& beta, const YVector& y) { \ - std::string label = "KokkosSparse::spmv[TPL_ONEMKL," + Kokkos::ArithTraits::name() + "]"; \ + std::string label = "KokkosSparse::spmv[TPL_ONEMKL," + KokkosKernels::ArithTraits::name() + "]"; \ Kokkos::Profiling::pushRegion(label); \ oneapi::mkl::transpose mkl_mode = mode_kk_to_onemkl(mode[0]); \ spmv_onemkl(exec, handle, mkl_mode, alpha, A, x, beta, y); \ diff --git a/sparse/unit_test/Test_Sparse_CrsMatrix.hpp b/sparse/unit_test/Test_Sparse_CrsMatrix.hpp index 3dc3b644ea..997c701189 100644 --- a/sparse/unit_test/Test_Sparse_CrsMatrix.hpp +++ b/sparse/unit_test/Test_Sparse_CrsMatrix.hpp @@ -147,7 +147,7 @@ void testCrsMatrixRawConstructor() { std::vector entries = {3, 4, 0, 1, 2, 2, 0, 3, 4}; std::vector values; for (size_type i = 0; i < nnz; i++) - values.push_back(Kokkos::ArithTraits::one() * (1.0 * rand() / RAND_MAX)); + values.push_back(KokkosKernels::ArithTraits::one() * (1.0 * rand() / RAND_MAX)); KokkosSparse::CrsMatrix A("A", nrows, ncols, nnz, values.data(), rowmap.data(), entries.data()); EXPECT_EQ(A.numRows(), nrows); diff --git a/sparse/unit_test/Test_Sparse_Utils.hpp b/sparse/unit_test/Test_Sparse_Utils.hpp index 870aedae7c..ec6aadfaa8 100644 --- a/sparse/unit_test/Test_Sparse_Utils.hpp +++ b/sparse/unit_test/Test_Sparse_Utils.hpp @@ -110,7 +110,7 @@ bool is_same_matrix(crsMat_t output_mat_actual, crsMat_t output_mat_reference) { return false; } - typedef typename Kokkos::ArithTraits::mag_type eps_type; + typedef typename KokkosKernels::ArithTraits::mag_type eps_type; eps_type eps = std::is_same::value ? 3.7e-3 : 1e-7; is_identical = KokkosKernels::Impl::kk_is_relatively_identical_view::one()) { + typename mtx_t::value_type omega = KokkosKernels::ArithTraits::one()) { typedef typename mtx_t::StaticCrsGraphType graph_t; typedef typename graph_t::row_map_type lno_view_t; typedef typename graph_t::entries_type lno_nnz_view_t; @@ -141,7 +141,7 @@ void test_block_gauss_seidel_rank1(lno_t numRows, size_type nnz, lno_t bandwidth typedef typename crsMat_t::values_type::non_const_type scalar_view_t; typedef typename crsMat_t::StaticCrsGraphType::row_map_type::non_const_type lno_view_t; typedef typename crsMat_t::StaticCrsGraphType::entries_type::non_const_type lno_nnz_view_t; - typedef typename Kokkos::ArithTraits::mag_type mag_t; + typedef typename KokkosKernels::ArithTraits::mag_type mag_t; lno_t numCols = numRows; @@ -219,7 +219,7 @@ void test_block_gauss_seidel_rank2(lno_t numRows, size_type nnz, lno_t bandwidth typedef typename crsMat_t::StaticCrsGraphType::row_map_type::non_const_type lno_view_t; typedef typename crsMat_t::StaticCrsGraphType::entries_type::non_const_type lno_nnz_view_t; typedef Kokkos::View scalar_view2d_t; - typedef typename Kokkos::ArithTraits::mag_type mag_t; + typedef typename KokkosKernels::ArithTraits::mag_type mag_t; lno_t numCols = numRows; @@ -261,7 +261,7 @@ void test_block_gauss_seidel_rank2(lno_t numRows, size_type nnz, lno_t bandwidth for (lno_t j = 0; j < nv; j++) { sum += solution_host(j, i) * solution_host(j, i); } - initial_norms[i] = Kokkos::ArithTraits::sqrt(Kokkos::ArithTraits::abs(sum)); + initial_norms[i] = KokkosKernels::ArithTraits::sqrt(KokkosKernels::ArithTraits::abs(sum)); } for (const auto gs_algorithm : params.gs_algorithms) { @@ -291,7 +291,7 @@ void test_block_gauss_seidel_rank2(lno_t numRows, size_type nnz, lno_t bandwidth scalar_t diff = x_host(r, c) - solution_host(r, c); sum += diff * diff; } - mag_t result_res = Kokkos::ArithTraits::sqrt(Kokkos::ArithTraits::abs(sum)); + mag_t result_res = KokkosKernels::ArithTraits::sqrt(KokkosKernels::ArithTraits::abs(sum)); EXPECT_LT(result_res, params.tolerance * initial_norms[c]); } } diff --git a/sparse/unit_test/Test_Sparse_bspgemm.hpp b/sparse/unit_test/Test_Sparse_bspgemm.hpp index f5314e516d..221ba68028 100644 --- a/sparse/unit_test/Test_Sparse_bspgemm.hpp +++ b/sparse/unit_test/Test_Sparse_bspgemm.hpp @@ -117,7 +117,7 @@ bool is_same_block_matrix(bsrMat_t output_mat_actual, bsrMat_t output_mat_refere return false; } - typedef typename Kokkos::ArithTraits::mag_type eps_type; + typedef typename KokkosKernels::ArithTraits::mag_type eps_type; eps_type eps = std::is_same::value ? 3e-2 : 5e-7; is_identical = KokkosKernels::Impl::kk_is_relatively_identical_view void check_crs_matrix(CrsType crsMat, RowType row, ColType col, DataType data, std::string failure_info = "no failure information!") { using value_type = typename DataType::value_type; - using ats = Kokkos::ArithTraits; + using ats = KokkosKernels::ArithTraits; // Copy coo to host typename RowType::host_mirror_type row_h = Kokkos::create_mirror_view(row); diff --git a/sparse/unit_test/Test_Sparse_extractCrsDiagonalBlocksRCB.hpp b/sparse/unit_test/Test_Sparse_extractCrsDiagonalBlocksRCB.hpp index e1e3f975df..cab0878122 100644 --- a/sparse/unit_test/Test_Sparse_extractCrsDiagonalBlocksRCB.hpp +++ b/sparse/unit_test/Test_Sparse_extractCrsDiagonalBlocksRCB.hpp @@ -63,7 +63,7 @@ void run_test_extract_diagonal_blocks_rcb(lno_t n_pts_per_dim, lno_t nblocks) { using RowMapType = Kokkos::View; using EntriesType = Kokkos::View; using ValuesType = Kokkos::View; - using magnitude_t = typename Kokkos::ArithTraits::mag_type; + using magnitude_t = typename KokkosKernels::ArithTraits::mag_type; using CoorsViewType = Kokkos::View; using PermViewType = Kokkos::View; using CoorsViewType_hm = typename CoorsViewType::host_mirror_type; diff --git a/sparse/unit_test/Test_Sparse_gauss_seidel.hpp b/sparse/unit_test/Test_Sparse_gauss_seidel.hpp index 1250e78398..e5ac8b2c14 100644 --- a/sparse/unit_test/Test_Sparse_gauss_seidel.hpp +++ b/sparse/unit_test/Test_Sparse_gauss_seidel.hpp @@ -123,7 +123,7 @@ void run_gauss_seidel(crsMat_t input_mat, GSAlgorithm gs_algorithm, vec_t x_vect kh.set_gs_twostage(!classic, input_mat.numRows()); if (classic) { // two-stage with SpTRSV supports only omega = one - omega = Kokkos::ArithTraits::one(); + omega = KokkosKernels::ArithTraits::one(); } } else { kh.create_gs_handle(GS_DEFAULT, coloringAlgo); @@ -182,7 +182,7 @@ void test_gauss_seidel_rank1(lno_t numRows, size_type nnz, lno_t bandwidth, lno_ using namespace Test; typedef typename KokkosSparse::CrsMatrix crsMat_t; typedef typename crsMat_t::values_type::non_const_type scalar_view_t; - typedef typename Kokkos::ArithTraits::mag_type mag_t; + typedef typename KokkosKernels::ArithTraits::mag_type mag_t; srand(245); lno_t numCols = numRows; crsMat_t input_mat = KokkosSparse::Impl::kk_generate_diagonally_dominant_sparse_matrix( @@ -202,8 +202,8 @@ void test_gauss_seidel_rank1(lno_t numRows, size_type nnz, lno_t bandwidth, lno_ // which is why we just test GS_DEFAULT. int apply_count = 3; // test symmetric, forward, backward scalar_view_t x_vector(Kokkos::view_alloc(Kokkos::WithoutInitializing, "x vector"), nv); - const scalar_t one = Kokkos::ArithTraits::one(); - const scalar_t zero = Kokkos::ArithTraits::zero(); + const scalar_t one = KokkosKernels::ArithTraits::one(); + const scalar_t zero = KokkosKernels::ArithTraits::zero(); //*** Point-coloring version **** for (int apply_type = 0; apply_type < apply_count; ++apply_type) { Kokkos::Timer timer1; @@ -258,7 +258,7 @@ void test_gauss_seidel_rank2(lno_t numRows, size_type nnz, lno_t bandwidth, lno_ typedef typename KokkosSparse::CrsMatrix crsMat_t; typedef Kokkos::View scalar_view2d_t; typedef Kokkos::View host_scalar_view2d_t; - typedef typename Kokkos::ArithTraits::mag_type mag_t; + typedef typename KokkosKernels::ArithTraits::mag_type mag_t; lno_t numCols = numRows; crsMat_t input_mat = KokkosSparse::Impl::kk_generate_diagonally_dominant_sparse_matrix( @@ -281,10 +281,10 @@ void test_gauss_seidel_rank2(lno_t numRows, size_type nnz, lno_t bandwidth, lno_ for (lno_t j = 0; j < nv; j++) { sum += solution_x(j, i) * solution_x(j, i); } - initial_norms[i] = Kokkos::ArithTraits::sqrt(Kokkos::ArithTraits::abs(sum)); + initial_norms[i] = KokkosKernels::ArithTraits::sqrt(KokkosKernels::ArithTraits::abs(sum)); } int apply_count = 3; // test symmetric, forward, backward - const scalar_t zero = Kokkos::ArithTraits::zero(); + const scalar_t zero = KokkosKernels::ArithTraits::zero(); //*** Point-coloring version **** for (int apply_type = 0; apply_type < apply_count; ++apply_type) { Kokkos::Timer timer1; @@ -298,7 +298,7 @@ void test_gauss_seidel_rank2(lno_t numRows, size_type nnz, lno_t bandwidth, lno_ scalar_t diff = x_host(j, i) - solution_x(j, i); diffDot += diff * diff; } - mag_t res = Kokkos::ArithTraits::sqrt(Kokkos::ArithTraits::abs(diffDot)); + mag_t res = KokkosKernels::ArithTraits::sqrt(KokkosKernels::ArithTraits::abs(diffDot)); EXPECT_LT(res, initial_norms[i]); } } @@ -319,7 +319,7 @@ void test_gauss_seidel_rank2(lno_t numRows, size_type nnz, lno_t bandwidth, lno_ scalar_t diff = x_host(j, i) - solution_x(j, i); diffDot += diff * diff; } - mag_t res = Kokkos::ArithTraits::sqrt(Kokkos::ArithTraits::abs(diffDot)); + mag_t res = KokkosKernels::ArithTraits::sqrt(KokkosKernels::ArithTraits::abs(diffDot)); EXPECT_LT(res, initial_norms[i]); } } @@ -337,7 +337,7 @@ void test_gauss_seidel_rank2(lno_t numRows, size_type nnz, lno_t bandwidth, lno_ scalar_t diff = x_host(j, i) - solution_x(j, i); diffDot += diff * diff; } - mag_t res = Kokkos::ArithTraits::sqrt(Kokkos::ArithTraits::abs(diffDot)); + mag_t res = KokkosKernels::ArithTraits::sqrt(KokkosKernels::ArithTraits::abs(diffDot)); EXPECT_LT(res, initial_norms[i]); } } @@ -353,7 +353,7 @@ void test_gauss_seidel_rank2(lno_t numRows, size_type nnz, lno_t bandwidth, lno_ scalar_t diff = x_host(j, i) - solution_x(j, i); diffDot += diff * diff; } - mag_t res = Kokkos::ArithTraits::sqrt(Kokkos::ArithTraits::abs(diffDot)); + mag_t res = KokkosKernels::ArithTraits::sqrt(KokkosKernels::ArithTraits::abs(diffDot)); EXPECT_LT(res, initial_norms[i]); } } @@ -361,8 +361,8 @@ void test_gauss_seidel_rank2(lno_t numRows, size_type nnz, lno_t bandwidth, lno_ template void test_sequential_sor(lno_t numRows, size_type nnz, lno_t bandwidth, lno_t row_size_variance) { - const scalar_t zero = Kokkos::ArithTraits::zero(); - const scalar_t one = Kokkos::ArithTraits::one(); + const scalar_t zero = KokkosKernels::ArithTraits::zero(); + const scalar_t one = KokkosKernels::ArithTraits::one(); srand(245); typedef typename device::execution_space exec_space; typedef typename KokkosSparse::CrsMatrix crsMat_t; @@ -413,7 +413,7 @@ void test_sequential_sor(lno_t numRows, size_type nnz, lno_t bandwidth, lno_t ro // Check against gold solution scalar_t xSq = KokkosBlas::dot(x, x); scalar_t solnDot = KokkosBlas::dot(x, xgold); - double scaledSolutionDot = Kokkos::ArithTraits::abs(solnDot / xSq); + double scaledSolutionDot = KokkosKernels::ArithTraits::abs(solnDot / xSq); EXPECT_TRUE(0.99 < scaledSolutionDot); } @@ -508,8 +508,8 @@ void test_gauss_seidel_long_rows(lno_t numRows, lno_t numLongRows, lno_t nnzPerS typedef typename crsMat_t::values_type::non_const_type scalar_view_t; typedef typename crsMat_t::index_type::non_const_type entries_view_t; typedef typename crsMat_t::row_map_type::non_const_type rowmap_view_t; - typedef typename Kokkos::ArithTraits::mag_type mag_t; - const scalar_t one = Kokkos::ArithTraits::one(); + typedef typename KokkosKernels::ArithTraits::mag_type mag_t; + const scalar_t one = KokkosKernels::ArithTraits::one(); srand(245); std::vector rowmap = {0}; std::vector entries; @@ -588,8 +588,8 @@ void test_gauss_seidel_custom_coloring(lno_t numRows, lno_t nnzPerRow) { using namespace Test; typedef typename KokkosSparse::CrsMatrix crsMat_t; typedef typename crsMat_t::values_type::non_const_type scalar_view_t; - typedef typename Kokkos::ArithTraits::mag_type mag_t; - const scalar_t one = Kokkos::ArithTraits::one(); + typedef typename KokkosKernels::ArithTraits::mag_type mag_t; + const scalar_t one = KokkosKernels::ArithTraits::one(); size_type nnz = nnzPerRow * numRows; crsMat_t input_mat = KokkosSparse::Impl::kk_generate_diagonally_dominant_sparse_matrix( numRows, numRows, nnz, 0, numRows / 10, 2.0 * one); @@ -623,7 +623,7 @@ void test_gauss_seidel_streams_rank1(lno_t numRows, size_type nnz, lno_t bandwid using namespace Test; using crsMat_t = typename KokkosSparse::CrsMatrix; using scalar_view_t = typename crsMat_t::values_type::non_const_type; - using mag_t = typename Kokkos::ArithTraits::mag_type; + using mag_t = typename KokkosKernels::ArithTraits::mag_type; using execution_space = typename device::execution_space; using const_size_type = const size_type; @@ -656,8 +656,8 @@ void test_gauss_seidel_streams_rank1(lno_t numRows, size_type nnz, lno_t bandwid std::vector y_vector_v(nstreams); std::vector initial_norm_res_v(nstreams); - const scalar_t one = Kokkos::ArithTraits::one(); - const scalar_t zero = Kokkos::ArithTraits::zero(); + const scalar_t one = KokkosKernels::ArithTraits::one(); + const scalar_t zero = KokkosKernels::ArithTraits::zero(); for (int i = 0; i < nstreams; i++) { input_mat_v[i] = KokkosSparse::Impl::kk_generate_diagonally_dominant_sparse_matrix( diff --git a/sparse/unit_test/Test_Sparse_gmres.hpp b/sparse/unit_test/Test_Sparse_gmres.hpp index 7b55fe41ce..8fa45fc9f6 100644 --- a/sparse/unit_test/Test_Sparse_gmres.hpp +++ b/sparse/unit_test/Test_Sparse_gmres.hpp @@ -78,7 +78,7 @@ struct GmresTest { using RowMapType = Kokkos::View; using EntriesType = Kokkos::View; using ValuesType = Kokkos::View; - using AT = Kokkos::ArithTraits; + using AT = KokkosKernels::ArithTraits; using exe_space = typename device::execution_space; using mem_space = typename device::memory_space; @@ -87,7 +87,7 @@ struct GmresTest { using KernelHandle = KokkosKernels::Experimental::KokkosKernelsHandle; - using float_t = typename Kokkos::ArithTraits::mag_type; + using float_t = typename KokkosKernels::ArithTraits::mag_type; template static void run_test_gmres() { diff --git a/sparse/unit_test/Test_Sparse_mdf.hpp b/sparse/unit_test/Test_Sparse_mdf.hpp index 3e5c4a7b60..459d93c4c5 100644 --- a/sparse/unit_test/Test_Sparse_mdf.hpp +++ b/sparse/unit_test/Test_Sparse_mdf.hpp @@ -116,7 +116,7 @@ void run_test_mdf() { } for (int idx = 0; idx < 40; ++idx) { EXPECT_TRUE(entries_U_ref[idx] == entries_U(idx)) << "entries_U(" << idx << ") is wrong!"; - EXPECT_NEAR_KK(values_U_ref[idx], values_U(idx), 10 * Kokkos::ArithTraits::eps(), + EXPECT_NEAR_KK(values_U_ref[idx], values_U(idx), 10 * KokkosKernels::ArithTraits::eps(), "An entry in U.values is wrong!"); } @@ -143,7 +143,7 @@ void run_test_mdf() { EXPECT_TRUE(entries_L_ref[idx] == entries_L(idx)) << "entries_L(" << idx << ")=" << entries_L(idx) << " is wrong, entries_L_ref[" << idx << "]=" << entries_L_ref[idx] << "!"; - EXPECT_NEAR_KK(values_L_ref[idx], values_L(idx), 10 * Kokkos::ArithTraits::eps(), + EXPECT_NEAR_KK(values_L_ref[idx], values_L(idx), 10 * KokkosKernels::ArithTraits::eps(), "An entry in L.values is wrong!"); } } diff --git a/sparse/unit_test/Test_Sparse_par_ilut.hpp b/sparse/unit_test/Test_Sparse_par_ilut.hpp index 7392e063ea..6d1499914f 100644 --- a/sparse/unit_test/Test_Sparse_par_ilut.hpp +++ b/sparse/unit_test/Test_Sparse_par_ilut.hpp @@ -186,7 +186,7 @@ void run_test_par_ilut_precond() { using sp_matrix_type = KokkosSparse::CrsMatrix; using KernelHandle = KokkosKernels::Experimental::KokkosKernelsHandle; - using float_t = typename Kokkos::ArithTraits::mag_type; + using float_t = typename KokkosKernels::ArithTraits::mag_type; // Create a diagonally dominant sparse matrix to test: // par_ilut settings max_iters, res_delta_stop, fill_in_limit, and diff --git a/sparse/unit_test/Test_Sparse_removeCrsMatrixZeros.hpp b/sparse/unit_test/Test_Sparse_removeCrsMatrixZeros.hpp index dc2d199f09..c51bd43b58 100644 --- a/sparse/unit_test/Test_Sparse_removeCrsMatrixZeros.hpp +++ b/sparse/unit_test/Test_Sparse_removeCrsMatrixZeros.hpp @@ -34,7 +34,7 @@ Matrix removeMatrixZerosReference(const Matrix& A) { using Offset = typename Matrix::non_const_size_type; using Ordinal = typename Matrix::ordinal_type; using Scalar = typename Matrix::value_type; - using KAT = Kokkos::ArithTraits; + using KAT = KokkosKernels::ArithTraits; auto rowmapHost = Kokkos::create_mirror_view_and_copy(Kokkos::HostSpace(), A.graph.row_map); auto entriesHost = Kokkos::create_mirror_view_and_copy(Kokkos::HostSpace(), A.graph.entries); auto valuesHost = Kokkos::create_mirror_view_and_copy(Kokkos::HostSpace(), A.values); diff --git a/sparse/unit_test/Test_Sparse_replaceSumInto.hpp b/sparse/unit_test/Test_Sparse_replaceSumInto.hpp index d0420014d9..f8b857b8ba 100644 --- a/sparse/unit_test/Test_Sparse_replaceSumInto.hpp +++ b/sparse/unit_test/Test_Sparse_replaceSumInto.hpp @@ -44,7 +44,7 @@ class ModifyEvenNumberedRows { ordinal_type cols[1]; value_type vals[1]; - const value_type ONE = Kokkos::ArithTraits::one(); + const value_type ONE = KokkosKernels::ArithTraits::one(); const value_type THREE = ONE + ONE + ONE; cols[0] = lclRow; @@ -84,7 +84,7 @@ bool checkWhetherEvenNumberedRowsWereModified(const CrsMatrixType& A, const bool typedef typename CrsMatrixType::value_type SC; typedef typename CrsMatrixType::ordinal_type LO; - const SC ONE = Kokkos::ArithTraits::one(); + const SC ONE = KokkosKernels::ArithTraits::one(); const SC TWO = ONE + ONE; const SC THREE = ONE + ONE + ONE; @@ -120,7 +120,7 @@ template void testOneCase(bool& /*success*/, // Teuchos::FancyOStream& out, std::ostream& out, const CrsMatrixType& A, const bool replace, const bool sorted, const bool atomic) { - using Kokkos::ArithTraits; + using KokkosKernels::ArithTraits; typedef typename CrsMatrixType::value_type value_type; // Teuchos::OSTab tab0 (out); diff --git a/sparse/unit_test/Test_Sparse_replaceSumIntoLonger.hpp b/sparse/unit_test/Test_Sparse_replaceSumIntoLonger.hpp index 5a024a8487..c1725ee3ee 100644 --- a/sparse/unit_test/Test_Sparse_replaceSumIntoLonger.hpp +++ b/sparse/unit_test/Test_Sparse_replaceSumIntoLonger.hpp @@ -45,7 +45,7 @@ class ModifyEntries { : A_(A), replace_(replace), sorted_(sorted), atomic_(atomic) {} KOKKOS_FUNCTION void operator()(const ordinal_type& lclRow, ordinal_type& numModified) const { - typedef Kokkos::ArithTraits KAT; + typedef KokkosKernels::ArithTraits KAT; typedef typename KAT::mag_type mag_type; const scalar_type ONE = KAT::one(); @@ -161,7 +161,7 @@ void checkWhetherEntriesWereModified(bool& success, std::ostream& outRef, // using Teuchos::RCP; typedef typename CrsMatrixType::value_type value_type; typedef typename CrsMatrixType::ordinal_type ordinal_type; - typedef Kokkos::ArithTraits KAT; + typedef KokkosKernels::ArithTraits KAT; // If debug is false, we capture all output in an // std::ostringstream, and don't print it unless the test fails @@ -265,7 +265,7 @@ void testOneCaseImpl(bool& /*success*/, std::ostream& out, // Restore original values. auto val_h = Kokkos::create_mirror_view(A.values); - const scalar_type ONE = Kokkos::ArithTraits::one(); + const scalar_type ONE = KokkosKernels::ArithTraits::one(); scalar_type curVal = ONE; for (ordinal_type k = 0; k < A.numCols(); ++k, curVal += ONE) { val_h[k] = curVal; @@ -362,7 +362,7 @@ void testAllSizes(bool& success, typedef typename matrix_type::value_type value_type; typedef typename matrix_type::ordinal_type ordinal_type; typedef typename matrix_type::size_type size_type; - const value_type ONE = Kokkos::ArithTraits::one(); + const value_type ONE = KokkosKernels::ArithTraits::one(); // Teuchos::OSTab tab0 (out); out << "maxNumEnt: " << maxNumEnt << endl; diff --git a/sparse/unit_test/Test_Sparse_spadd.hpp b/sparse/unit_test/Test_Sparse_spadd.hpp index dcd63f1a52..301e48e738 100644 --- a/sparse/unit_test/Test_Sparse_spadd.hpp +++ b/sparse/unit_test/Test_Sparse_spadd.hpp @@ -46,7 +46,7 @@ crsMat_t randomMatrix(ordinal_type nrows, ordinal_type ncols, ordinal_type minNN typedef typename size_type_view_t::non_const_value_type size_type; // rowptr type typedef typename lno_view_t::non_const_value_type lno_t; // colind type typedef typename scalar_view_t::non_const_value_type scalar_t; - typedef Kokkos::ArithTraits KAT; + typedef KokkosKernels::ArithTraits KAT; static_assert(std::is_same::value, "ordinal_type should be same as lno_t from crsMat_t"); // first, populate rowmap size_type_view_t rowmap("rowmap", nrows + 1); @@ -96,7 +96,7 @@ template void test_spadd(lno_t numRows, lno_t numCols, size_type minNNZ, size_type maxNNZ, bool sortRows) { typedef typename KokkosSparse::CrsMatrix crsMat_t; - typedef Kokkos::ArithTraits KAT; + typedef KokkosKernels::ArithTraits KAT; typedef typename KAT::mag_type magnitude_t; typedef typename crsMat_t::row_map_type::non_const_type row_map_type; typedef typename crsMat_t::index_type::non_const_type entries_type; @@ -194,7 +194,7 @@ void test_spadd_known_columns() { using row_map_type = typename crsMat_t::row_map_type::non_const_type; using entries_type = typename crsMat_t::index_type::non_const_type; using values_type = typename crsMat_t::values_type::non_const_type; - using KAT = Kokkos::ArithTraits; + using KAT = KokkosKernels::ArithTraits; using KernelHandle = typename KokkosKernels::Experimental::KokkosKernelsHandle< size_type, lno_t, scalar_t, typename Device::execution_space, typename Device::memory_space, typename Device::memory_space>; diff --git a/sparse/unit_test/Test_Sparse_spgemm_jacobi.hpp b/sparse/unit_test/Test_Sparse_spgemm_jacobi.hpp index 6861130b29..28a92963c2 100644 --- a/sparse/unit_test/Test_Sparse_spgemm_jacobi.hpp +++ b/sparse/unit_test/Test_Sparse_spgemm_jacobi.hpp @@ -154,7 +154,7 @@ bool is_same_mat(crsMat_t output_mat1, crsMat_t output_mat2) { return false; } - typedef typename Kokkos::ArithTraits::mag_type eps_type; + typedef typename KokkosKernels::ArithTraits::mag_type eps_type; eps_type eps = std::is_same::value ? 2 * 1e-3 : 1e-7; is_identical = KokkosKernels::Impl::kk_is_relatively_identical_view; using EntriesType = Kokkos::View; using ValuesType = Kokkos::View; - using AT = Kokkos::ArithTraits; - using mag_t = typename Kokkos::ArithTraits::mag_type; + using AT = KokkosKernels::ArithTraits; + using mag_t = typename KokkosKernels::ArithTraits::mag_type; using RowMapType_hostmirror = typename RowMapType::host_mirror_type; using EntriesType_hostmirror = typename EntriesType::host_mirror_type; diff --git a/sparse/unit_test/Test_Sparse_spmv.hpp b/sparse/unit_test/Test_Sparse_spmv.hpp index b2009027cb..3113c9c4e2 100644 --- a/sparse/unit_test/Test_Sparse_spmv.hpp +++ b/sparse/unit_test/Test_Sparse_spmv.hpp @@ -67,8 +67,8 @@ namespace Test { template struct fSPMV { using value_type = int; - using AT = Kokkos::ArithTraits; - using ATM = Kokkos::ArithTraits; + using AT = KokkosKernels::ArithTraits; + using ATM = KokkosKernels::ArithTraits; using mag_type = typename AT::mag_type; VectorType0 expected_y; @@ -116,7 +116,7 @@ void sequential_spmv(crsMat_t input_mat, x_vector_type x, y_vector_type y, using size_type = typename size_type_view_t::non_const_value_type; using lno_t = typename lno_view_t::non_const_value_type; using scalar_t = typename scalar_view_t::non_const_value_type; - using KAT = Kokkos::ArithTraits; + using KAT = KokkosKernels::ArithTraits; typename scalar_view_t::host_mirror_type h_values = Kokkos::create_mirror_view(input_mat.values); Kokkos::deep_copy(h_values, input_mat.values); @@ -169,16 +169,16 @@ template ::mag_type max_val) { + typename KokkosKernels::ArithTraits::mag_type max_val) { EXPECT_TRUE(mode.size() == 1); using ExecSpace = typename crsMat_t::execution_space; using my_exec_space = Kokkos::RangePolicy; using y_value_type = typename y_vector_type::non_const_value_type; - using y_value_trait = Kokkos::ArithTraits; + using y_value_trait = KokkosKernels::ArithTraits; using y_value_mag_type = typename y_value_trait::mag_type; - const y_value_mag_type eps = 10 * Kokkos::ArithTraits::eps(); + const y_value_mag_type eps = 10 * KokkosKernels::ArithTraits::eps(); y_vector_type expected_y("expected_y", y.extent(0)); Kokkos::deep_copy(expected_y, y); @@ -208,19 +208,19 @@ template ::mag_type max_val) { + typename KokkosKernels::ArithTraits::mag_type max_val) { EXPECT_TRUE(mode.size() == 1); using ExecSpace = typename crsMat_t::execution_space; using my_exec_space = Kokkos::RangePolicy; using y_value_type = typename y_vector_type::non_const_value_type; - using y_value_trait = Kokkos::ArithTraits; + using y_value_trait = KokkosKernels::ArithTraits; using y_value_mag_type = typename y_value_trait::mag_type; // y is the quantity being tested here, // so let us use y_value_type to determine // the appropriate tolerance precision. - const y_value_mag_type eps = 10 * Kokkos::ArithTraits::eps(); + const y_value_mag_type eps = 10 * KokkosKernels::ArithTraits::eps(); Kokkos::deep_copy(expected_y, y); @@ -261,17 +261,17 @@ void check_spmv_struct(const crsMat_t input_mat, const int stencil_type, const Kokkos::View structure, x_vector_type x, y_vector_type y, typename y_vector_type::non_const_value_type alpha, typename y_vector_type::non_const_value_type beta, - typename Kokkos::ArithTraits::mag_type max_val) { + typename KokkosKernels::ArithTraits::mag_type max_val) { using ExecSpace = typename crsMat_t::execution_space; using my_exec_space = Kokkos::RangePolicy; using y_value_type = typename y_vector_type::non_const_value_type; - using y_value_trait = Kokkos::ArithTraits; + using y_value_trait = KokkosKernels::ArithTraits; using y_value_mag_type = typename y_value_trait::mag_type; // y is the quantity being tested here, // so let us use y_value_type to determine // the appropriate tolerance precision. - const double eps = Kokkos::ArithTraits::eps(); + const double eps = KokkosKernels::ArithTraits::eps(); const size_t nr = input_mat.numRows(); y_vector_type expected_y("expected", nr); Kokkos::deep_copy(expected_y, y); @@ -298,17 +298,17 @@ void check_spmv_mv_struct(const crsMat_t input_mat, const int stencil_type, x_vector_type x, y_vector_type y, y_vector_type expected_y, typename y_vector_type::non_const_value_type alpha, typename y_vector_type::non_const_value_type beta, int numMV, - typename Kokkos::ArithTraits::mag_type max_val) { + typename KokkosKernels::ArithTraits::mag_type max_val) { using ExecSpace = typename crsMat_t::execution_space; using my_exec_space = Kokkos::RangePolicy; using y_value_type = typename y_vector_type::non_const_value_type; - using y_value_trait = Kokkos::ArithTraits; + using y_value_trait = KokkosKernels::ArithTraits; using y_value_mag_type = typename y_value_trait::mag_type; // y is the quantity being tested here, // so let us use y_value_type to determine // the appropriate tolerance precision. - const double eps = Kokkos::ArithTraits::eps(); + const double eps = KokkosKernels::ArithTraits::eps(); Kokkos::deep_copy(expected_y, y); Kokkos::fence(); @@ -358,7 +358,7 @@ void test_spmv(KokkosSparse::SPMVAlgorithm algo, lno_t numRows, size_type nnz, l using scalar_view_t = typename crsMat_t::values_type::non_const_type; using x_vector_type = scalar_view_t; using y_vector_type = scalar_view_t; - using mag_t = typename Kokkos::ArithTraits::mag_type; + using mag_t = typename KokkosKernels::ArithTraits::mag_type; using handle_t = KokkosSparse::SPMVHandle; using y_policy = Kokkos::RangePolicy; @@ -461,7 +461,7 @@ void test_spmv_algorithms(lno_t numRows, size_type nnz, lno_t bandwidth, lno_t r template void test_spmv_mv(lno_t numRows, size_type nnz, lno_t bandwidth, lno_t row_size_variance, bool heavy, int numMV) { - using mag_t = typename Kokkos::ArithTraits::mag_type; + using mag_t = typename KokkosKernels::ArithTraits::mag_type; constexpr mag_t max_x = static_cast(1); constexpr mag_t max_y = static_cast(1); @@ -544,7 +544,7 @@ void test_spmv_mv_heavy(lno_t numRows, lno_t numCols, size_type nnz, lno_t bandw using crsMat_t = typename KokkosSparse::CrsMatrix; using ViewTypeX = Kokkos::View; using ViewTypeY = Kokkos::View; - using mag_t = typename Kokkos::ArithTraits::mag_type; + using mag_t = typename KokkosKernels::ArithTraits::mag_type; using handle_t = KokkosSparse::SPMVHandle; constexpr mag_t max_x = static_cast(10); @@ -611,7 +611,7 @@ void test_spmv_padded_sizealigned(lno_t numRows, lno_t numCols, size_type nnz, l using ViewTypeY = Kokkos::View; using ViewTypeX_1D = Kokkos::View; using ViewTypeY_1D = Kokkos::View; - using mag_t = typename Kokkos::ArithTraits::mag_type; + using mag_t = typename KokkosKernels::ArithTraits::mag_type; using handle_t = KokkosSparse::SPMVHandle; using handle_r1_t = KokkosSparse::SPMVHandle; @@ -704,7 +704,7 @@ void test_spmv_struct_1D(lno_t nx, lno_t leftBC, lno_t rightBC) { using scalar_view_t = typename crsMat_t::values_type::non_const_type; using x_vector_type = scalar_view_t; using y_vector_type = scalar_view_t; - using mag_t = typename Kokkos::ArithTraits::mag_type; + using mag_t = typename KokkosKernels::ArithTraits::mag_type; constexpr mag_t max_x = static_cast(1); constexpr mag_t max_y = static_cast(1); @@ -747,7 +747,7 @@ void test_spmv_struct_2D(lno_t nx, lno_t ny, lno_t horizontalBC, lno_t verticalB using scalar_view_t = typename crsMat_t::values_type::non_const_type; using x_vector_type = scalar_view_t; using y_vector_type = scalar_view_t; - using mag_t = typename Kokkos::ArithTraits::mag_type; + using mag_t = typename KokkosKernels::ArithTraits::mag_type; constexpr mag_t max_x = static_cast(1); constexpr mag_t max_y = static_cast(1); @@ -808,7 +808,7 @@ void test_spmv_struct_3D(lno_t nx, lno_t ny, lno_t nz, lno_t horizontal1BC, lno_ using scalar_view_t = typename crsMat_t::values_type::non_const_type; using x_vector_type = scalar_view_t; using y_vector_type = scalar_view_t; - using mag_t = typename Kokkos::ArithTraits::mag_type; + using mag_t = typename KokkosKernels::ArithTraits::mag_type; constexpr mag_t max_x = static_cast(1); constexpr mag_t max_y = static_cast(1); @@ -876,7 +876,7 @@ void test_spmv_mv_struct_1D(lno_t nx, int numMV) { using crsMat_t = typename KokkosSparse::CrsMatrix; using x_multivector_type = Kokkos::View; using y_multivector_type = Kokkos::View; - using mag_t = typename Kokkos::ArithTraits::mag_type; + using mag_t = typename KokkosKernels::ArithTraits::mag_type; constexpr mag_t max_x = static_cast(1); constexpr mag_t max_y = static_cast(1); @@ -1058,13 +1058,13 @@ void test_spmv_all_interfaces_light() { // Using a small matrix, run through the various SpMV interfaces and // make sure they produce the correct results. using execution_space = typename DeviceType::execution_space; - using mag_t = typename Kokkos::ArithTraits::mag_type; + using mag_t = typename KokkosKernels::ArithTraits::mag_type; using crsMat_t = typename KokkosSparse::CrsMatrix; Kokkos::Random_XorShift64_Pool rand_pool(13718); const lno_t m = 111; const lno_t n = 99; const mag_t maxVal = 10.0; - const mag_t eps = 10.0 * Kokkos::ArithTraits::eps(); + const mag_t eps = 10.0 * KokkosKernels::ArithTraits::eps(); size_type nnz = 600; crsMat_t A = KokkosSparse::Impl::kk_generate_sparse_matrix(m, n, nnz, 2, lno_t(n * 0.7)); // note: A's values are in range [0, 50) diff --git a/sparse/unit_test/Test_Sparse_spmv_bsr.hpp b/sparse/unit_test/Test_Sparse_spmv_bsr.hpp index 53f1de5e56..6fcacc0593 100644 --- a/sparse/unit_test/Test_Sparse_spmv_bsr.hpp +++ b/sparse/unit_test/Test_Sparse_spmv_bsr.hpp @@ -145,7 +145,7 @@ void test_spmv(Handle *handle, const char *mode, const Alpha &alpha, const Beta size_t maxNnzPerRow, const XVector &x, const YVector &y) { using scalar_type = typename Bsr::non_const_value_type; using ordinal_type = typename Bsr::non_const_ordinal_type; - using KATS = Kokkos::ArithTraits; + using KATS = KokkosKernels::ArithTraits; using mag_type = typename KATS::mag_type; // generate expected result from reference (CRS) implementation @@ -472,7 +472,7 @@ void test_spm_mv(Handle *handle, const char *mode, const Alpha &alpha, const Bet size_t maxNnzPerRow, const XVector &x, const YVector &y) { using scalar_type = typename Bsr::non_const_value_type; using ordinal_type = typename Bsr::non_const_ordinal_type; - using KATS = Kokkos::ArithTraits; + using KATS = KokkosKernels::ArithTraits; using mag_type = typename KATS::mag_type; // generate expected result from reference (CRS) implementation diff --git a/sparse/unit_test/Test_Sparse_sptrsv.hpp b/sparse/unit_test/Test_Sparse_sptrsv.hpp index 21720ac605..ed45dc96fe 100644 --- a/sparse/unit_test/Test_Sparse_sptrsv.hpp +++ b/sparse/unit_test/Test_Sparse_sptrsv.hpp @@ -195,7 +195,7 @@ struct SptrsvTest { for (auto alg : algs) { // FIXME CUDA+Clang+Complex seems to expose a compiler bug #if defined(__clang__) && defined(KOKKOS_ENABLE_CUDA) - if (alg == SPTRSVAlgorithm::SEQLVLSCHD_TP1 && Kokkos::ArithTraits::isComplex && + if (alg == SPTRSVAlgorithm::SEQLVLSCHD_TP1 && KokkosKernels::ArithTraits::isComplex && std::is_same_v && block_size != 0) { std::cerr << "Skipping TP1 alg test for blocked mtx. There's a compiler bug " << "for clang+CUDA+complex" << std::endl; diff --git a/test_common/KokkosKernels_TestUtils.hpp b/test_common/KokkosKernels_TestUtils.hpp index 33c84f3634..1fc721a2fb 100644 --- a/test_common/KokkosKernels_TestUtils.hpp +++ b/test_common/KokkosKernels_TestUtils.hpp @@ -135,8 +135,8 @@ struct view_stride_adapter { template void EXPECT_NEAR_KK(Scalar1 val1, Scalar2 val2, Scalar3 tol, std::string msg = "") { - typedef Kokkos::ArithTraits AT1; - typedef Kokkos::ArithTraits AT3; + typedef KokkosKernels::ArithTraits AT1; + typedef KokkosKernels::ArithTraits AT3; EXPECT_LE((double)AT1::abs(val1 - val2), (double)AT3::abs(tol)) << msg; } @@ -144,8 +144,8 @@ template void EXPECT_NEAR_KK_REL(Scalar1 val1, Scalar2 val2, Scalar3 tol, std::string msg = "") { typedef typename std::remove_reference::type hv1_type; typedef typename std::remove_reference::type hv2_type; - const auto ahv1 = Kokkos::ArithTraits::abs(val1); - const auto ahv2 = Kokkos::ArithTraits::abs(val2); + const auto ahv1 = KokkosKernels::ArithTraits::abs(val1); + const auto ahv2 = KokkosKernels::ArithTraits::abs(val2); EXPECT_NEAR_KK(val1, val2, tol * Kokkos::max(ahv1, ahv2), msg); } diff --git a/test_common/KokkosKernels_TestVanilla.hpp b/test_common/KokkosKernels_TestVanilla.hpp index 1e1f04da07..ce5653d5c6 100644 --- a/test_common/KokkosKernels_TestVanilla.hpp +++ b/test_common/KokkosKernels_TestVanilla.hpp @@ -39,7 +39,7 @@ struct SharedVanillaGEMM { typedef typename ViewTypeC::value_type ScalarC; typedef Kokkos::View SubviewTypeA; typedef Kokkos::View SubviewTypeB; - typedef Kokkos::ArithTraits APT; + typedef KokkosKernels::ArithTraits APT; typedef typename APT::mag_type mag_type; ScalarA alpha; ScalarC beta; @@ -136,7 +136,7 @@ template void vanillaGEMM(typename ViewTypeC::non_const_value_type alpha, const ViewTypeA& A, const ViewTypeB& B, typename ViewTypeC::non_const_value_type beta, const ViewTypeC& C) { using value_type = typename ViewTypeC::non_const_value_type; - using KAT = Kokkos::ArithTraits; + using KAT = KokkosKernels::ArithTraits; int m = A.extent(0); int k = A.extent(1); int n = B.extent(1); @@ -155,10 +155,10 @@ template ; + using KAT_A = KokkosKernels::ArithTraits; const bool transposed = mode == 'T' || mode == 'C'; const bool conjugated = mode == 'C'; - const bool has_beta = beta != Kokkos::ArithTraits::zero(); + const bool has_beta = beta != KokkosKernels::ArithTraits::zero(); int M = A.extent(transposed ? 1 : 0); int N = A.extent(transposed ? 0 : 1); for (int i = 0; i < M; i++) { From d90eff8339f3b8bbaa9e9808f0c9e672da0ecddc Mon Sep 17 00:00:00 2001 From: Luc Berger-Vergiat Date: Mon, 29 Sep 2025 15:29:46 -0600 Subject: [PATCH 3/7] Trying to fix the issue with sycl... Signed-off-by: Luc Berger-Vergiat --- batched/KokkosBatched_Util.hpp | 4 +- ...tched_ApplyHouseholder_Serial_Internal.hpp | 6 +- .../KokkosBatched_Givens_Serial_Internal.hpp | 3 +- .../KokkosBatched_Pbtrs_Serial_Internal.hpp | 8 +- .../KokkosBatched_Pttrs_Serial_Internal.hpp | 8 +- .../KokkosBatched_SVD_Serial_Internal.hpp | 5 +- batched/dense/src/KokkosBatched_Vector.hpp | 2 +- .../unit_test/Test_Batched_SerialSyr.hpp | 6 +- .../dense/unit_test/Test_Batched_TeamGemm.hpp | 5 +- benchmarks/blas/KokkosBlas2_ger_benchmark.cpp | 4 +- .../KokkosSparse_spmv_bsr_benchmark.cpp | 13 +- ...Blas1_axpby_unification_attempt_traits.hpp | 10 +- blas/impl/KokkosBlas1_dot_impl.hpp | 4 +- blas/impl/KokkosBlas1_rot_spec.hpp | 46 ++-- blas/impl/KokkosBlas1_rotg_spec.hpp | 40 +-- blas/tpls/KokkosBlas1_dot_tpl_spec_decl.hpp | 254 +++++++++--------- blas/tpls/KokkosBlas1_nrm1_tpl_spec_decl.hpp | 96 +++---- blas/tpls/KokkosBlas1_nrm2_tpl_spec_avail.hpp | 18 +- blas/tpls/KokkosBlas1_nrm2_tpl_spec_decl.hpp | 129 ++++----- blas/tpls/KokkosBlas1_rot_tpl_spec_avail.hpp | 20 +- blas/tpls/KokkosBlas1_rotg_tpl_spec_avail.hpp | 20 +- blas/tpls/KokkosBlas2_gemv_tpl_spec_decl.hpp | 76 +++--- blas/unit_test/Test_Blas1_axpby.hpp | 24 +- common/src/KokkosKernels_Predicates.hpp | 12 +- common/src/Kokkos_ArithTraits.hpp | 2 + common/src/Kokkos_InnerProductSpaceTraits.hpp | 8 +- common/unit_test/Test_Common_ArithTraits.hpp | 9 +- lapack/impl/KokkosLapack_svd_spec.hpp | 6 +- lapack/tpls/KokkosLapack_Host_tpl.hpp | 4 +- .../tpls/KokkosLapack_gesv_tpl_spec_decl.hpp | 3 +- .../tpls/KokkosLapack_svd_tpl_spec_avail.hpp | 10 +- .../tpls/KokkosLapack_svd_tpl_spec_decl.hpp | 26 +- .../KokkosBatched_Test_Gemv_Host.hpp | 3 +- .../KokkosBatched_Test_Trsm_Host.hpp | 9 +- ...KokkosSparse_cluster_gauss_seidel_impl.hpp | 4 +- .../impl/KokkosSparse_gauss_seidel_impl.hpp | 4 +- .../impl/KokkosSparse_spadd_symbolic_impl.hpp | 5 +- sparse/src/KokkosSparse_IOUtils.hpp | 13 +- sparse/src/KokkosSparse_SortCrs.hpp | 34 +-- ...kkosSparse_spadd_numeric_tpl_spec_decl.hpp | 4 +- ...kosSparse_spadd_symbolic_tpl_spec_decl.hpp | 4 +- ...kosSparse_spgemm_noreuse_tpl_spec_decl.hpp | 41 +-- ...kosSparse_spgemm_numeric_tpl_spec_decl.hpp | 8 +- ...osSparse_spgemm_symbolic_tpl_spec_decl.hpp | 76 +++--- ...kosSparse_spmv_bsrmatrix_tpl_spec_decl.hpp | 184 ++++++------- .../KokkosSparse_spmv_mv_tpl_spec_decl.hpp | 4 +- .../tpls/KokkosSparse_spmv_tpl_spec_decl.hpp | 11 +- .../Test_Sparse_block_gauss_seidel.hpp | 3 +- 48 files changed, 669 insertions(+), 619 deletions(-) diff --git a/batched/KokkosBatched_Util.hpp b/batched/KokkosBatched_Util.hpp index 1401186f9e..bdf7d1800c 100644 --- a/batched/KokkosBatched_Util.hpp +++ b/batched/KokkosBatched_Util.hpp @@ -156,8 +156,8 @@ struct is_same_mag_type { static const bool is_specialized = (KokkosKernels::ArithTraits::is_specialized && KokkosKernels::ArithTraits::is_specialized); - static const bool is_mag_type_same = - std::is_same::mag_type, typename KokkosKernels::ArithTraits::mag_type>::value; + static const bool is_mag_type_same = std::is_same::mag_type, + typename KokkosKernels::ArithTraits::mag_type>::value; static const bool value = is_specialized && is_mag_type_same; }; diff --git a/batched/dense/impl/KokkosBatched_ApplyHouseholder_Serial_Internal.hpp b/batched/dense/impl/KokkosBatched_ApplyHouseholder_Serial_Internal.hpp index 04c792d2f8..6fa925765d 100644 --- a/batched/dense/impl/KokkosBatched_ApplyHouseholder_Serial_Internal.hpp +++ b/batched/dense/impl/KokkosBatched_ApplyHouseholder_Serial_Internal.hpp @@ -53,7 +53,8 @@ struct SerialApplyLeftHouseholderInternal { // w1t /= tau for (int j = 0; j < n; ++j) { value_type tmp = a1t[j * a1ts]; - for (int i = 0; i < m; ++i) tmp += KokkosKernels::ArithTraits::conj(u2[i * u2s]) * A2[i * as0 + j * as1]; + for (int i = 0; i < m; ++i) + tmp += KokkosKernels::ArithTraits::conj(u2[i * u2s]) * A2[i * as0 + j * as1]; w1t[j] = tmp * inv_tau; // /= (*tau); } @@ -101,7 +102,8 @@ struct SerialApplyRightHouseholderInternal { // A2 -= w1 * u2' (ger with conjugate) for (int j = 0; j < n; ++j) - for (int i = 0; i < m; ++i) A2[i * as0 + j * as1] -= w1[i] * KokkosKernels::ArithTraits::conj(u2[j * u2s]); + for (int i = 0; i < m; ++i) + A2[i * as0 + j * as1] -= w1[i] * KokkosKernels::ArithTraits::conj(u2[j * u2s]); return 0; } diff --git a/batched/dense/impl/KokkosBatched_Givens_Serial_Internal.hpp b/batched/dense/impl/KokkosBatched_Givens_Serial_Internal.hpp index e6926859af..da5045226a 100644 --- a/batched/dense/impl/KokkosBatched_Givens_Serial_Internal.hpp +++ b/batched/dense/impl/KokkosBatched_Givens_Serial_Internal.hpp @@ -57,7 +57,8 @@ struct SerialGivensInternal { cs = chi1 / r; sn = chi2 / r; - if (KokkosKernels::ArithTraits::abs(chi1) > KokkosKernels::ArithTraits::abs(chi2) && cs < zero) { + if (KokkosKernels::ArithTraits::abs(chi1) > KokkosKernels::ArithTraits::abs(chi2) && + cs < zero) { cs = -cs; sn = -sn; r = -r; diff --git a/batched/dense/impl/KokkosBatched_Pbtrs_Serial_Internal.hpp b/batched/dense/impl/KokkosBatched_Pbtrs_Serial_Internal.hpp index a6b581f21c..e6671f5c45 100644 --- a/batched/dense/impl/KokkosBatched_Pbtrs_Serial_Internal.hpp +++ b/batched/dense/impl/KokkosBatched_Pbtrs_Serial_Internal.hpp @@ -51,8 +51,8 @@ KOKKOS_INLINE_FUNCTION int SerialPbtrsInternalLower::inv SerialTbsvInternalLower::invoke(false, an, A, as0, as1, x, xs0, kd); // Solve L**T *X = B, overwriting B with X. - using op = - std::conditional_t::is_complex, KokkosBlas::Impl::OpConj, KokkosBlas::Impl::OpID>; + using op = std::conditional_t::is_complex, KokkosBlas::Impl::OpConj, + KokkosBlas::Impl::OpID>; SerialTbsvInternalLowerTranspose::invoke(op(), false, an, A, as0, as1, x, xs0, kd); return 0; @@ -78,8 +78,8 @@ KOKKOS_INLINE_FUNCTION int SerialPbtrsInternalUpper::inv /**/ ValueType *KOKKOS_RESTRICT x, const int xs0, const int kd) { // Solve U**T *X = B, overwriting B with X. - using op = - std::conditional_t::is_complex, KokkosBlas::Impl::OpConj, KokkosBlas::Impl::OpID>; + using op = std::conditional_t::is_complex, KokkosBlas::Impl::OpConj, + KokkosBlas::Impl::OpID>; SerialTbsvInternalUpperTranspose::invoke(op(), false, an, A, as0, as1, x, xs0, kd); // Solve U*X = B, overwriting B with X. diff --git a/batched/dense/impl/KokkosBatched_Pttrs_Serial_Internal.hpp b/batched/dense/impl/KokkosBatched_Pttrs_Serial_Internal.hpp index ba25571c91..95b8f9147a 100644 --- a/batched/dense/impl/KokkosBatched_Pttrs_Serial_Internal.hpp +++ b/batched/dense/impl/KokkosBatched_Pttrs_Serial_Internal.hpp @@ -35,10 +35,10 @@ template KOKKOS_INLINE_FUNCTION int SerialPttrsInternal::invoke( const int n, const RealType *KOKKOS_RESTRICT d, const int ds0, const ValueType *KOKKOS_RESTRICT e, const int es0, ValueType *KOKKOS_RESTRICT b, const int bs0) { - using MayBeOpConj = - std::conditional_t::is_complex, KokkosBlas::Impl::OpConj, KokkosBlas::Impl::OpID>; - using OpUpper = std::conditional_t, MayBeOpConj, KokkosBlas::Impl::OpID>; - using OpLower = std::conditional_t, MayBeOpConj, KokkosBlas::Impl::OpID>; + using MayBeOpConj = std::conditional_t::is_complex, KokkosBlas::Impl::OpConj, + KokkosBlas::Impl::OpID>; + using OpUpper = std::conditional_t, MayBeOpConj, KokkosBlas::Impl::OpID>; + using OpLower = std::conditional_t, MayBeOpConj, KokkosBlas::Impl::OpID>; OpUpper op_upper; OpLower op_lower; diff --git a/batched/dense/impl/KokkosBatched_SVD_Serial_Internal.hpp b/batched/dense/impl/KokkosBatched_SVD_Serial_Internal.hpp index f4a5edd218..3caf3383af 100644 --- a/batched/dense/impl/KokkosBatched_SVD_Serial_Internal.hpp +++ b/batched/dense/impl/KokkosBatched_SVD_Serial_Internal.hpp @@ -328,8 +328,9 @@ struct SerialSVDInternal { template KOKKOS_INLINE_FUNCTION static int invoke(int m, int n, value_type* A, int As0, int As1, value_type* U, int Us0, int Us1, value_type* Vt, int Vts0, int Vts1, value_type* sigma, int ss, - value_type* work, value_type tol = KokkosKernels::ArithTraits::zero(), - int max_iters = 1000000000) { + value_type* work, + value_type tol = KokkosKernels::ArithTraits::zero(), + int max_iters = 1000000000) { // First, if m < n, need to instead compute (V, s, U^T) = A^T. // This just means swapping U & Vt, and implicitly transposing A, U and Vt. if (m < n) { diff --git a/batched/dense/src/KokkosBatched_Vector.hpp b/batched/dense/src/KokkosBatched_Vector.hpp index 1fef4488df..ad1e8652b5 100644 --- a/batched/dense/src/KokkosBatched_Vector.hpp +++ b/batched/dense/src/KokkosBatched_Vector.hpp @@ -318,6 +318,6 @@ class ArithTraits>, } }; -} // namespace Kokkos +} // namespace KokkosKernels #endif diff --git a/batched/dense/unit_test/Test_Batched_SerialSyr.hpp b/batched/dense/unit_test/Test_Batched_SerialSyr.hpp index e32a4222cc..da496d98a7 100644 --- a/batched/dense/unit_test/Test_Batched_SerialSyr.hpp +++ b/batched/dense/unit_test/Test_Batched_SerialSyr.hpp @@ -298,8 +298,10 @@ void impl_test_batched_syr(const std::size_t Nb, const std::size_t BlkSize) { h_A0_ref(ib, i, j) = h_x(ib, i) * temp; } } - h_A_ref(ib, j, j) = is_conj ? KokkosKernels::ArithTraits::real(h_A_ref(ib, j, j)) : h_A_ref(ib, j, j); - h_A0_ref(ib, j, j) = is_conj ? KokkosKernels::ArithTraits::real(h_A0_ref(ib, j, j)) : h_A0_ref(ib, j, j); + h_A_ref(ib, j, j) = + is_conj ? KokkosKernels::ArithTraits::real(h_A_ref(ib, j, j)) : h_A_ref(ib, j, j); + h_A0_ref(ib, j, j) = + is_conj ? KokkosKernels::ArithTraits::real(h_A0_ref(ib, j, j)) : h_A0_ref(ib, j, j); } } } diff --git a/batched/dense/unit_test/Test_Batched_TeamGemm.hpp b/batched/dense/unit_test/Test_Batched_TeamGemm.hpp index 650faa6e22..df7f4076c7 100644 --- a/batched/dense/unit_test/Test_Batched_TeamGemm.hpp +++ b/batched/dense/unit_test/Test_Batched_TeamGemm.hpp @@ -172,8 +172,9 @@ void impl_test_batched_teamgemm(const int N, const int matAdim1, const int matAd using execution_space = typename DeviceType::execution_space; using ats = KokkosKernels::ArithTraits; using ViewType = Kokkos::View; - using FP64Type = std::conditional_t::is_complex, Kokkos::complex, double>; - using ViewFP64Type = Kokkos::View; + using FP64Type = + std::conditional_t::is_complex, Kokkos::complex, double>; + using ViewFP64Type = Kokkos::View; using ErrorViewFP64Type = Kokkos::View; /// randomized input testing views diff --git a/benchmarks/blas/KokkosBlas2_ger_benchmark.cpp b/benchmarks/blas/KokkosBlas2_ger_benchmark.cpp index 2d132a8f1e..5ff0c121d5 100644 --- a/benchmarks/blas/KokkosBlas2_ger_benchmark.cpp +++ b/benchmarks/blas/KokkosBlas2_ger_benchmark.cpp @@ -119,8 +119,8 @@ static void KokkosBlas2_GER(benchmark::State& state) { if (verbosity > 0) { std::cout << "Entering KokkosBlas2_GER()" << ": m = " << m << ", n = " << n << ", yIsTranspose = " << yIsTranspose - << ", tScalar = " << KokkosKernels::ArithTraits::name() << ", tLayout = " << typeid(tLayout).name() - << std::endl; + << ", tScalar = " << KokkosKernels::ArithTraits::name() + << ", tLayout = " << typeid(tLayout).name() << std::endl; } using MemSpace = typename tExecSpace::memory_space; diff --git a/benchmarks/sparse/KokkosSparse_spmv_bsr_benchmark.cpp b/benchmarks/sparse/KokkosSparse_spmv_bsr_benchmark.cpp index 21cc642550..1be1e1bed7 100644 --- a/benchmarks/sparse/KokkosSparse_spmv_bsr_benchmark.cpp +++ b/benchmarks/sparse/KokkosSparse_spmv_bsr_benchmark.cpp @@ -318,9 +318,10 @@ void register_expand_type(const fs::path &path) { for (size_t bs : {4, 7, 10, 16}) { // block sizes for (size_t k : ks) { // multivector sizes std::string name = std::string("MatrixMarketExpanded") + "/" + std::string(path.stem()) + "/" + - KokkosKernels::ArithTraits::name() + "/" + KokkosKernels::ArithTraits::name() + "/" + - KokkosKernels::ArithTraits::name() + "/" + std::to_string(bs) + "/" + std::to_string(k) + - "/" + Spmv::name() + "/" + Device::name(); + KokkosKernels::ArithTraits::name() + "/" + + KokkosKernels::ArithTraits::name() + "/" + + KokkosKernels::ArithTraits::name() + "/" + std::to_string(bs) + "/" + + std::to_string(k) + "/" + Spmv::name() + "/" + Device::name(); benchmark::RegisterBenchmark(name.c_str(), read_expand_run, path, bs, k)->UseRealTime(); } } @@ -333,9 +334,9 @@ void register_convert_type(const fs::path &path, size_t bs) { for (size_t k : ks) { // multivector sizes std::string name = std::string("MatrixMarketConvert") + "/" + std::string(path.stem()) + "/" + - KokkosKernels::ArithTraits::name() + "/" + KokkosKernels::ArithTraits::name() + "/" + - KokkosKernels::ArithTraits::name() + "/" + std::to_string(bs) + "/" + std::to_string(k) + "/" + - Spmv::name() + "/" + Device::name(); + KokkosKernels::ArithTraits::name() + "/" + KokkosKernels::ArithTraits::name() + + "/" + KokkosKernels::ArithTraits::name() + "/" + std::to_string(bs) + "/" + + std::to_string(k) + "/" + Spmv::name() + "/" + Device::name(); benchmark::RegisterBenchmark(name.c_str(), read_convert_run, path, bs, k)->UseRealTime(); } } diff --git a/blas/impl/KokkosBlas1_axpby_unification_attempt_traits.hpp b/blas/impl/KokkosBlas1_axpby_unification_attempt_traits.hpp index e84bbab0c1..53662f6e28 100644 --- a/blas/impl/KokkosBlas1_axpby_unification_attempt_traits.hpp +++ b/blas/impl/KokkosBlas1_axpby_unification_attempt_traits.hpp @@ -191,8 +191,9 @@ struct AxpbyUnificationAttemptTraits { using InternalLayoutA = std::conditional_t<(a_is_r1d || a_is_r1s) && atInputLayoutA_isStride, AtInputLayoutA, InternalLayoutX>; - static constexpr bool atInputScalarTypeA_mustRemain = KokkosKernels::ArithTraits::is_complex && - !KokkosKernels::ArithTraits::is_complex; + static constexpr bool atInputScalarTypeA_mustRemain = + KokkosKernels::ArithTraits::is_complex && + !KokkosKernels::ArithTraits::is_complex; using InternalScalarTypeA = std::conditional_t; - static constexpr bool atInputScalarTypeB_mustRemain = KokkosKernels::ArithTraits::is_complex && - !KokkosKernels::ArithTraits::is_complex; + static constexpr bool atInputScalarTypeB_mustRemain = + KokkosKernels::ArithTraits::is_complex && + !KokkosKernels::ArithTraits::is_complex; using InternalScalarTypeB = std::conditional_t::zero(); } + KOKKOS_INLINE_FUNCTION void init(value_type& update) const { + update = KokkosKernels::ArithTraits::zero(); + } KOKKOS_INLINE_FUNCTION void join(value_type& update, const value_type& source) const { update += source; } }; diff --git a/blas/impl/KokkosBlas1_rot_spec.hpp b/blas/impl/KokkosBlas1_rot_spec.hpp index 41c8459b72..410b88d951 100644 --- a/blas/impl/KokkosBlas1_rot_spec.hpp +++ b/blas/impl/KokkosBlas1_rot_spec.hpp @@ -43,15 +43,15 @@ struct rot_eti_spec_avail { // We may spread out definitions (see _INST macro below) across one or // more .cpp files. // -#define KOKKOSBLAS1_ROT_ETI_SPEC_AVAIL(SCALAR, LAYOUT, EXECSPACE, MEMSPACE) \ - template <> \ - struct rot_eti_spec_avail< \ - EXECSPACE, \ - Kokkos::View, Kokkos::MemoryTraits>, \ - Kokkos::View::mag_type, LAYOUT, Kokkos::Device, \ - Kokkos::MemoryTraits>, \ - Kokkos::View, Kokkos::MemoryTraits>> { \ - enum : bool { value = true }; \ +#define KOKKOSBLAS1_ROT_ETI_SPEC_AVAIL(SCALAR, LAYOUT, EXECSPACE, MEMSPACE) \ + template <> \ + struct rot_eti_spec_avail< \ + EXECSPACE, \ + Kokkos::View, Kokkos::MemoryTraits>, \ + Kokkos::View::mag_type, LAYOUT, Kokkos::Device, \ + Kokkos::MemoryTraits>, \ + Kokkos::View, Kokkos::MemoryTraits>> { \ + enum : bool { value = true }; \ }; // Include the actual specialization declarations @@ -103,13 +103,13 @@ struct Rot, Kokkos::MemoryTraits>, \ - Kokkos::View::mag_type, LAYOUT, Kokkos::Device, \ - Kokkos::MemoryTraits>, \ - Kokkos::View, Kokkos::MemoryTraits>, \ +#define KOKKOSBLAS1_ROT_ETI_SPEC_DECL(SCALAR, LAYOUT, EXECSPACE, MEMSPACE) \ + extern template struct Rot< \ + EXECSPACE, \ + Kokkos::View, Kokkos::MemoryTraits>, \ + Kokkos::View::mag_type, LAYOUT, Kokkos::Device, \ + Kokkos::MemoryTraits>, \ + Kokkos::View, Kokkos::MemoryTraits>, \ false, true>; // @@ -117,13 +117,13 @@ struct Rot, Kokkos::MemoryTraits>, \ - Kokkos::View::mag_type, LAYOUT, Kokkos::Device, \ - Kokkos::MemoryTraits>, \ - Kokkos::View, Kokkos::MemoryTraits>, \ +#define KOKKOSBLAS1_ROT_ETI_SPEC_INST(SCALAR, LAYOUT, EXECSPACE, MEMSPACE) \ + template struct Rot< \ + EXECSPACE, \ + Kokkos::View, Kokkos::MemoryTraits>, \ + Kokkos::View::mag_type, LAYOUT, Kokkos::Device, \ + Kokkos::MemoryTraits>, \ + Kokkos::View, Kokkos::MemoryTraits>, \ false, true>; #include diff --git a/blas/impl/KokkosBlas1_rotg_spec.hpp b/blas/impl/KokkosBlas1_rotg_spec.hpp index b9f8a36ced..d5beff830e 100644 --- a/blas/impl/KokkosBlas1_rotg_spec.hpp +++ b/blas/impl/KokkosBlas1_rotg_spec.hpp @@ -42,14 +42,14 @@ struct rotg_eti_spec_avail { // We may spread out definitions (see _INST macro below) across one or // more .cpp files. // -#define KOKKOSBLAS1_ROTG_ETI_SPEC_AVAIL(SCALAR, LAYOUT, EXECSPACE, MEMSPACE) \ - template <> \ - struct rotg_eti_spec_avail< \ - EXECSPACE, \ - Kokkos::View, Kokkos::MemoryTraits>, \ - Kokkos::View::mag_type, LAYOUT, Kokkos::Device, \ - Kokkos::MemoryTraits>> { \ - enum : bool { value = true }; \ +#define KOKKOSBLAS1_ROTG_ETI_SPEC_AVAIL(SCALAR, LAYOUT, EXECSPACE, MEMSPACE) \ + template <> \ + struct rotg_eti_spec_avail< \ + EXECSPACE, \ + Kokkos::View, Kokkos::MemoryTraits>, \ + Kokkos::View::mag_type, LAYOUT, Kokkos::Device, \ + Kokkos::MemoryTraits>> { \ + enum : bool { value = true }; \ }; // Include the actual specialization declarations @@ -101,12 +101,12 @@ struct Rotg, Kokkos::MemoryTraits>, \ - Kokkos::View::mag_type, LAYOUT, Kokkos::Device, \ - Kokkos::MemoryTraits>, \ +#define KOKKOSBLAS1_ROTG_ETI_SPEC_DECL(SCALAR, LAYOUT, EXECSPACE, MEMSPACE) \ + extern template struct Rotg< \ + EXECSPACE, \ + Kokkos::View, Kokkos::MemoryTraits>, \ + Kokkos::View::mag_type, LAYOUT, Kokkos::Device, \ + Kokkos::MemoryTraits>, \ false, true>; // @@ -114,12 +114,12 @@ struct Rotg, Kokkos::MemoryTraits>, \ - Kokkos::View::mag_type, LAYOUT, Kokkos::Device, \ - Kokkos::MemoryTraits>, \ +#define KOKKOSBLAS1_ROTG_ETI_SPEC_INST(SCALAR, LAYOUT, EXECSPACE, MEMSPACE) \ + template struct Rotg< \ + EXECSPACE, \ + Kokkos::View, Kokkos::MemoryTraits>, \ + Kokkos::View::mag_type, LAYOUT, Kokkos::Device, \ + Kokkos::MemoryTraits>, \ false, true>; #include diff --git a/blas/tpls/KokkosBlas1_dot_tpl_spec_decl.hpp b/blas/tpls/KokkosBlas1_dot_tpl_spec_decl.hpp index d024ffc99b..ec28976770 100644 --- a/blas/tpls/KokkosBlas1_dot_tpl_spec_decl.hpp +++ b/blas/tpls/KokkosBlas1_dot_tpl_spec_decl.hpp @@ -39,35 +39,36 @@ inline void dot_print_specialization() { namespace KokkosBlas { namespace Impl { -#define KOKKOSBLAS1_DOT_TPL_SPEC_DECL_BLAS(LAYOUT, KOKKOS_TYPE, TPL_TYPE, MEMSPACE, ETI_SPEC_AVAIL) \ - template \ - struct Dot >, \ - Kokkos::View, \ - Kokkos::MemoryTraits >, \ - Kokkos::View, \ - Kokkos::MemoryTraits >, \ - 1, 1, true, ETI_SPEC_AVAIL> { \ - typedef Kokkos::View > RV; \ - typedef Kokkos::View, \ - Kokkos::MemoryTraits > \ - XV; \ - typedef typename XV::size_type size_type; \ - \ - static void dot(const ExecSpace& space, RV& R, const XV& X, const XV& Y) { \ - Kokkos::Profiling::pushRegion("KokkosBlas::dot[TPL_BLAS," + KokkosKernels::ArithTraits::name() + "]"); \ - const size_type numElems = X.extent(0); \ - if (numElems < static_cast(INT_MAX)) { \ - dot_print_specialization(); \ - int N = numElems; \ - int one = 1; \ - R() = HostBlas::dot(N, reinterpret_cast(X.data()), one, \ - reinterpret_cast(Y.data()), one); \ - } else { \ - Dot::dot(space, R, X, Y); \ - } \ - Kokkos::Profiling::popRegion(); \ - } \ +#define KOKKOSBLAS1_DOT_TPL_SPEC_DECL_BLAS(LAYOUT, KOKKOS_TYPE, TPL_TYPE, MEMSPACE, ETI_SPEC_AVAIL) \ + template \ + struct Dot >, \ + Kokkos::View, \ + Kokkos::MemoryTraits >, \ + Kokkos::View, \ + Kokkos::MemoryTraits >, \ + 1, 1, true, ETI_SPEC_AVAIL> { \ + typedef Kokkos::View > RV; \ + typedef Kokkos::View, \ + Kokkos::MemoryTraits > \ + XV; \ + typedef typename XV::size_type size_type; \ + \ + static void dot(const ExecSpace& space, RV& R, const XV& X, const XV& Y) { \ + Kokkos::Profiling::pushRegion("KokkosBlas::dot[TPL_BLAS," + KokkosKernels::ArithTraits::name() + \ + "]"); \ + const size_type numElems = X.extent(0); \ + if (numElems < static_cast(INT_MAX)) { \ + dot_print_specialization(); \ + int N = numElems; \ + int one = 1; \ + R() = HostBlas::dot(N, reinterpret_cast(X.data()), one, \ + reinterpret_cast(Y.data()), one); \ + } else { \ + Dot::dot(space, R, X, Y); \ + } \ + Kokkos::Profiling::popRegion(); \ + } \ }; #define KOKKOSBLAS1_DOT_TPL_SPEC_DECL_BLAS_EXT(ETI_SPEC_AVAIL) \ @@ -93,40 +94,41 @@ KOKKOSBLAS1_DOT_TPL_SPEC_DECL_BLAS_EXT(false) namespace KokkosBlas { namespace Impl { -#define KOKKOSBLAS1_DOT_TPL_SPEC_DECL_CUBLAS(LAYOUT, KOKKOS_TYPE, TPL_TYPE, EXECSPACE, MEMSPACE, TPL_DOT, \ - ETI_SPEC_AVAIL) \ - template <> \ - struct Dot >, \ - Kokkos::View, \ - Kokkos::MemoryTraits >, \ - Kokkos::View, \ - Kokkos::MemoryTraits >, \ - 1, 1, true, ETI_SPEC_AVAIL> { \ - typedef Kokkos::View > RV; \ - typedef Kokkos::View, \ - Kokkos::MemoryTraits > \ - XV; \ - typedef typename XV::size_type size_type; \ - \ - static void dot(const EXECSPACE& space, RV& R, const XV& X, const XV& Y) { \ - Kokkos::Profiling::pushRegion("KokkosBlas::dot[TPL_CUBLAS," + KokkosKernels::ArithTraits::name() + "]"); \ - const size_type numElems = X.extent(0); \ - /* TODO: CUDA-12's 64-bit indices allow larger numElems */ \ - if (numElems <= static_cast(std::numeric_limits::max())) { \ - dot_print_specialization(); \ - const int N = static_cast(numElems); \ - KokkosBlas::Impl::CudaBlasSingleton& s = KokkosBlas::Impl::CudaBlasSingleton::singleton(); \ - KOKKOSBLAS_IMPL_CUBLAS_SAFE_CALL(cublasSetStream(s.handle, space.cuda_stream())); \ - KOKKOSBLAS_IMPL_CUBLAS_SAFE_CALL(TPL_DOT(s.handle, N, reinterpret_cast(X.data()), 1, \ - reinterpret_cast(Y.data()), 1, \ - reinterpret_cast(&R()))); \ - KOKKOSBLAS_IMPL_CUBLAS_SAFE_CALL(cublasSetStream(s.handle, NULL)); \ - } else { \ - Dot::dot(space, R, X, Y); \ - } \ - Kokkos::Profiling::popRegion(); \ - } \ +#define KOKKOSBLAS1_DOT_TPL_SPEC_DECL_CUBLAS(LAYOUT, KOKKOS_TYPE, TPL_TYPE, EXECSPACE, MEMSPACE, TPL_DOT, \ + ETI_SPEC_AVAIL) \ + template <> \ + struct Dot >, \ + Kokkos::View, \ + Kokkos::MemoryTraits >, \ + Kokkos::View, \ + Kokkos::MemoryTraits >, \ + 1, 1, true, ETI_SPEC_AVAIL> { \ + typedef Kokkos::View > RV; \ + typedef Kokkos::View, \ + Kokkos::MemoryTraits > \ + XV; \ + typedef typename XV::size_type size_type; \ + \ + static void dot(const EXECSPACE& space, RV& R, const XV& X, const XV& Y) { \ + Kokkos::Profiling::pushRegion("KokkosBlas::dot[TPL_CUBLAS," + KokkosKernels::ArithTraits::name() + \ + "]"); \ + const size_type numElems = X.extent(0); \ + /* TODO: CUDA-12's 64-bit indices allow larger numElems */ \ + if (numElems <= static_cast(std::numeric_limits::max())) { \ + dot_print_specialization(); \ + const int N = static_cast(numElems); \ + KokkosBlas::Impl::CudaBlasSingleton& s = KokkosBlas::Impl::CudaBlasSingleton::singleton(); \ + KOKKOSBLAS_IMPL_CUBLAS_SAFE_CALL(cublasSetStream(s.handle, space.cuda_stream())); \ + KOKKOSBLAS_IMPL_CUBLAS_SAFE_CALL(TPL_DOT(s.handle, N, reinterpret_cast(X.data()), 1, \ + reinterpret_cast(Y.data()), 1, \ + reinterpret_cast(&R()))); \ + KOKKOSBLAS_IMPL_CUBLAS_SAFE_CALL(cublasSetStream(s.handle, NULL)); \ + } else { \ + Dot::dot(space, R, X, Y); \ + } \ + Kokkos::Profiling::popRegion(); \ + } \ }; #define KOKKOSBLAS1_DOT_TPL_SPEC_DECL_CUBLAS_EXT(ETI_SPEC_AVAIL) \ @@ -152,39 +154,40 @@ KOKKOSBLAS1_DOT_TPL_SPEC_DECL_CUBLAS_EXT(false) namespace KokkosBlas { namespace Impl { -#define KOKKOSBLAS1_DOT_TPL_SPEC_DECL_ROCBLAS(LAYOUT, KOKKOS_TYPE, TPL_TYPE, EXECSPACE, MEMSPACE, TPL_DOT, \ - ETI_SPEC_AVAIL) \ - template <> \ - struct Dot >, \ - Kokkos::View, \ - Kokkos::MemoryTraits >, \ - Kokkos::View, \ - Kokkos::MemoryTraits >, \ - 1, 1, true, ETI_SPEC_AVAIL> { \ - typedef Kokkos::View > RV; \ - typedef Kokkos::View, \ - Kokkos::MemoryTraits > \ - XV; \ - typedef typename XV::size_type size_type; \ - \ - static void dot(const EXECSPACE& space, RV& R, const XV& X, const XV& Y) { \ - Kokkos::Profiling::pushRegion("KokkosBlas::dot[TPL_ROCBLAS," + KokkosKernels::ArithTraits::name() + "]"); \ - const size_type numElems = X.extent(0); \ - if (numElems <= static_cast(std::numeric_limits::max())) { \ - dot_print_specialization(); \ - const rocblas_int N = static_cast(numElems); \ - KokkosBlas::Impl::RocBlasSingleton& s = KokkosBlas::Impl::RocBlasSingleton::singleton(); \ - KOKKOSBLAS_IMPL_ROCBLAS_SAFE_CALL(rocblas_set_stream(s.handle, space.hip_stream())); \ - KOKKOSBLAS_IMPL_ROCBLAS_SAFE_CALL(TPL_DOT(s.handle, N, reinterpret_cast(X.data()), 1, \ - reinterpret_cast(Y.data()), 1, \ - reinterpret_cast(&R()))); \ - KOKKOSBLAS_IMPL_ROCBLAS_SAFE_CALL(rocblas_set_stream(s.handle, NULL)); \ - } else { \ - Dot::dot(space, R, X, Y); \ - } \ - Kokkos::Profiling::popRegion(); \ - } \ +#define KOKKOSBLAS1_DOT_TPL_SPEC_DECL_ROCBLAS(LAYOUT, KOKKOS_TYPE, TPL_TYPE, EXECSPACE, MEMSPACE, TPL_DOT, \ + ETI_SPEC_AVAIL) \ + template <> \ + struct Dot >, \ + Kokkos::View, \ + Kokkos::MemoryTraits >, \ + Kokkos::View, \ + Kokkos::MemoryTraits >, \ + 1, 1, true, ETI_SPEC_AVAIL> { \ + typedef Kokkos::View > RV; \ + typedef Kokkos::View, \ + Kokkos::MemoryTraits > \ + XV; \ + typedef typename XV::size_type size_type; \ + \ + static void dot(const EXECSPACE& space, RV& R, const XV& X, const XV& Y) { \ + Kokkos::Profiling::pushRegion("KokkosBlas::dot[TPL_ROCBLAS," + KokkosKernels::ArithTraits::name() + \ + "]"); \ + const size_type numElems = X.extent(0); \ + if (numElems <= static_cast(std::numeric_limits::max())) { \ + dot_print_specialization(); \ + const rocblas_int N = static_cast(numElems); \ + KokkosBlas::Impl::RocBlasSingleton& s = KokkosBlas::Impl::RocBlasSingleton::singleton(); \ + KOKKOSBLAS_IMPL_ROCBLAS_SAFE_CALL(rocblas_set_stream(s.handle, space.hip_stream())); \ + KOKKOSBLAS_IMPL_ROCBLAS_SAFE_CALL(TPL_DOT(s.handle, N, reinterpret_cast(X.data()), 1, \ + reinterpret_cast(Y.data()), 1, \ + reinterpret_cast(&R()))); \ + KOKKOSBLAS_IMPL_ROCBLAS_SAFE_CALL(rocblas_set_stream(s.handle, NULL)); \ + } else { \ + Dot::dot(space, R, X, Y); \ + } \ + Kokkos::Profiling::popRegion(); \ + } \ }; #define KOKKOSBLAS1_DOT_TPL_SPEC_DECL_ROCBLAS_EXT(ETI_SPEC_AVAIL) \ @@ -211,35 +214,36 @@ KOKKOSBLAS1_DOT_TPL_SPEC_DECL_ROCBLAS_EXT(false) namespace KokkosBlas { namespace Impl { -#define KOKKOSBLAS1_DOT_TPL_SPEC_DECL_ONEMKL(LAYOUT, KOKKOS_TYPE, TPL_TYPE, EXECSPACE, MEMSPACE, TPL_DOT, \ - ETI_SPEC_AVAIL) \ - template <> \ - struct Dot >, \ - Kokkos::View, \ - Kokkos::MemoryTraits >, \ - Kokkos::View, \ - Kokkos::MemoryTraits >, \ - 1, 1, true, ETI_SPEC_AVAIL> { \ - typedef Kokkos::View > RV; \ - typedef Kokkos::View, \ - Kokkos::MemoryTraits > \ - XV; \ - typedef typename XV::size_type size_type; \ - \ - static void dot(const EXECSPACE& exec, RV& R, const XV& X, const XV& Y) { \ - Kokkos::Profiling::pushRegion("KokkosBlas::dot[TPL_ONEMKL," + KokkosKernels::ArithTraits::name() + "]"); \ - const size_type numElems = X.extent(0); \ - if (numElems <= static_cast(std::numeric_limits::max())) { \ - dot_print_specialization(); \ - const std::int64_t N = static_cast(numElems); \ - TPL_DOT(exec.sycl_queue(), N, reinterpret_cast(X.data()), 1, \ - reinterpret_cast(Y.data()), 1, reinterpret_cast(&R())); \ - } else { \ - Dot::dot(exec, R, X, Y); \ - } \ - Kokkos::Profiling::popRegion(); \ - } \ +#define KOKKOSBLAS1_DOT_TPL_SPEC_DECL_ONEMKL(LAYOUT, KOKKOS_TYPE, TPL_TYPE, EXECSPACE, MEMSPACE, TPL_DOT, \ + ETI_SPEC_AVAIL) \ + template <> \ + struct Dot >, \ + Kokkos::View, \ + Kokkos::MemoryTraits >, \ + Kokkos::View, \ + Kokkos::MemoryTraits >, \ + 1, 1, true, ETI_SPEC_AVAIL> { \ + typedef Kokkos::View > RV; \ + typedef Kokkos::View, \ + Kokkos::MemoryTraits > \ + XV; \ + typedef typename XV::size_type size_type; \ + \ + static void dot(const EXECSPACE& exec, RV& R, const XV& X, const XV& Y) { \ + Kokkos::Profiling::pushRegion("KokkosBlas::dot[TPL_ONEMKL," + KokkosKernels::ArithTraits::name() + \ + "]"); \ + const size_type numElems = X.extent(0); \ + if (numElems <= static_cast(std::numeric_limits::max())) { \ + dot_print_specialization(); \ + const std::int64_t N = static_cast(numElems); \ + TPL_DOT(exec.sycl_queue(), N, reinterpret_cast(X.data()), 1, \ + reinterpret_cast(Y.data()), 1, reinterpret_cast(&R())); \ + } else { \ + Dot::dot(exec, R, X, Y); \ + } \ + Kokkos::Profiling::popRegion(); \ + } \ }; #define KOKKOSBLAS1_DOT_TPL_SPEC_DECL_ONEMKL_EXT(ETI_SPEC_AVAIL) \ diff --git a/blas/tpls/KokkosBlas1_nrm1_tpl_spec_decl.hpp b/blas/tpls/KokkosBlas1_nrm1_tpl_spec_decl.hpp index 1d3c0cf6ca..a3ce032192 100644 --- a/blas/tpls/KokkosBlas1_nrm1_tpl_spec_decl.hpp +++ b/blas/tpls/KokkosBlas1_nrm1_tpl_spec_decl.hpp @@ -41,17 +41,17 @@ namespace Impl { #define KOKKOSBLAS1_NRM1_TPL_SPEC_DECL_BLAS(SCALAR, LAYOUT, EXECSPACE, MEMSPACE) \ template <> \ struct Nrm1::mag_type, LAYOUT, Kokkos::HostSpace, \ + Kokkos::View::mag_type, LAYOUT, Kokkos::HostSpace, \ Kokkos::MemoryTraits>, \ Kokkos::View, \ Kokkos::MemoryTraits>, \ 1, true, \ nrm1_eti_spec_avail::mag_type, LAYOUT, \ + Kokkos::View::mag_type, LAYOUT, \ Kokkos::HostSpace, Kokkos::MemoryTraits>, \ Kokkos::View, \ Kokkos::MemoryTraits>>::value> { \ - using mag_type = typename KokkosKernels::ArithTraits::mag_type; \ + using mag_type = typename KokkosKernels::ArithTraits::mag_type; \ using RV = Kokkos::View>; \ using XV = Kokkos::View, \ Kokkos::MemoryTraits>; \ @@ -64,7 +64,7 @@ namespace Impl { nrm1_print_specialization(); \ int N = numElems; \ int one = 1; \ - if constexpr (KokkosKernels::ArithTraits::is_complex) { \ + if constexpr (KokkosKernels::ArithTraits::is_complex) { \ R() = HostBlas>::asum(N, reinterpret_cast*>(X.data()), \ one); \ } else { \ @@ -140,22 +140,22 @@ void cublasAsumWrapper(const ExecutionSpace& space, RViewType& R, const XViewTyp #define KOKKOSBLAS1_NRM1_TPL_SPEC_DECL_CUBLAS(SCALAR, LAYOUT, MEMSPACE) \ template <> \ struct Nrm1::mag_type, LAYOUT, Kokkos::HostSpace, \ + Kokkos::View::mag_type, LAYOUT, Kokkos::HostSpace, \ Kokkos::MemoryTraits>, \ Kokkos::View, \ Kokkos::MemoryTraits>, \ 1, true, \ nrm1_eti_spec_avail::mag_type, LAYOUT, \ + Kokkos::View::mag_type, LAYOUT, \ Kokkos::HostSpace, Kokkos::MemoryTraits>, \ Kokkos::View, \ Kokkos::MemoryTraits>>::value> { \ using execution_space = Kokkos::Cuda; \ - using RV = Kokkos::View::mag_type, LAYOUT, Kokkos::HostSpace, \ - Kokkos::MemoryTraits>; \ - using XV = Kokkos::View, \ - Kokkos::MemoryTraits>; \ - using size_type = typename XV::size_type; \ + using RV = Kokkos::View::mag_type, LAYOUT, Kokkos::HostSpace, \ + Kokkos::MemoryTraits>; \ + using XV = Kokkos::View, \ + Kokkos::MemoryTraits>; \ + using size_type = typename XV::size_type; \ \ static void nrm1(const execution_space& space, RV& R, const XV& X) { \ Kokkos::Profiling::pushRegion("KokkosBlas::nrm1[TPL_CUBLAS," #SCALAR "]"); \ @@ -219,35 +219,35 @@ void rocblasAsumWrapper(const ExecutionSpace& space, RViewType& R, const XViewTy KOKKOSBLAS_IMPL_ROCBLAS_SAFE_CALL(rocblas_set_stream(s.handle, NULL)); } -#define KOKKOSBLAS1_NRM1_TPL_SPEC_DECL_ROCBLAS(SCALAR, LAYOUT, MEMSPACE) \ - template <> \ - struct Nrm1::mag_type, LAYOUT, Kokkos::HostSpace, \ - Kokkos::MemoryTraits>, \ - Kokkos::View, \ - Kokkos::MemoryTraits>, \ - 1, true, \ - nrm1_eti_spec_avail::mag_type, LAYOUT, \ - Kokkos::HostSpace, Kokkos::MemoryTraits>, \ - Kokkos::View, \ - Kokkos::MemoryTraits>>::value> { \ - using RV = Kokkos::View::mag_type, LAYOUT, Kokkos::HostSpace, \ - Kokkos::MemoryTraits>; \ - using XV = Kokkos::View, \ - Kokkos::MemoryTraits>; \ - using size_type = typename XV::size_type; \ - \ - static void nrm1(const Kokkos::HIP& space, RV& R, const XV& X) { \ - Kokkos::Profiling::pushRegion("KokkosBlas::nrm1[TPL_ROCBLAS," #SCALAR "]"); \ - const size_type numElems = X.extent(0); \ - if (numElems < static_cast(INT_MAX)) { \ - rocblasAsumWrapper(space, R, X); \ - } else { \ - Nrm1::value>::nrm1(space, R, X); \ - } \ - Kokkos::Profiling::popRegion(); \ - } \ +#define KOKKOSBLAS1_NRM1_TPL_SPEC_DECL_ROCBLAS(SCALAR, LAYOUT, MEMSPACE) \ + template <> \ + struct Nrm1::mag_type, LAYOUT, Kokkos::HostSpace, \ + Kokkos::MemoryTraits>, \ + Kokkos::View, \ + Kokkos::MemoryTraits>, \ + 1, true, \ + nrm1_eti_spec_avail::mag_type, LAYOUT, \ + Kokkos::HostSpace, Kokkos::MemoryTraits>, \ + Kokkos::View, \ + Kokkos::MemoryTraits>>::value> { \ + using RV = Kokkos::View::mag_type, LAYOUT, Kokkos::HostSpace, \ + Kokkos::MemoryTraits>; \ + using XV = Kokkos::View, \ + Kokkos::MemoryTraits>; \ + using size_type = typename XV::size_type; \ + \ + static void nrm1(const Kokkos::HIP& space, RV& R, const XV& X) { \ + Kokkos::Profiling::pushRegion("KokkosBlas::nrm1[TPL_ROCBLAS," #SCALAR "]"); \ + const size_type numElems = X.extent(0); \ + if (numElems < static_cast(INT_MAX)) { \ + rocblasAsumWrapper(space, R, X); \ + } else { \ + Nrm1::value>::nrm1(space, R, X); \ + } \ + Kokkos::Profiling::popRegion(); \ + } \ }; KOKKOSBLAS1_NRM1_TPL_SPEC_DECL_ROCBLAS(float, Kokkos::LayoutLeft, Kokkos::HIPSpace) @@ -309,22 +309,22 @@ void onemklAsumWrapper(const ExecutionSpace& space, RViewType& R, const XViewTyp template <> \ struct Nrm1< \ Kokkos::Experimental::SYCL, \ - Kokkos::View::mag_type, LAYOUT, Kokkos::HostSpace, \ + Kokkos::View::mag_type, LAYOUT, Kokkos::HostSpace, \ Kokkos::MemoryTraits>, \ Kokkos::View, \ Kokkos::MemoryTraits>, \ 1, true, \ nrm1_eti_spec_avail::mag_type, LAYOUT, Kokkos::HostSpace, \ - Kokkos::MemoryTraits>, \ + Kokkos::View::mag_type, LAYOUT, \ + Kokkos::HostSpace, Kokkos::MemoryTraits>, \ Kokkos::View, \ Kokkos::MemoryTraits>>::value> { \ using execution_space = Kokkos::Experimental::SYCL; \ - using RV = Kokkos::View::mag_type, LAYOUT, Kokkos::HostSpace, \ - Kokkos::MemoryTraits>; \ - using XV = Kokkos::View, \ - Kokkos::MemoryTraits>; \ - using size_type = typename XV::size_type; \ + using RV = Kokkos::View::mag_type, LAYOUT, Kokkos::HostSpace, \ + Kokkos::MemoryTraits>; \ + using XV = Kokkos::View, \ + Kokkos::MemoryTraits>; \ + using size_type = typename XV::size_type; \ \ static void nrm1(const execution_space& space, RV& R, const XV& X) { \ Kokkos::Profiling::pushRegion("KokkosBlas::nrm1[TPL_ONEMKL," #SCALAR "]"); \ diff --git a/blas/tpls/KokkosBlas1_nrm2_tpl_spec_avail.hpp b/blas/tpls/KokkosBlas1_nrm2_tpl_spec_avail.hpp index 370bf005d7..ddb4248860 100644 --- a/blas/tpls/KokkosBlas1_nrm2_tpl_spec_avail.hpp +++ b/blas/tpls/KokkosBlas1_nrm2_tpl_spec_avail.hpp @@ -50,15 +50,15 @@ KOKKOSBLAS1_NRM2_TPL_SPEC_AVAIL_BLAS(Kokkos::complex, Kokkos::LayoutLeft, #endif -#define KOKKOSBLAS1_NRM2_TPL_SPEC(SCALAR, LAYOUT, EXECSPACE, MEMSPACE) \ - template <> \ - struct nrm2_tpl_spec_avail::mag_type, LAYOUT, Kokkos::HostSpace, \ - Kokkos::MemoryTraits >, \ - Kokkos::View, \ - Kokkos::MemoryTraits >, \ - 1> { \ - enum : bool { value = true }; \ +#define KOKKOSBLAS1_NRM2_TPL_SPEC(SCALAR, LAYOUT, EXECSPACE, MEMSPACE) \ + template <> \ + struct nrm2_tpl_spec_avail::mag_type, LAYOUT, \ + Kokkos::HostSpace, Kokkos::MemoryTraits >, \ + Kokkos::View, \ + Kokkos::MemoryTraits >, \ + 1> { \ + enum : bool { value = true }; \ }; #define KOKKOSBLAS1_NRM2_TPL_SPEC_AVAIL(LAYOUT, EXECSPACE, MEMSPACE) \ diff --git a/blas/tpls/KokkosBlas1_nrm2_tpl_spec_decl.hpp b/blas/tpls/KokkosBlas1_nrm2_tpl_spec_decl.hpp index 419a8a3236..8f90175853 100644 --- a/blas/tpls/KokkosBlas1_nrm2_tpl_spec_decl.hpp +++ b/blas/tpls/KokkosBlas1_nrm2_tpl_spec_decl.hpp @@ -179,19 +179,20 @@ namespace Impl { ETI_SPEC_AVAIL) \ template <> \ struct Nrm2::mag_type, LAYOUT, Kokkos::HostSpace, \ + Kokkos::View::mag_type, LAYOUT, Kokkos::HostSpace, \ Kokkos::MemoryTraits >, \ Kokkos::View, \ Kokkos::MemoryTraits >, \ 1, true, ETI_SPEC_AVAIL> { \ - using RT = KokkosKernels::ArithTraits::mag_type; \ + using RT = KokkosKernels::ArithTraits::mag_type; \ using RV = Kokkos::View >; \ using XV = Kokkos::View, \ Kokkos::MemoryTraits >; \ using size_type = typename XV::size_type; \ \ static void nrm2(const EXECSPACE& space, RV& R, const XV& X, const bool& take_sqrt) { \ - Kokkos::Profiling::pushRegion("KokkosBlas::nrm2[TPL_CUBLAS," + KokkosKernels::ArithTraits::name() + "]"); \ + Kokkos::Profiling::pushRegion("KokkosBlas::nrm2[TPL_CUBLAS," + KokkosKernels::ArithTraits::name() + \ + "]"); \ const size_type numElems = X.extent(0); \ if (numElems <= static_cast(std::numeric_limits::max())) { \ nrm2_print_specialization(); \ @@ -232,38 +233,39 @@ KOKKOSBLAS1_NRM2_TPL_SPEC_DECL_CUBLAS_EXT(false) namespace KokkosBlas { namespace Impl { -#define KOKKOSBLAS1_NRM2_TPL_SPEC_DECL_ROCBLAS(LAYOUT, KOKKOS_TYPE, TPL_TYPE, EXECSPACE, MEMSPACE, TPL_NRM2, \ - ETI_SPEC_AVAIL) \ - template <> \ - struct Nrm2::mag_type, LAYOUT, Kokkos::HostSpace, \ - Kokkos::MemoryTraits >, \ - Kokkos::View, \ - Kokkos::MemoryTraits >, \ - 1, true, ETI_SPEC_AVAIL> { \ - using RT = KokkosKernels::ArithTraits::mag_type; \ - using RV = Kokkos::View >; \ - using XV = Kokkos::View, \ - Kokkos::MemoryTraits >; \ - using size_type = typename XV::size_type; \ - \ - static void nrm2(const EXECSPACE& space, RV& R, const XV& X, const bool& take_sqrt) { \ - Kokkos::Profiling::pushRegion("KokkosBlas::nrm2[TPL_ROCBLAS," + KokkosKernels::ArithTraits::name() + "]"); \ - const size_type numElems = X.extent(0); \ - if (numElems <= static_cast(std::numeric_limits::max())) { \ - nrm2_print_specialization(); \ - const rocblas_int N = static_cast(numElems); \ - KokkosBlas::Impl::RocBlasSingleton& s = KokkosBlas::Impl::RocBlasSingleton::singleton(); \ - KOKKOSBLAS_IMPL_ROCBLAS_SAFE_CALL(rocblas_set_stream(s.handle, space.hip_stream())); \ - KOKKOSBLAS_IMPL_ROCBLAS_SAFE_CALL( \ - TPL_NRM2(s.handle, N, reinterpret_cast(X.data()), 1, &R())); \ - KOKKOSBLAS_IMPL_ROCBLAS_SAFE_CALL(rocblas_set_stream(s.handle, NULL)); \ - if (!take_sqrt) R() = R() * R(); \ - } else { \ - Nrm2::nrm2(space, R, X, take_sqrt); \ - } \ - Kokkos::Profiling::popRegion(); \ - } \ +#define KOKKOSBLAS1_NRM2_TPL_SPEC_DECL_ROCBLAS(LAYOUT, KOKKOS_TYPE, TPL_TYPE, EXECSPACE, MEMSPACE, TPL_NRM2, \ + ETI_SPEC_AVAIL) \ + template <> \ + struct Nrm2::mag_type, LAYOUT, Kokkos::HostSpace, \ + Kokkos::MemoryTraits >, \ + Kokkos::View, \ + Kokkos::MemoryTraits >, \ + 1, true, ETI_SPEC_AVAIL> { \ + using RT = KokkosKernels::ArithTraits::mag_type; \ + using RV = Kokkos::View >; \ + using XV = Kokkos::View, \ + Kokkos::MemoryTraits >; \ + using size_type = typename XV::size_type; \ + \ + static void nrm2(const EXECSPACE& space, RV& R, const XV& X, const bool& take_sqrt) { \ + Kokkos::Profiling::pushRegion("KokkosBlas::nrm2[TPL_ROCBLAS," + \ + KokkosKernels::ArithTraits::name() + "]"); \ + const size_type numElems = X.extent(0); \ + if (numElems <= static_cast(std::numeric_limits::max())) { \ + nrm2_print_specialization(); \ + const rocblas_int N = static_cast(numElems); \ + KokkosBlas::Impl::RocBlasSingleton& s = KokkosBlas::Impl::RocBlasSingleton::singleton(); \ + KOKKOSBLAS_IMPL_ROCBLAS_SAFE_CALL(rocblas_set_stream(s.handle, space.hip_stream())); \ + KOKKOSBLAS_IMPL_ROCBLAS_SAFE_CALL( \ + TPL_NRM2(s.handle, N, reinterpret_cast(X.data()), 1, &R())); \ + KOKKOSBLAS_IMPL_ROCBLAS_SAFE_CALL(rocblas_set_stream(s.handle, NULL)); \ + if (!take_sqrt) R() = R() * R(); \ + } else { \ + Nrm2::nrm2(space, R, X, take_sqrt); \ + } \ + Kokkos::Profiling::popRegion(); \ + } \ }; #define KOKKOSBLAS1_NRM2_TPL_SPEC_DECL_ROCBLAS_EXT(ETI_SPEC_AVAIL) \ @@ -292,34 +294,35 @@ KOKKOSBLAS1_NRM2_TPL_SPEC_DECL_ROCBLAS_EXT(false) namespace KokkosBlas { namespace Impl { -#define KOKKOSBLAS1_NRM2_TPL_SPEC_DECL_ONEMKL(LAYOUT, KOKKOS_TYPE, TPL_TYPE, EXECSPACE, MEMSPACE, TPL_NRM2, \ - ETI_SPEC_AVAIL) \ - template <> \ - struct Nrm2::mag_type, LAYOUT, Kokkos::HostSpace, \ - Kokkos::MemoryTraits >, \ - Kokkos::View, \ - Kokkos::MemoryTraits >, \ - 1, true, ETI_SPEC_AVAIL> { \ - using RT = KokkosKernels::ArithTraits::mag_type; \ - using RV = Kokkos::View >; \ - using XV = Kokkos::View, \ - Kokkos::MemoryTraits >; \ - using size_type = typename XV::size_type; \ - \ - static void nrm2(const EXECSPACE& space, RV& R, const XV& X, const bool& take_sqrt) { \ - Kokkos::Profiling::pushRegion("KokkosBlas::nrm2[TPL_ONEMKL," + KokkosKernels::ArithTraits::name() + "]"); \ - const size_type numElems = X.extent(0); \ - if (numElems <= static_cast(std::numeric_limits::max())) { \ - nrm2_print_specialization(); \ - const std::int64_t N = static_cast(numElems); \ - TPL_NRM2(space.sycl_queue(), N, reinterpret_cast(X.data()), 1, &R()); \ - if (!take_sqrt) R() = R() * R(); \ - } else { \ - Nrm2::nrm2(space, R, X, take_sqrt); \ - } \ - Kokkos::Profiling::popRegion(); \ - } \ +#define KOKKOSBLAS1_NRM2_TPL_SPEC_DECL_ONEMKL(LAYOUT, KOKKOS_TYPE, TPL_TYPE, EXECSPACE, MEMSPACE, TPL_NRM2, \ + ETI_SPEC_AVAIL) \ + template <> \ + struct Nrm2::mag_type, LAYOUT, Kokkos::HostSpace, \ + Kokkos::MemoryTraits >, \ + Kokkos::View, \ + Kokkos::MemoryTraits >, \ + 1, true, ETI_SPEC_AVAIL> { \ + using RT = KokkosKernels::ArithTraits::mag_type; \ + using RV = Kokkos::View >; \ + using XV = Kokkos::View, \ + Kokkos::MemoryTraits >; \ + using size_type = typename XV::size_type; \ + \ + static void nrm2(const EXECSPACE& space, RV& R, const XV& X, const bool& take_sqrt) { \ + Kokkos::Profiling::pushRegion("KokkosBlas::nrm2[TPL_ONEMKL," + KokkosKernels::ArithTraits::name() + \ + "]"); \ + const size_type numElems = X.extent(0); \ + if (numElems <= static_cast(std::numeric_limits::max())) { \ + nrm2_print_specialization(); \ + const std::int64_t N = static_cast(numElems); \ + TPL_NRM2(space.sycl_queue(), N, reinterpret_cast(X.data()), 1, &R()); \ + if (!take_sqrt) R() = R() * R(); \ + } else { \ + Nrm2::nrm2(space, R, X, take_sqrt); \ + } \ + Kokkos::Profiling::popRegion(); \ + } \ }; #define KOKKOSBLAS1_NRM2_TPL_SPEC_DECL_ONEMKL_EXT(ETI_SPEC_AVAIL) \ diff --git a/blas/tpls/KokkosBlas1_rot_tpl_spec_avail.hpp b/blas/tpls/KokkosBlas1_rot_tpl_spec_avail.hpp index c1c24fe032..077e23c058 100644 --- a/blas/tpls/KokkosBlas1_rot_tpl_spec_avail.hpp +++ b/blas/tpls/KokkosBlas1_rot_tpl_spec_avail.hpp @@ -38,7 +38,7 @@ namespace Impl { EXECSPACE, \ Kokkos::View, \ Kokkos::MemoryTraits>, \ - Kokkos::View::mag_type, LAYOUT, \ + Kokkos::View::mag_type, LAYOUT, \ Kokkos::Device, Kokkos::MemoryTraits>, \ Kokkos::View, \ Kokkos::MemoryTraits>> { \ @@ -62,15 +62,15 @@ KOKKOSBLAS1_ROT_TPL_SPEC_AVAIL_BLAS(Kokkos::complex, Kokkos::LayoutLeft, // cuBLAS #ifdef KOKKOSKERNELS_ENABLE_TPL_CUBLAS -#define KOKKOSBLAS1_ROT_TPL_SPEC_AVAIL_CUBLAS(SCALAR, LAYOUT, EXECSPACE, MEMSPACE) \ - template <> \ - struct rot_tpl_spec_avail< \ - EXECSPACE, \ - Kokkos::View, Kokkos::MemoryTraits>, \ - Kokkos::View::mag_type, LAYOUT, Kokkos::Device, \ - Kokkos::MemoryTraits>, \ - Kokkos::View, Kokkos::MemoryTraits>> { \ - enum : bool { value = true }; \ +#define KOKKOSBLAS1_ROT_TPL_SPEC_AVAIL_CUBLAS(SCALAR, LAYOUT, EXECSPACE, MEMSPACE) \ + template <> \ + struct rot_tpl_spec_avail< \ + EXECSPACE, \ + Kokkos::View, Kokkos::MemoryTraits>, \ + Kokkos::View::mag_type, LAYOUT, Kokkos::Device, \ + Kokkos::MemoryTraits>, \ + Kokkos::View, Kokkos::MemoryTraits>> { \ + enum : bool { value = true }; \ }; KOKKOSBLAS1_ROT_TPL_SPEC_AVAIL_CUBLAS(double, Kokkos::LayoutLeft, Kokkos::Cuda, Kokkos::CudaSpace) diff --git a/blas/tpls/KokkosBlas1_rotg_tpl_spec_avail.hpp b/blas/tpls/KokkosBlas1_rotg_tpl_spec_avail.hpp index 16ac7a3679..5c18a85c77 100644 --- a/blas/tpls/KokkosBlas1_rotg_tpl_spec_avail.hpp +++ b/blas/tpls/KokkosBlas1_rotg_tpl_spec_avail.hpp @@ -32,14 +32,14 @@ namespace Impl { // Generic Host side BLAS (could be MKL or whatever) #ifdef KOKKOSKERNELS_ENABLE_TPL_BLAS -#define KOKKOSBLAS1_ROTG_TPL_SPEC_AVAIL_BLAS(SCALAR, LAYOUT, EXECSPACE, MEMSPACE) \ - template <> \ - struct rotg_tpl_spec_avail< \ - EXECSPACE, \ - Kokkos::View, Kokkos::MemoryTraits>, \ - Kokkos::View::mag_type, LAYOUT, Kokkos::Device, \ - Kokkos::MemoryTraits>> { \ - enum : bool { value = true }; \ +#define KOKKOSBLAS1_ROTG_TPL_SPEC_AVAIL_BLAS(SCALAR, LAYOUT, EXECSPACE, MEMSPACE) \ + template <> \ + struct rotg_tpl_spec_avail< \ + EXECSPACE, \ + Kokkos::View, Kokkos::MemoryTraits>, \ + Kokkos::View::mag_type, LAYOUT, Kokkos::Device, \ + Kokkos::MemoryTraits>> { \ + enum : bool { value = true }; \ }; #ifdef KOKKOS_ENABLE_SERIAL @@ -72,7 +72,7 @@ KOKKOSBLAS1_ROTG_TPL_SPEC_AVAIL_BLAS(Kokkos::complex, Kokkos::LayoutRight struct rotg_tpl_spec_avail< \ EXECSPACE, \ Kokkos::View, Kokkos::MemoryTraits>, \ - Kokkos::View::mag_type, LAYOUT, Kokkos::Device, \ + Kokkos::View::mag_type, LAYOUT, Kokkos::Device, \ Kokkos::MemoryTraits>> { \ enum : bool { value = true }; \ }; @@ -103,7 +103,7 @@ KOKKOSBLAS1_ROTG_TPL_SPEC_AVAIL_CUBLAS(Kokkos::complex, Kokkos::LayoutRig struct rotg_tpl_spec_avail< \ EXECSPACE, \ Kokkos::View, Kokkos::MemoryTraits>, \ - Kokkos::View::mag_type, LAYOUT, Kokkos::Device, \ + Kokkos::View::mag_type, LAYOUT, Kokkos::Device, \ Kokkos::MemoryTraits>> { \ enum : bool { value = true }; \ }; diff --git a/blas/tpls/KokkosBlas2_gemv_tpl_spec_decl.hpp b/blas/tpls/KokkosBlas2_gemv_tpl_spec_decl.hpp index bef3d07d97..5f77f54369 100644 --- a/blas/tpls/KokkosBlas2_gemv_tpl_spec_decl.hpp +++ b/blas/tpls/KokkosBlas2_gemv_tpl_spec_decl.hpp @@ -623,48 +623,48 @@ struct kokkos_to_std_type_map { using type = std::complex::mag_type>; }; -#define KOKKOSBLAS2_GEMV_ONEMKL(SCALAR, LAYOUT, MEM_SPACE, ETI_SPEC_AVAIL) \ - template \ - struct GEMV, \ - Kokkos::MemoryTraits >, \ - Kokkos::View, \ - Kokkos::MemoryTraits >, \ - Kokkos::View, \ - Kokkos::MemoryTraits >, \ - true, ETI_SPEC_AVAIL> { \ - using device_type = Kokkos::Device; \ - using mem_traits = Kokkos::MemoryTraits; \ - using AViewType = Kokkos::View; \ - using XViewType = Kokkos::View; \ - using YViewType = Kokkos::View; \ - \ - static void gemv(const ExecSpace& exec, const char kk_trans[], typename AViewType::const_value_type& alpha, \ - const AViewType& A, const XViewType& X, typename YViewType::const_value_type& beta, \ - const YViewType& Y) { \ +#define KOKKOSBLAS2_GEMV_ONEMKL(SCALAR, LAYOUT, MEM_SPACE, ETI_SPEC_AVAIL) \ + template \ + struct GEMV, \ + Kokkos::MemoryTraits >, \ + Kokkos::View, \ + Kokkos::MemoryTraits >, \ + Kokkos::View, \ + Kokkos::MemoryTraits >, \ + true, ETI_SPEC_AVAIL> { \ + using device_type = Kokkos::Device; \ + using mem_traits = Kokkos::MemoryTraits; \ + using AViewType = Kokkos::View; \ + using XViewType = Kokkos::View; \ + using YViewType = Kokkos::View; \ + \ + static void gemv(const ExecSpace& exec, const char kk_trans[], typename AViewType::const_value_type& alpha, \ + const AViewType& A, const XViewType& X, typename YViewType::const_value_type& beta, \ + const YViewType& Y) { \ if (beta == KokkosKernels::ArithTraits::zero()) { \ Kokkos::deep_copy(Y, KokkosKernels::ArithTraits::zero()); \ - } \ - \ - bool row_major = std::is_same::value; \ - const std::int64_t M = A.extent(0); \ - const std::int64_t N = A.extent(1); \ - oneapi::mkl::transpose trans = mode_kk_to_onemkl(kk_trans[0]); \ - const std::int64_t LDA = row_major ? A.stride(0) : A.stride(1); \ + } \ + \ + bool row_major = std::is_same::value; \ + const std::int64_t M = A.extent(0); \ + const std::int64_t N = A.extent(1); \ + oneapi::mkl::transpose trans = mode_kk_to_onemkl(kk_trans[0]); \ + const std::int64_t LDA = row_major ? A.stride(0) : A.stride(1); \ std::string label = "KokkosBlas::gemv[TPL_ONEMKL," + KokkosKernels::ArithTraits::name() + "]"; \ - \ - Kokkos::Profiling::pushRegion(label); \ + \ + Kokkos::Profiling::pushRegion(label); \ using mag_type = kokkos_to_std_type_map::is_complex>::type; \ - const mag_type* a = reinterpret_cast(A.data()); \ - const mag_type* x = reinterpret_cast(X.data()); \ - mag_type* y = reinterpret_cast(Y.data()); \ - if (row_major) { \ - oneapi::mkl::blas::row_major::gemv(exec.sycl_queue(), trans, M, N, alpha, a, LDA, x, 1, beta, y, 1); \ - } else { \ - oneapi::mkl::blas::column_major::gemv(exec.sycl_queue(), trans, M, N, alpha, a, LDA, x, 1, beta, y, 1); \ - } \ - Kokkos::Profiling::popRegion(); \ - } \ + const mag_type* a = reinterpret_cast(A.data()); \ + const mag_type* x = reinterpret_cast(X.data()); \ + mag_type* y = reinterpret_cast(Y.data()); \ + if (row_major) { \ + oneapi::mkl::blas::row_major::gemv(exec.sycl_queue(), trans, M, N, alpha, a, LDA, x, 1, beta, y, 1); \ + } else { \ + oneapi::mkl::blas::column_major::gemv(exec.sycl_queue(), trans, M, N, alpha, a, LDA, x, 1, beta, y, 1); \ + } \ + Kokkos::Profiling::popRegion(); \ + } \ }; KOKKOSBLAS2_GEMV_ONEMKL(float, Kokkos::LayoutLeft, Kokkos::Experimental::SYCLDeviceUSMSpace, true) diff --git a/blas/unit_test/Test_Blas1_axpby.hpp b/blas/unit_test/Test_Blas1_axpby.hpp index 99a0ad05f9..db513670d8 100644 --- a/blas/unit_test/Test_Blas1_axpby.hpp +++ b/blas/unit_test/Test_Blas1_axpby.hpp @@ -31,11 +31,11 @@ void impl_test_axpby(int N) { ScalarB b = 5; // eps should probably be based on ScalarB since that is the type // in which the result is computed. - const MagnitudeB eps = KokkosKernels::ArithTraits::epsilon(); - const MagnitudeB max_val = 10; - const MagnitudeB max_error = - (static_cast(KokkosKernels::ArithTraits::abs(a)) + KokkosKernels::ArithTraits::abs(b)) * max_val * - eps; + const MagnitudeB eps = KokkosKernels::ArithTraits::epsilon(); + const MagnitudeB max_val = 10; + const MagnitudeB max_error = (static_cast(KokkosKernels::ArithTraits::abs(a)) + + KokkosKernels::ArithTraits::abs(b)) * + max_val * eps; view_stride_adapter x("X", N); view_stride_adapter y("Y", N); @@ -79,13 +79,13 @@ void impl_test_axpby_mv(int N, int K) { view_stride_adapter y("Y", N, K); view_stride_adapter org_y("Org_Y", N, K); - ScalarA a = 3; - ScalarB b = 5; - const MagnitudeB eps = KokkosKernels::ArithTraits::epsilon(); - const MagnitudeB max_val = 10; - const MagnitudeB max_error = - (static_cast(KokkosKernels::ArithTraits::abs(a)) + KokkosKernels::ArithTraits::abs(b)) * max_val * - eps; + ScalarA a = 3; + ScalarB b = 5; + const MagnitudeB eps = KokkosKernels::ArithTraits::epsilon(); + const MagnitudeB max_val = 10; + const MagnitudeB max_error = (static_cast(KokkosKernels::ArithTraits::abs(a)) + + KokkosKernels::ArithTraits::abs(b)) * + max_val * eps; Kokkos::Random_XorShift64_Pool rand_pool(13718); diff --git a/common/src/KokkosKernels_Predicates.hpp b/common/src/KokkosKernels_Predicates.hpp index b53e7c826a..e750f93621 100644 --- a/common/src/KokkosKernels_Predicates.hpp +++ b/common/src/KokkosKernels_Predicates.hpp @@ -32,7 +32,8 @@ namespace KokkosKernels { template struct GT { using value_type = T; - static_assert(!KokkosKernels::ArithTraits::is_complex, "Please define custom predicates for ordering complex types"); + static_assert(!KokkosKernels::ArithTraits::is_complex, + "Please define custom predicates for ordering complex types"); /** * @brief Return true if a is greater than b @@ -50,7 +51,8 @@ struct GT { template struct GTE { using value_type = T; - static_assert(!KokkosKernels::ArithTraits::is_complex, "Please define custom predicates for ordering complex types"); + static_assert(!KokkosKernels::ArithTraits::is_complex, + "Please define custom predicates for ordering complex types"); /// \brief return a >= b KOKKOS_INLINE_FUNCTION constexpr bool operator()(const value_type &a, const value_type &b) const noexcept { @@ -64,7 +66,8 @@ struct GTE { template struct LT { using value_type = T; - static_assert(!KokkosKernels::ArithTraits::is_complex, "Please define custom predicates for ordering complex types"); + static_assert(!KokkosKernels::ArithTraits::is_complex, + "Please define custom predicates for ordering complex types"); /// \brief return a < b KOKKOS_INLINE_FUNCTION constexpr bool operator()(const value_type &a, const value_type &b) const noexcept { @@ -78,7 +81,8 @@ struct LT { template struct LTE { using value_type = T; - static_assert(!KokkosKernels::ArithTraits::is_complex, "Please define custom predicates for ordering complex types"); + static_assert(!KokkosKernels::ArithTraits::is_complex, + "Please define custom predicates for ordering complex types"); /// \brief return a <= b KOKKOS_INLINE_FUNCTION constexpr bool operator()(const value_type &a, const value_type &b) const noexcept { diff --git a/common/src/Kokkos_ArithTraits.hpp b/common/src/Kokkos_ArithTraits.hpp index a6441d16a1..d15e6255f1 100644 --- a/common/src/Kokkos_ArithTraits.hpp +++ b/common/src/Kokkos_ArithTraits.hpp @@ -1099,6 +1099,7 @@ class ArithTraits> { #else static bool isInf(const std::complex& x) { KOKKOS_IF_ON_HOST((using std::isinf;)) + KOKKOS_IF_ON_DEVICE((using Kokkos::isinf;)) return isinf(real(x)) || isinf(imag(x)); } #endif @@ -1118,6 +1119,7 @@ class ArithTraits> { #else static bool isNan(const std::complex& x) { KOKKOS_IF_ON_HOST((using std::isnan;)) + KOKKOS_IF_ON_DEVICE((using Kokkos::isnan;)) return isnan(real(x)) || isnan(imag(x)); } #endif diff --git a/common/src/Kokkos_InnerProductSpaceTraits.hpp b/common/src/Kokkos_InnerProductSpaceTraits.hpp index 3e121dea23..64f79f9a85 100644 --- a/common/src/Kokkos_InnerProductSpaceTraits.hpp +++ b/common/src/Kokkos_InnerProductSpaceTraits.hpp @@ -125,7 +125,9 @@ class InnerProductSpaceTraits { typedef val_type dot_type; //! The "norm" (absolute value or magnitude) of a value x of type val_type. - static KOKKOS_FORCEINLINE_FUNCTION mag_type norm(const val_type& x) { return KokkosKernels::ArithTraits::abs(x); } + static KOKKOS_FORCEINLINE_FUNCTION mag_type norm(const val_type& x) { + return KokkosKernels::ArithTraits::abs(x); + } /// \brief The "dot product" of two values x and y of type val_type. /// /// This default implementation should suffice unless val_type is @@ -156,7 +158,9 @@ class InnerProductSpaceTraits> { typedef typename KokkosKernels::ArithTraits::mag_type mag_type; typedef val_type dot_type; - static KOKKOS_FORCEINLINE_FUNCTION mag_type norm(const val_type& x) { return KokkosKernels::ArithTraits::abs(x); } + static KOKKOS_FORCEINLINE_FUNCTION mag_type norm(const val_type& x) { + return KokkosKernels::ArithTraits::abs(x); + } static KOKKOS_FORCEINLINE_FUNCTION dot_type dot(const val_type& x, const val_type& y) { return Kokkos::conj(x) * y; } }; diff --git a/common/unit_test/Test_Common_ArithTraits.hpp b/common/unit_test/Test_Common_ArithTraits.hpp index c55a196a84..3ea1b52783 100644 --- a/common/unit_test/Test_Common_ArithTraits.hpp +++ b/common/unit_test/Test_Common_ArithTraits.hpp @@ -1155,7 +1155,8 @@ class ArithTraitsTesterFloatingPointBase : public ArithTraitsTesterComplexBase::is_complex> { private: //! The base class of this class. - typedef ArithTraitsTesterComplexBase::is_complex> base_type; + typedef ArithTraitsTesterComplexBase::is_complex> + base_type; public: typedef DeviceType execution_space; @@ -1181,7 +1182,8 @@ class ArithTraitsTesterFloatingPointBase : public ArithTraitsTesterComplexBase::is_complex> { private: //! The base class of this class. - typedef ArithTraitsTesterComplexBase::is_complex> base_type; + typedef ArithTraitsTesterComplexBase::is_complex> + base_type; public: typedef typename DeviceType::execution_space execution_space; @@ -1340,7 +1342,8 @@ class ArithTraitsTesterFloatingPointBase : public ArithTraitsTesterComplexBase::is_complex> { private: //! The base class of this class. - typedef ArithTraitsTesterComplexBase::is_complex> base_type; + typedef ArithTraitsTesterComplexBase::is_complex> + base_type; public: typedef typename DeviceType::execution_space execution_space; diff --git a/lapack/impl/KokkosLapack_svd_spec.hpp b/lapack/impl/KokkosLapack_svd_spec.hpp index 00b596c78e..89e329d250 100644 --- a/lapack/impl/KokkosLapack_svd_spec.hpp +++ b/lapack/impl/KokkosLapack_svd_spec.hpp @@ -48,7 +48,7 @@ struct svd_eti_spec_avail { EXEC_SPACE_TYPE, \ Kokkos::View, \ Kokkos::MemoryTraits>, \ - Kokkos::View::mag_type *, Kokkos::LayoutLeft, \ + Kokkos::View::mag_type *, Kokkos::LayoutLeft, \ Kokkos::Device, Kokkos::MemoryTraits>, \ Kokkos::View, \ Kokkos::MemoryTraits>, \ @@ -106,7 +106,7 @@ struct SVD, \ Kokkos::MemoryTraits>, \ - Kokkos::View::mag_type *, Kokkos::LayoutLeft, \ + Kokkos::View::mag_type *, Kokkos::LayoutLeft, \ Kokkos::Device, Kokkos::MemoryTraits>, \ Kokkos::View, \ Kokkos::MemoryTraits>, \ @@ -119,7 +119,7 @@ struct SVD, \ Kokkos::MemoryTraits>, \ - Kokkos::View::mag_type *, Kokkos::LayoutLeft, \ + Kokkos::View::mag_type *, Kokkos::LayoutLeft, \ Kokkos::Device, Kokkos::MemoryTraits>, \ Kokkos::View, \ Kokkos::MemoryTraits>, \ diff --git a/lapack/tpls/KokkosLapack_Host_tpl.hpp b/lapack/tpls/KokkosLapack_Host_tpl.hpp index 669076fc91..d467cf4383 100644 --- a/lapack/tpls/KokkosLapack_Host_tpl.hpp +++ b/lapack/tpls/KokkosLapack_Host_tpl.hpp @@ -33,8 +33,8 @@ struct HostLapack { static void gesv(int n, int rhs, T *a, int lda, int *ipiv, T *b, int ldb, int info); static void gesvd(const char jobu, const char jobvt, const int m, const int n, T *A, const int lda, - typename KokkosKernels::ArithTraits::mag_type *S, T *U, const int ldu, T *Vt, const int ldvt, T *work, - int lwork, typename KokkosKernels::ArithTraits::mag_type *rwork, int info); + typename KokkosKernels::ArithTraits::mag_type *S, T *U, const int ldu, T *Vt, const int ldvt, + T *work, int lwork, typename KokkosKernels::ArithTraits::mag_type *rwork, int info); static int trtri(const char uplo, const char diag, int n, const T *a, int lda); }; diff --git a/lapack/tpls/KokkosLapack_gesv_tpl_spec_decl.hpp b/lapack/tpls/KokkosLapack_gesv_tpl_spec_decl.hpp index 6c2f9ea9bd..f4eee3310e 100644 --- a/lapack/tpls/KokkosLapack_gesv_tpl_spec_decl.hpp +++ b/lapack/tpls/KokkosLapack_gesv_tpl_spec_decl.hpp @@ -138,7 +138,8 @@ template void magmaGesvWrapper(const ExecSpace& space, const AViewType& A, const BViewType& B, const IPIVViewType& IPIV) { using scalar_type = typename AViewType::non_const_value_type; - Kokkos::Profiling::pushRegion("KokkosLapack::gesv[TPL_MAGMA," + KokkosKernels::ArithTraits::name() + "]"); + Kokkos::Profiling::pushRegion("KokkosLapack::gesv[TPL_MAGMA," + KokkosKernels::ArithTraits::name() + + "]"); gesv_print_specialization(); const bool with_pivot = !((IPIV.extent(0) == 0) && (IPIV.data() == nullptr)); diff --git a/lapack/tpls/KokkosLapack_svd_tpl_spec_avail.hpp b/lapack/tpls/KokkosLapack_svd_tpl_spec_avail.hpp index 2a775396d6..9c6e07b7dc 100644 --- a/lapack/tpls/KokkosLapack_svd_tpl_spec_avail.hpp +++ b/lapack/tpls/KokkosLapack_svd_tpl_spec_avail.hpp @@ -33,7 +33,7 @@ struct svd_tpl_spec_avail { EXECSPACE, \ Kokkos::View, \ Kokkos::MemoryTraits>, \ - Kokkos::View::mag_type*, Kokkos::LayoutLeft, \ + Kokkos::View::mag_type*, Kokkos::LayoutLeft, \ Kokkos::Device, Kokkos::MemoryTraits>, \ Kokkos::View, \ Kokkos::MemoryTraits>, \ @@ -72,8 +72,8 @@ KOKKOSLAPACK_SVD_TPL_SPEC_AVAIL_LAPACK(Kokkos::complex, Kokkos::LayoutLe struct svd_tpl_spec_avail< \ Kokkos::Cuda, \ Kokkos::View, Kokkos::MemoryTraits>, \ - Kokkos::View::mag_type*, Kokkos::LayoutLeft, Kokkos::Device, \ - Kokkos::MemoryTraits>, \ + Kokkos::View::mag_type*, Kokkos::LayoutLeft, \ + Kokkos::Device, Kokkos::MemoryTraits>, \ Kokkos::View, Kokkos::MemoryTraits>, \ Kokkos::View, \ Kokkos::MemoryTraits>> { \ @@ -100,8 +100,8 @@ KOKKOSLAPACK_SVD_TPL_SPEC_AVAIL_CUSOLVER(Kokkos::complex, Kokkos::Layout struct svd_tpl_spec_avail< \ Kokkos::HIP, \ Kokkos::View, Kokkos::MemoryTraits>, \ - Kokkos::View::mag_type*, Kokkos::LayoutLeft, Kokkos::Device, \ - Kokkos::MemoryTraits>, \ + Kokkos::View::mag_type*, Kokkos::LayoutLeft, \ + Kokkos::Device, Kokkos::MemoryTraits>, \ Kokkos::View, Kokkos::MemoryTraits>, \ Kokkos::View, \ Kokkos::MemoryTraits>> { \ diff --git a/lapack/tpls/KokkosLapack_svd_tpl_spec_decl.hpp b/lapack/tpls/KokkosLapack_svd_tpl_spec_decl.hpp index 8a2d155c6b..e66b1f370a 100644 --- a/lapack/tpls/KokkosLapack_svd_tpl_spec_decl.hpp +++ b/lapack/tpls/KokkosLapack_svd_tpl_spec_decl.hpp @@ -105,7 +105,7 @@ void lapackSvdWrapper(const ExecutionSpace& /* space */, const char jobu[], cons struct SVD, \ Kokkos::MemoryTraits>, \ - Kokkos::View::mag_type*, Kokkos::LayoutLeft, \ + Kokkos::View::mag_type*, Kokkos::LayoutLeft, \ Kokkos::Device, Kokkos::MemoryTraits>, \ Kokkos::View, \ Kokkos::MemoryTraits>, \ @@ -116,7 +116,7 @@ void lapackSvdWrapper(const ExecutionSpace& /* space */, const char jobu[], cons EXEC_SPACE, \ Kokkos::View, \ Kokkos::MemoryTraits>, \ - Kokkos::View::mag_type*, Kokkos::LayoutLeft, \ + Kokkos::View::mag_type*, Kokkos::LayoutLeft, \ Kokkos::Device, Kokkos::MemoryTraits>, \ Kokkos::View, \ Kokkos::MemoryTraits>, \ @@ -125,7 +125,7 @@ void lapackSvdWrapper(const ExecutionSpace& /* space */, const char jobu[], cons using AMatrix = Kokkos::View, \ Kokkos::MemoryTraits>; \ using SVector = \ - Kokkos::View::mag_type*, Kokkos::LayoutLeft, \ + Kokkos::View::mag_type*, Kokkos::LayoutLeft, \ Kokkos::Device, Kokkos::MemoryTraits>; \ using UMatrix = Kokkos::View, \ Kokkos::MemoryTraits>; \ @@ -229,7 +229,7 @@ void mklSvdWrapper(const ExecutionSpace& /* space */, const char jobu[], const c struct SVD, \ Kokkos::MemoryTraits>, \ - Kokkos::View::mag_type*, Kokkos::LayoutLeft, \ + Kokkos::View::mag_type*, Kokkos::LayoutLeft, \ Kokkos::Device, Kokkos::MemoryTraits>, \ Kokkos::View, \ Kokkos::MemoryTraits>, \ @@ -240,7 +240,7 @@ void mklSvdWrapper(const ExecutionSpace& /* space */, const char jobu[], const c EXEC_SPACE, \ Kokkos::View, \ Kokkos::MemoryTraits>, \ - Kokkos::View::mag_type*, Kokkos::LayoutLeft, \ + Kokkos::View::mag_type*, Kokkos::LayoutLeft, \ Kokkos::Device, Kokkos::MemoryTraits>, \ Kokkos::View, \ Kokkos::MemoryTraits>, \ @@ -249,7 +249,7 @@ void mklSvdWrapper(const ExecutionSpace& /* space */, const char jobu[], const c using AMatrix = Kokkos::View, \ Kokkos::MemoryTraits>; \ using SVector = \ - Kokkos::View::mag_type*, Kokkos::LayoutLeft, \ + Kokkos::View::mag_type*, Kokkos::LayoutLeft, \ Kokkos::Device, Kokkos::MemoryTraits>; \ using UMatrix = Kokkos::View, \ Kokkos::MemoryTraits>; \ @@ -369,7 +369,7 @@ void cusolverSvdWrapper(const ExecutionSpace& space, const char jobu[], const ch struct SVD, \ Kokkos::MemoryTraits>, \ - Kokkos::View::mag_type*, Kokkos::LayoutLeft, \ + Kokkos::View::mag_type*, Kokkos::LayoutLeft, \ Kokkos::Device, Kokkos::MemoryTraits>, \ Kokkos::View, \ Kokkos::MemoryTraits>, \ @@ -380,7 +380,7 @@ void cusolverSvdWrapper(const ExecutionSpace& space, const char jobu[], const ch Kokkos::Cuda, \ Kokkos::View, \ Kokkos::MemoryTraits>, \ - Kokkos::View::mag_type*, Kokkos::LayoutLeft, \ + Kokkos::View::mag_type*, Kokkos::LayoutLeft, \ Kokkos::Device, Kokkos::MemoryTraits>, \ Kokkos::View, \ Kokkos::MemoryTraits>, \ @@ -388,7 +388,7 @@ void cusolverSvdWrapper(const ExecutionSpace& space, const char jobu[], const ch Kokkos::MemoryTraits>>::value> { \ using AMatrix = Kokkos::View, \ Kokkos::MemoryTraits>; \ - using SVector = Kokkos::View::mag_type*, Kokkos::LayoutLeft, \ + using SVector = Kokkos::View::mag_type*, Kokkos::LayoutLeft, \ Kokkos::Device, Kokkos::MemoryTraits>; \ using UMatrix = Kokkos::View, \ Kokkos::MemoryTraits>; \ @@ -506,8 +506,8 @@ void rocsolverSvdWrapper(const ExecutionSpace& space, const char jobu[], const c struct SVD< \ Kokkos::HIP, \ Kokkos::View, Kokkos::MemoryTraits>, \ - Kokkos::View::mag_type*, Kokkos::LayoutLeft, Kokkos::Device, \ - Kokkos::MemoryTraits>, \ + Kokkos::View::mag_type*, Kokkos::LayoutLeft, \ + Kokkos::Device, Kokkos::MemoryTraits>, \ Kokkos::View, Kokkos::MemoryTraits>, \ Kokkos::View, Kokkos::MemoryTraits>, \ true, \ @@ -515,7 +515,7 @@ void rocsolverSvdWrapper(const ExecutionSpace& space, const char jobu[], const c Kokkos::HIP, \ Kokkos::View, \ Kokkos::MemoryTraits>, \ - Kokkos::View::mag_type*, Kokkos::LayoutLeft, \ + Kokkos::View::mag_type*, Kokkos::LayoutLeft, \ Kokkos::Device, Kokkos::MemoryTraits>, \ Kokkos::View, \ Kokkos::MemoryTraits>, \ @@ -523,7 +523,7 @@ void rocsolverSvdWrapper(const ExecutionSpace& space, const char jobu[], const c Kokkos::MemoryTraits>>::value> { \ using AMatrix = Kokkos::View, \ Kokkos::MemoryTraits>; \ - using SVector = Kokkos::View::mag_type*, Kokkos::LayoutLeft, \ + using SVector = Kokkos::View::mag_type*, Kokkos::LayoutLeft, \ Kokkos::Device, Kokkos::MemoryTraits>; \ using UMatrix = Kokkos::View, \ Kokkos::MemoryTraits>; \ diff --git a/perf_test/batched/dense/do-not-use/KokkosBatched_Test_Gemv_Host.hpp b/perf_test/batched/dense/do-not-use/KokkosBatched_Test_Gemv_Host.hpp index 2962d8d132..98bb6744c3 100644 --- a/perf_test/batched/dense/do-not-use/KokkosBatched_Test_Gemv_Host.hpp +++ b/perf_test/batched/dense/do-not-use/KokkosBatched_Test_Gemv_Host.hpp @@ -259,7 +259,8 @@ void Gemv(const int NN) { for (int i = 0, iend = yref.extent(0); i < iend; ++i) for (int j = 0, jend = yref.extent(1); j < jend; ++j) for (int k = 0, kend = yref.extent(2); k < kend; ++k) - diff += KokkosKernels::ArithTraits::abs(yref(i, j, k) - y(i / VectorLength, j, k)[i % VectorLength]); + diff += KokkosKernels::ArithTraits::abs(yref(i, j, k) - + y(i / VectorLength, j, k)[i % VectorLength]); std::cout << std::setw(12) << "Serial SIMD" << " BlkSize = " << std::setw(3) << BlkSize << " NumVecs = " << std::setw(3) << NumVecs diff --git a/perf_test/batched/dense/do-not-use/KokkosBatched_Test_Trsm_Host.hpp b/perf_test/batched/dense/do-not-use/KokkosBatched_Test_Trsm_Host.hpp index 1b4c8c2723..53f2c465f1 100644 --- a/perf_test/batched/dense/do-not-use/KokkosBatched_Test_Trsm_Host.hpp +++ b/perf_test/batched/dense/do-not-use/KokkosBatched_Test_Trsm_Host.hpp @@ -200,7 +200,8 @@ void Trsm(const int NN) { double sum = 0; for (int i = 0, iend = b.extent(0); i < iend; ++i) for (int j = 0, jend = b.extent(1); j < jend; ++j) - for (int k = 0, kend = b.extent(2); k < kend; ++k) sum += KokkosKernels::ArithTraits::abs(bmat(i, j, k)); + for (int k = 0, kend = b.extent(2); k < kend; ++k) + sum += KokkosKernels::ArithTraits::abs(bmat(i, j, k)); std::cout << std::setw(10) << "MKL TRSM" << " BlkSize = " << std::setw(3) << BlkSize << " NumCols = " << std::setw(3) << NumCols @@ -416,7 +417,8 @@ void Trsm(const int NN) { for (int i = 0, iend = bref.extent(0); i < iend; ++i) for (int j = 0, jend = bref.extent(1); j < jend; ++j) for (int k = 0, kend = bref.extent(2); k < kend; ++k) - diff += KokkosKernels::ArithTraits::abs(bref(i, j, k) - b(i / VectorLength, j, k)[i % VectorLength]); + diff += KokkosKernels::ArithTraits::abs(bref(i, j, k) - + b(i / VectorLength, j, k)[i % VectorLength]); std::cout << std::setw(10) << "MKL Cmpt" << " BlkSize = " << std::setw(3) << BlkSize << " NumCols = " << std::setw(3) << NumCols @@ -566,7 +568,8 @@ void Trsm(const int NN) { for (int i = 0, iend = bref.extent(0); i < iend; ++i) for (int j = 0, jend = bref.extent(1); j < jend; ++j) for (int k = 0, kend = bref.extent(2); k < kend; ++k) - diff += KokkosKernels::ArithTraits::abs(bref(i, j, k) - b(i / VectorLength, j, k)[i % VectorLength]); + diff += KokkosKernels::ArithTraits::abs(bref(i, j, k) - + b(i / VectorLength, j, k)[i % VectorLength]); std::cout << std::setw(10) << "KK Vector" << " BlkSize = " << std::setw(3) << BlkSize << " NumCols = " << std::setw(3) << NumCols diff --git a/sparse/impl/KokkosSparse_cluster_gauss_seidel_impl.hpp b/sparse/impl/KokkosSparse_cluster_gauss_seidel_impl.hpp index 881bd4eb7c..c5d004dfe6 100644 --- a/sparse/impl/KokkosSparse_cluster_gauss_seidel_impl.hpp +++ b/sparse/impl/KokkosSparse_cluster_gauss_seidel_impl.hpp @@ -686,8 +686,8 @@ class ClusterGaussSeidel { template void apply(x_value_array_type x_lhs_output_vec, y_value_array_type y_rhs_input_vec, bool init_zero_x_vector = false, - int numIter = 1, nnz_scalar_t omega = KokkosKernels::ArithTraits::one(), bool apply_forward = true, - bool apply_backward = true, bool /*update_y_vector*/ = true) { + int numIter = 1, nnz_scalar_t omega = KokkosKernels::ArithTraits::one(), + bool apply_forward = true, bool apply_backward = true, bool /*update_y_vector*/ = true) { auto gsHandle = get_gs_handle(); size_type nnz = entries.extent(0); diff --git a/sparse/impl/KokkosSparse_gauss_seidel_impl.hpp b/sparse/impl/KokkosSparse_gauss_seidel_impl.hpp index 230ba1ce09..b531cfe945 100644 --- a/sparse/impl/KokkosSparse_gauss_seidel_impl.hpp +++ b/sparse/impl/KokkosSparse_gauss_seidel_impl.hpp @@ -1467,8 +1467,8 @@ class PointGaussSeidel { template void apply(x_value_array_type x_lhs_output_vec, y_value_array_type y_rhs_input_vec, bool init_zero_x_vector = false, - int numIter = 1, nnz_scalar_t omega = KokkosKernels::ArithTraits::one(), bool apply_forward = true, - bool apply_backward = true, bool update_y_vector = true) { + int numIter = 1, nnz_scalar_t omega = KokkosKernels::ArithTraits::one(), + bool apply_forward = true, bool apply_backward = true, bool update_y_vector = true) { auto gsHandle = get_gs_handle(); if (gsHandle->is_numeric_called() == false) { this->initialize_numeric(); diff --git a/sparse/impl/KokkosSparse_spadd_symbolic_impl.hpp b/sparse/impl/KokkosSparse_spadd_symbolic_impl.hpp index d40d9d121f..9146b6988c 100644 --- a/sparse/impl/KokkosSparse_spadd_symbolic_impl.hpp +++ b/sparse/impl/KokkosSparse_spadd_symbolic_impl.hpp @@ -150,8 +150,9 @@ struct SortedCountEntriesTeam { [&](ordinal_type j) { scratch[npot - 1 - j] = Bcolinds(Browstart + j); }); // Fill space between A and B with ORDINAL_MAX, // to maintain a valid bitonic sequence of power-of-two length - Kokkos::parallel_for(Kokkos::ThreadVectorRange(t, npot - n), - [&](ordinal_type j) { scratch[Arowlen + j] = KokkosKernels::ArithTraits::max(); }); + Kokkos::parallel_for(Kokkos::ThreadVectorRange(t, npot - n), [&](ordinal_type j) { + scratch[Arowlen + j] = KokkosKernels::ArithTraits::max(); + }); // npot = 2^levels for (ordinal_type level = 0; level < levels; level++) { // npot/2 pairs of items are compared in parallel diff --git a/sparse/src/KokkosSparse_IOUtils.hpp b/sparse/src/KokkosSparse_IOUtils.hpp index 7649365359..5da81b381a 100644 --- a/sparse/src/KokkosSparse_IOUtils.hpp +++ b/sparse/src/KokkosSparse_IOUtils.hpp @@ -110,11 +110,10 @@ void kk_sparseMatrix_generate_lower_upper_triangle(char uplo, OrdinalType nrows, } template -void kk_diagonally_dominant_sparseMatrix_generate(OrdinalType nrows, OrdinalType ncols, SizeType &nnz, - OrdinalType row_size_variance, OrdinalType bandwidth, - ScalarType *&values, SizeType *&rowPtr, OrdinalType *&colInd, - ScalarType diagDominance = 10 * - KokkosKernels::ArithTraits::one()) { +void kk_diagonally_dominant_sparseMatrix_generate( + OrdinalType nrows, OrdinalType ncols, SizeType &nnz, OrdinalType row_size_variance, OrdinalType bandwidth, + ScalarType *&values, SizeType *&rowPtr, OrdinalType *&colInd, + ScalarType diagDominance = 10 * KokkosKernels::ArithTraits::one()) { rowPtr = new SizeType[nrows + 1]; OrdinalType elements_per_row = nnz / nrows; // Set a hard limit to the actual entries in any one row, so that the @@ -230,8 +229,8 @@ crsMat_t kk_generate_diagonally_dominant_sparse_matrix( typename crsMat_t::const_ordinal_type nrows, typename crsMat_t::const_ordinal_type ncols, typename crsMat_t::non_const_size_type &nnz, typename crsMat_t::const_ordinal_type row_size_variance, typename crsMat_t::const_ordinal_type bandwidth, - typename crsMat_t::const_value_type diagDominance = 10 * - KokkosKernels::ArithTraits::one()) { + typename crsMat_t::const_value_type diagDominance = + 10 * KokkosKernels::ArithTraits::one()) { typedef typename crsMat_t::StaticCrsGraphType graph_t; typedef typename graph_t::row_map_type::non_const_type row_map_view_t; typedef typename graph_t::entries_type::non_const_type cols_view_t; diff --git a/sparse/src/KokkosSparse_SortCrs.hpp b/sparse/src/KokkosSparse_SortCrs.hpp index 284693d7a3..5b81cad513 100644 --- a/sparse/src/KokkosSparse_SortCrs.hpp +++ b/sparse/src/KokkosSparse_SortCrs.hpp @@ -120,18 +120,18 @@ void sort_crs_matrix(const execution_space& exec, const rowmap_t& rowmap, const } template -void sort_crs_matrix( - const rowmap_t& rowmap, const entries_t& entries, const values_t& values, - typename entries_t::const_value_type numCols = KokkosKernels::ArithTraits::max(), - SortAlgorithm option = SortAlgorithm::DEFAULT) { +void sort_crs_matrix(const rowmap_t& rowmap, const entries_t& entries, const values_t& values, + typename entries_t::const_value_type numCols = + KokkosKernels::ArithTraits::max(), + SortAlgorithm option = SortAlgorithm::DEFAULT) { sort_crs_matrix(execution_space(), rowmap, entries, values, numCols, option); } template -void sort_crs_matrix( - const rowmap_t& rowmap, const entries_t& entries, const values_t& values, - typename entries_t::const_value_type numCols = KokkosKernels::ArithTraits::max(), - SortAlgorithm option = SortAlgorithm::DEFAULT) { +void sort_crs_matrix(const rowmap_t& rowmap, const entries_t& entries, const values_t& values, + typename entries_t::const_value_type numCols = + KokkosKernels::ArithTraits::max(), + SortAlgorithm option = SortAlgorithm::DEFAULT) { sort_crs_matrix(typename entries_t::execution_space(), rowmap, entries, values, numCols, option); } @@ -510,10 +510,11 @@ void sort_and_merge_graph(const typename rowmap_t::const_type& rowmap_in, const } template -crsGraph_t sort_and_merge_graph(const typename crsGraph_t::execution_space& exec, const crsGraph_t& G, - typename crsGraph_t::entries_type::const_value_type& numCols = - KokkosKernels::ArithTraits::max(), - SortAlgorithm option = SortAlgorithm::DEFAULT) { +crsGraph_t sort_and_merge_graph( + const typename crsGraph_t::execution_space& exec, const crsGraph_t& G, + typename crsGraph_t::entries_type::const_value_type& numCols = + KokkosKernels::ArithTraits::max(), + SortAlgorithm option = SortAlgorithm::DEFAULT) { using rowmap_t = typename crsGraph_t::row_map_type::non_const_type; using entries_t = typename crsGraph_t::entries_type; static_assert(!std::is_const::value, @@ -525,10 +526,11 @@ crsGraph_t sort_and_merge_graph(const typename crsGraph_t::execution_space& exec } template -crsGraph_t sort_and_merge_graph(const crsGraph_t& G, - typename crsGraph_t::entries_type::const_value_type& numCols = - KokkosKernels::ArithTraits::max(), - SortAlgorithm option = SortAlgorithm::DEFAULT) { +crsGraph_t sort_and_merge_graph( + const crsGraph_t& G, + typename crsGraph_t::entries_type::const_value_type& numCols = + KokkosKernels::ArithTraits::max(), + SortAlgorithm option = SortAlgorithm::DEFAULT) { return sort_and_merge_graph(typename crsGraph_t::execution_space(), G, numCols, option); } diff --git a/sparse/tpls/KokkosSparse_spadd_numeric_tpl_spec_decl.hpp b/sparse/tpls/KokkosSparse_spadd_numeric_tpl_spec_decl.hpp index 2d6f1415d6..62b4d05d73 100644 --- a/sparse/tpls/KokkosSparse_spadd_numeric_tpl_spec_decl.hpp +++ b/sparse/tpls/KokkosSparse_spadd_numeric_tpl_spec_decl.hpp @@ -77,7 +77,7 @@ namespace Impl { colidx_view_t colidxB, scalar_view_t valuesB, rowmap_view_t rowmapC, \ non_const_colidx_view_t colidxC, non_const_scalar_view_t valuesC) { \ Kokkos::Profiling::pushRegion("KokkosSparse::spadd_numeric[TPL_CUSPARSE," + \ - KokkosKernels::ArithTraits::name() + "]"); \ + KokkosKernels::ArithTraits::name() + "]"); \ \ auto addHandle = handle->get_spadd_handle(); \ auto &cuspData = addHandle->cusparseData; \ @@ -177,7 +177,7 @@ KOKKOSSPARSE_SPADD_NUMERIC_TPL_SPEC_DECL_CUSPARSE_EXT(false) colidx_view_t colidxB, scalar_view_t valuesB, rowmap_view_t rowmapC, \ non_const_colidx_view_t colidxC, non_const_scalar_view_t valuesC) { \ Kokkos::Profiling::pushRegion("KokkosSparse::spadd_numeric[TPL_ROCSPARSE," + \ - KokkosKernels::ArithTraits::name() + "]"); \ + KokkosKernels::ArithTraits::name() + "]"); \ \ auto addHandle = handle->get_spadd_handle(); \ auto &rocData = addHandle->rocsparseData; \ diff --git a/sparse/tpls/KokkosSparse_spadd_symbolic_tpl_spec_decl.hpp b/sparse/tpls/KokkosSparse_spadd_symbolic_tpl_spec_decl.hpp index e7f1e4fff9..3d72eb84f7 100644 --- a/sparse/tpls/KokkosSparse_spadd_symbolic_tpl_spec_decl.hpp +++ b/sparse/tpls/KokkosSparse_spadd_symbolic_tpl_spec_decl.hpp @@ -58,7 +58,7 @@ namespace Impl { const ORDINAL_TYPE n, rowmap_view_t rowmapA, colidx_view_t colidxA, \ rowmap_view_t rowmapB, colidx_view_t colidxB, non_const_rowmap_view_t rowmapC) { \ Kokkos::Profiling::pushRegion("KokkosSparse::spadd_symbolic[TPL_CUSPARSE," + \ - KokkosKernels::ArithTraits::name() + "]"); \ + KokkosKernels::ArithTraits::name() + "]"); \ \ auto addHandle = handle->get_spadd_handle(); \ auto& cuspData = addHandle->cusparseData; \ @@ -151,7 +151,7 @@ KOKKOSSPARSE_SPADD_SYMBOLIC_TPL_SPEC_DECL_CUSPARSE_EXT(false) const ORDINAL_TYPE n, rowmap_view_t rowmapA, colidx_view_t colidxA, \ rowmap_view_t rowmapB, colidx_view_t colidxB, non_const_rowmap_view_t rowmapC) { \ Kokkos::Profiling::pushRegion("KokkosSparse::spadd_symbolic[TPL_ROCSPARSE," + \ - KokkosKernels::ArithTraits::name() + "]"); \ + KokkosKernels::ArithTraits::name() + "]"); \ \ auto addHandle = handle->get_spadd_handle(); \ auto& rocData = addHandle->rocsparseData; \ diff --git a/sparse/tpls/KokkosSparse_spgemm_noreuse_tpl_spec_decl.hpp b/sparse/tpls/KokkosSparse_spgemm_noreuse_tpl_spec_decl.hpp index af3f5aa0c1..d858066f6f 100644 --- a/sparse/tpls/KokkosSparse_spgemm_noreuse_tpl_spec_decl.hpp +++ b/sparse/tpls/KokkosSparse_spgemm_noreuse_tpl_spec_decl.hpp @@ -110,25 +110,26 @@ Matrix spgemm_noreuse_cusparse(const MatrixConst &A, const MatrixConst &B) { return Matrix("C", m, k, c_nnz, valuesC, row_mapC, entriesC); } -#define SPGEMM_NOREUSE_DECL_CUSPARSE(SCALAR, MEMSPACE, TPL_AVAIL) \ - template <> \ - struct SPGEMM_NOREUSE, void, int>, \ - KokkosSparse::CrsMatrix, \ - Kokkos::MemoryTraits, const int>, \ - KokkosSparse::CrsMatrix, \ - Kokkos::MemoryTraits, const int>, \ - true, TPL_AVAIL> { \ - using Matrix = KokkosSparse::CrsMatrix, void, int>; \ - using ConstMatrix = KokkosSparse::CrsMatrix, \ - Kokkos::MemoryTraits, const int>; \ - static KokkosSparse::CrsMatrix, void, int> spgemm_noreuse( \ - const ConstMatrix &A, bool, const ConstMatrix &B, bool) { \ - std::string label = "KokkosSparse::spgemm_noreuse[TPL_CUSPARSE," + KokkosKernels::ArithTraits::name() + "]"; \ - Kokkos::Profiling::pushRegion(label); \ - Matrix C = spgemm_noreuse_cusparse(A, B); \ - Kokkos::Profiling::popRegion(); \ - return C; \ - } \ +#define SPGEMM_NOREUSE_DECL_CUSPARSE(SCALAR, MEMSPACE, TPL_AVAIL) \ + template <> \ + struct SPGEMM_NOREUSE, void, int>, \ + KokkosSparse::CrsMatrix, \ + Kokkos::MemoryTraits, const int>, \ + KokkosSparse::CrsMatrix, \ + Kokkos::MemoryTraits, const int>, \ + true, TPL_AVAIL> { \ + using Matrix = KokkosSparse::CrsMatrix, void, int>; \ + using ConstMatrix = KokkosSparse::CrsMatrix, \ + Kokkos::MemoryTraits, const int>; \ + static KokkosSparse::CrsMatrix, void, int> spgemm_noreuse( \ + const ConstMatrix &A, bool, const ConstMatrix &B, bool) { \ + std::string label = \ + "KokkosSparse::spgemm_noreuse[TPL_CUSPARSE," + KokkosKernels::ArithTraits::name() + "]"; \ + Kokkos::Profiling::pushRegion(label); \ + Matrix C = spgemm_noreuse_cusparse(A, B); \ + Kokkos::Profiling::popRegion(); \ + return C; \ + } \ }; #define SPGEMM_NOREUSE_DECL_CUSPARSE_S(SCALAR, TPL_AVAIL) \ @@ -213,7 +214,7 @@ Matrix spgemm_noreuse_mkl(const MatrixConst &A, const MatrixConst &B) { Kokkos::MemoryTraits, const MKL_INT>; \ static KokkosSparse::CrsMatrix, void, MKL_INT> \ spgemm_noreuse(const ConstMatrix &A, bool, const ConstMatrix &B, bool) { \ - std::string label = "KokkosSparse::spgemm_noreuse[TPL_MKL," + KokkosKernels::ArithTraits::name() + "]"; \ + std::string label = "KokkosSparse::spgemm_noreuse[TPL_MKL," + KokkosKernels::ArithTraits::name() + "]"; \ Kokkos::Profiling::pushRegion(label); \ Matrix C = spgemm_noreuse_mkl(A, B); \ Kokkos::Profiling::popRegion(); \ diff --git a/sparse/tpls/KokkosSparse_spgemm_numeric_tpl_spec_decl.hpp b/sparse/tpls/KokkosSparse_spgemm_numeric_tpl_spec_decl.hpp index 7c41290528..a8ecbaadb9 100644 --- a/sparse/tpls/KokkosSparse_spgemm_numeric_tpl_spec_decl.hpp +++ b/sparse/tpls/KokkosSparse_spgemm_numeric_tpl_spec_decl.hpp @@ -233,7 +233,8 @@ void spgemm_numeric_cusparse(KernelHandle *handle, lno_t m, lno_t n, lno_t k, co c_int_view_t row_mapA, c_int_view_t entriesA, c_scalar_view_t valuesA, bool, \ c_int_view_t row_mapB, c_int_view_t entriesB, c_scalar_view_t valuesB, bool, \ c_int_view_t row_mapC, int_view_t entriesC, scalar_view_t valuesC) { \ - std::string label = "KokkosSparse::spgemm_numeric[TPL_CUSPARSE," + KokkosKernels::ArithTraits::name() + "]"; \ + std::string label = \ + "KokkosSparse::spgemm_numeric[TPL_CUSPARSE," + KokkosKernels::ArithTraits::name() + "]"; \ Kokkos::Profiling::pushRegion(label); \ spgemm_numeric_cusparse(handle->get_spgemm_handle(), m, n, k, row_mapA, entriesA, valuesA, row_mapB, entriesB, \ valuesB, row_mapC, entriesC, valuesC); \ @@ -372,7 +373,8 @@ void spgemm_numeric_rocsparse(KernelHandle *handle, typename KernelHandle::nnz_l c_int_view_t row_mapA, c_int_view_t entriesA, c_scalar_view_t valuesA, bool, \ c_int_view_t row_mapB, c_int_view_t entriesB, c_scalar_view_t valuesB, bool, \ c_int_view_t row_mapC, int_view_t entriesC, scalar_view_t valuesC) { \ - std::string label = "KokkosSparse::spgemm_numeric[TPL_ROCSPARSE," + KokkosKernels::ArithTraits::name() + "]"; \ + std::string label = \ + "KokkosSparse::spgemm_numeric[TPL_ROCSPARSE," + KokkosKernels::ArithTraits::name() + "]"; \ Kokkos::Profiling::pushRegion(label); \ spgemm_numeric_rocsparse(handle->get_spgemm_handle(), m, n, k, row_mapA, entriesA, valuesA, row_mapB, entriesB, \ valuesB, row_mapC, entriesC, valuesC); \ @@ -487,7 +489,7 @@ void spgemm_numeric_mkl(KernelHandle *handle, typename KernelHandle::nnz_lno_t m c_int_view_t row_mapA, c_int_view_t entriesA, c_scalar_view_t valuesA, bool, \ c_int_view_t row_mapB, c_int_view_t entriesB, c_scalar_view_t valuesB, bool, \ c_int_view_t row_mapC, int_view_t entriesC, scalar_view_t valuesC) { \ - std::string label = "KokkosSparse::spgemm_numeric[TPL_MKL," + KokkosKernels::ArithTraits::name() + "]"; \ + std::string label = "KokkosSparse::spgemm_numeric[TPL_MKL," + KokkosKernels::ArithTraits::name() + "]"; \ Kokkos::Profiling::pushRegion(label); \ spgemm_numeric_mkl(handle->get_spgemm_handle(), m, n, k, row_mapA, entriesA, valuesA, row_mapB, entriesB, \ valuesB, row_mapC, entriesC, valuesC); \ diff --git a/sparse/tpls/KokkosSparse_spgemm_symbolic_tpl_spec_decl.hpp b/sparse/tpls/KokkosSparse_spgemm_symbolic_tpl_spec_decl.hpp index 91d2663a64..09592d22d8 100644 --- a/sparse/tpls/KokkosSparse_spgemm_symbolic_tpl_spec_decl.hpp +++ b/sparse/tpls/KokkosSparse_spgemm_symbolic_tpl_spec_decl.hpp @@ -340,7 +340,8 @@ void spgemm_symbolic_cusparse(KernelHandle *handle, lno_t m, lno_t n, lno_t k, c typename KernelHandle::nnz_lno_t n, typename KernelHandle::nnz_lno_t k, \ c_int_view_t row_mapA, c_int_view_t entriesA, bool, c_int_view_t row_mapB, \ c_int_view_t entriesB, bool, int_view_t row_mapC, bool computeRowptrs) { \ - std::string label = "KokkosSparse::spgemm_symbolic[TPL_CUSPARSE," + KokkosKernels::ArithTraits::name() + "]"; \ + std::string label = \ + "KokkosSparse::spgemm_symbolic[TPL_CUSPARSE," + KokkosKernels::ArithTraits::name() + "]"; \ Kokkos::Profiling::pushRegion(label); \ spgemm_symbolic_cusparse(handle->get_spgemm_handle(), m, n, k, row_mapA, entriesA, row_mapB, entriesB, row_mapC, \ computeRowptrs); \ @@ -442,41 +443,42 @@ void spgemm_symbolic_rocsparse(KernelHandle *handle, typename KernelHandle::nnz_ handle->set_computed_rowptrs(); } -#define SPGEMM_SYMBOLIC_DECL_ROCSPARSE(SCALAR, TPL_AVAIL) \ - template <> \ - struct SPGEMM_SYMBOLIC< \ - KokkosKernels::Experimental::KokkosKernelsHandle, \ - Kokkos::View, \ - Kokkos::MemoryTraits>, \ - Kokkos::View, \ - Kokkos::MemoryTraits>, \ - Kokkos::View, \ - Kokkos::MemoryTraits>, \ - Kokkos::View, \ - Kokkos::MemoryTraits>, \ - Kokkos::View, \ - Kokkos::MemoryTraits>, \ - true, TPL_AVAIL> { \ - using KernelHandle = \ - KokkosKernels::Experimental::KokkosKernelsHandle; \ - using c_int_view_t = \ - Kokkos::View, \ - Kokkos::MemoryTraits>; \ - using int_view_t = \ - Kokkos::View, \ - Kokkos::MemoryTraits>; \ - static void spgemm_symbolic(KernelHandle *handle, typename KernelHandle::nnz_lno_t m, \ - typename KernelHandle::nnz_lno_t n, typename KernelHandle::nnz_lno_t k, \ - c_int_view_t row_mapA, c_int_view_t entriesA, bool, c_int_view_t row_mapB, \ - c_int_view_t entriesB, bool, int_view_t row_mapC, bool) { \ - std::string label = "KokkosSparse::spgemm_symbolic[TPL_ROCSPARSE," + KokkosKernels::ArithTraits::name() + "]"; \ - Kokkos::Profiling::pushRegion(label); \ - spgemm_symbolic_rocsparse(handle->get_spgemm_handle(), m, n, k, row_mapA, entriesA, row_mapB, entriesB, \ - row_mapC); \ - Kokkos::Profiling::popRegion(); \ - } \ +#define SPGEMM_SYMBOLIC_DECL_ROCSPARSE(SCALAR, TPL_AVAIL) \ + template <> \ + struct SPGEMM_SYMBOLIC< \ + KokkosKernels::Experimental::KokkosKernelsHandle, \ + Kokkos::View, \ + Kokkos::MemoryTraits>, \ + Kokkos::View, \ + Kokkos::MemoryTraits>, \ + Kokkos::View, \ + Kokkos::MemoryTraits>, \ + Kokkos::View, \ + Kokkos::MemoryTraits>, \ + Kokkos::View, \ + Kokkos::MemoryTraits>, \ + true, TPL_AVAIL> { \ + using KernelHandle = \ + KokkosKernels::Experimental::KokkosKernelsHandle; \ + using c_int_view_t = \ + Kokkos::View, \ + Kokkos::MemoryTraits>; \ + using int_view_t = \ + Kokkos::View, \ + Kokkos::MemoryTraits>; \ + static void spgemm_symbolic(KernelHandle *handle, typename KernelHandle::nnz_lno_t m, \ + typename KernelHandle::nnz_lno_t n, typename KernelHandle::nnz_lno_t k, \ + c_int_view_t row_mapA, c_int_view_t entriesA, bool, c_int_view_t row_mapB, \ + c_int_view_t entriesB, bool, int_view_t row_mapC, bool) { \ + std::string label = \ + "KokkosSparse::spgemm_symbolic[TPL_ROCSPARSE," + KokkosKernels::ArithTraits::name() + "]"; \ + Kokkos::Profiling::pushRegion(label); \ + spgemm_symbolic_rocsparse(handle->get_spgemm_handle(), m, n, k, row_mapA, entriesA, row_mapB, entriesB, \ + row_mapC); \ + Kokkos::Profiling::popRegion(); \ + } \ }; SPGEMM_SYMBOLIC_DECL_ROCSPARSE(float, false) @@ -561,7 +563,7 @@ void spgemm_symbolic_mkl(KernelHandle *handle, typename KernelHandle::nnz_lno_t typename KernelHandle::nnz_lno_t n, typename KernelHandle::nnz_lno_t k, \ c_int_view_t row_mapA, c_int_view_t entriesA, bool, c_int_view_t row_mapB, \ c_int_view_t entriesB, bool, int_view_t row_mapC, bool) { \ - std::string label = "KokkosSparse::spgemm_symbolic[TPL_MKL," + KokkosKernels::ArithTraits::name() + "]"; \ + std::string label = "KokkosSparse::spgemm_symbolic[TPL_MKL," + KokkosKernels::ArithTraits::name() + "]"; \ Kokkos::Profiling::pushRegion(label); \ spgemm_symbolic_mkl(handle->get_spgemm_handle(), m, n, k, row_mapA, entriesA, row_mapB, entriesB, row_mapC); \ Kokkos::Profiling::popRegion(); \ diff --git a/sparse/tpls/KokkosSparse_spmv_bsrmatrix_tpl_spec_decl.hpp b/sparse/tpls/KokkosSparse_spmv_bsrmatrix_tpl_spec_decl.hpp index 9b9eab5b16..a7fe7f72e7 100644 --- a/sparse/tpls/KokkosSparse_spmv_bsrmatrix_tpl_spec_decl.hpp +++ b/sparse/tpls/KokkosSparse_spmv_bsrmatrix_tpl_spec_decl.hpp @@ -177,7 +177,7 @@ inline void spmv_mv_bsr_mkl(Handle* handle, sparse_operation_t op, Scalar alpha, \ static void spmv_bsrmatrix(const EXECSPACE&, Handle* handle, const char mode[], const coefficient_type& alpha, \ const AMatrix& A, const XVector& X, const coefficient_type& beta, const YVector& Y) { \ - std::string label = "KokkosSparse::spmv[TPL_MKL,BSRMATRIX," + KokkosKernels::ArithTraits::name() + "]"; \ + std::string label = "KokkosSparse::spmv[TPL_MKL,BSRMATRIX," + KokkosKernels::ArithTraits::name() + "]"; \ Kokkos::Profiling::pushRegion(label); \ spmv_bsr_mkl(handle, mode_kk_to_mkl(mode[0]), alpha, beta, A.numRows(), A.numCols(), A.blockDim(), \ A.graph.row_map.data(), A.graph.entries.data(), A.values.data(), X.data(), Y.data()); \ @@ -225,7 +225,8 @@ KOKKOSSPARSE_SPMV_MKL(Kokkos::complex, Kokkos::OpenMP) static void spmv_mv_bsrmatrix(const EXECSPACE&, Handle* handle, const char mode[], const coefficient_type& alpha, \ const AMatrix& A, const XVector& X, const coefficient_type& beta, \ const YVector& Y) { \ - std::string label = "KokkosSparse::spmv_mv[TPL_MKL,BSRMATRIX," + KokkosKernels::ArithTraits::name() + "]"; \ + std::string label = \ + "KokkosSparse::spmv_mv[TPL_MKL,BSRMATRIX," + KokkosKernels::ArithTraits::name() + "]"; \ Kokkos::Profiling::pushRegion(label); \ MKL_INT colx = static_cast(X.extent(1)); \ MKL_INT ldx = static_cast(X.stride(1)); \ @@ -458,35 +459,36 @@ void spmv_mv_bsr_cusparse(const Kokkos::Cuda& exec, Handle* handle, const char m } } -#define KOKKOSSPARSE_SPMV_CUSPARSE(SCALAR, ORDINAL, OFFSET, LAYOUT, SPACE) \ - template <> \ - struct SPMV_BSRMATRIX< \ - Kokkos::Cuda, KokkosSparse::Impl::SPMVHandleImpl, \ - ::KokkosSparse::Experimental::BsrMatrix, \ - Kokkos::MemoryTraits, OFFSET const>, \ - Kokkos::View, \ - Kokkos::MemoryTraits>, \ - Kokkos::View, Kokkos::MemoryTraits>, \ - true> { \ - using device_type = Kokkos::Device; \ - using memory_trait_type = Kokkos::MemoryTraits; \ - using Handle = KokkosSparse::Impl::SPMVHandleImpl; \ - using AMatrix = ::KokkosSparse::Experimental::BsrMatrix; \ - using XVector = Kokkos::View>; \ - using YVector = Kokkos::View; \ - \ - using coefficient_type = typename YVector::non_const_value_type; \ - \ - static void spmv_bsrmatrix(const Kokkos::Cuda& exec, Handle* handle, const char mode[], \ - const coefficient_type& alpha, const AMatrix& A, const XVector& x, \ - const coefficient_type& beta, const YVector& y) { \ - std::string label = "KokkosSparse::spmv[TPL_CUSPARSE,BSRMATRIX," + KokkosKernels::ArithTraits::name() + "]"; \ - Kokkos::Profiling::pushRegion(label); \ - spmv_bsr_cusparse(exec, handle, mode, alpha, A, x, beta, y); \ - Kokkos::Profiling::popRegion(); \ - } \ +#define KOKKOSSPARSE_SPMV_CUSPARSE(SCALAR, ORDINAL, OFFSET, LAYOUT, SPACE) \ + template <> \ + struct SPMV_BSRMATRIX< \ + Kokkos::Cuda, KokkosSparse::Impl::SPMVHandleImpl, \ + ::KokkosSparse::Experimental::BsrMatrix, \ + Kokkos::MemoryTraits, OFFSET const>, \ + Kokkos::View, \ + Kokkos::MemoryTraits>, \ + Kokkos::View, Kokkos::MemoryTraits>, \ + true> { \ + using device_type = Kokkos::Device; \ + using memory_trait_type = Kokkos::MemoryTraits; \ + using Handle = KokkosSparse::Impl::SPMVHandleImpl; \ + using AMatrix = ::KokkosSparse::Experimental::BsrMatrix; \ + using XVector = Kokkos::View>; \ + using YVector = Kokkos::View; \ + \ + using coefficient_type = typename YVector::non_const_value_type; \ + \ + static void spmv_bsrmatrix(const Kokkos::Cuda& exec, Handle* handle, const char mode[], \ + const coefficient_type& alpha, const AMatrix& A, const XVector& x, \ + const coefficient_type& beta, const YVector& y) { \ + std::string label = \ + "KokkosSparse::spmv[TPL_CUSPARSE,BSRMATRIX," + KokkosKernels::ArithTraits::name() + "]"; \ + Kokkos::Profiling::pushRegion(label); \ + spmv_bsr_cusparse(exec, handle, mode, alpha, A, x, beta, y); \ + Kokkos::Profiling::popRegion(); \ + } \ }; KOKKOSSPARSE_SPMV_CUSPARSE(double, int, int, Kokkos::LayoutLeft, Kokkos::CudaSpace) @@ -510,36 +512,37 @@ KOKKOSSPARSE_SPMV_CUSPARSE(Kokkos::complex, int, int, Kokkos::LayoutRight // cuSparse TPL does not support LayoutRight for this operation // only specialize for LayoutLeft -#define KOKKOSSPARSE_SPMV_MV_CUSPARSE(SCALAR, ORDINAL, OFFSET, SPACE, ETI_AVAIL) \ - template <> \ - struct SPMV_MV_BSRMATRIX< \ - Kokkos::Cuda, KokkosSparse::Impl::SPMVHandleImpl, \ - ::KokkosSparse::Experimental::BsrMatrix, \ - Kokkos::MemoryTraits, OFFSET const>, \ - Kokkos::View, \ - Kokkos::MemoryTraits>, \ - Kokkos::View, \ - Kokkos::MemoryTraits>, \ - false, true, ETI_AVAIL> { \ - using device_type = Kokkos::Device; \ - using memory_trait_type = Kokkos::MemoryTraits; \ - using Handle = KokkosSparse::Impl::SPMVHandleImpl; \ - using AMatrix = ::KokkosSparse::Experimental::BsrMatrix; \ - using XVector = Kokkos::View>; \ - using YVector = Kokkos::View; \ - \ - using coefficient_type = typename YVector::non_const_value_type; \ - \ - static void spmv_mv_bsrmatrix(const Kokkos::Cuda& exec, Handle* handle, const char mode[], \ - const coefficient_type& alpha, const AMatrix& A, const XVector& x, \ - const coefficient_type& beta, const YVector& y) { \ - std::string label = "KokkosSparse::spmv_mv[TPL_CUSPARSE,BSRMATRIX," + KokkosKernels::ArithTraits::name() + "]"; \ - Kokkos::Profiling::pushRegion(label); \ - spmv_mv_bsr_cusparse(exec, handle, mode, alpha, A, x, beta, y); \ - Kokkos::Profiling::popRegion(); \ - } \ +#define KOKKOSSPARSE_SPMV_MV_CUSPARSE(SCALAR, ORDINAL, OFFSET, SPACE, ETI_AVAIL) \ + template <> \ + struct SPMV_MV_BSRMATRIX< \ + Kokkos::Cuda, KokkosSparse::Impl::SPMVHandleImpl, \ + ::KokkosSparse::Experimental::BsrMatrix, \ + Kokkos::MemoryTraits, OFFSET const>, \ + Kokkos::View, \ + Kokkos::MemoryTraits>, \ + Kokkos::View, \ + Kokkos::MemoryTraits>, \ + false, true, ETI_AVAIL> { \ + using device_type = Kokkos::Device; \ + using memory_trait_type = Kokkos::MemoryTraits; \ + using Handle = KokkosSparse::Impl::SPMVHandleImpl; \ + using AMatrix = ::KokkosSparse::Experimental::BsrMatrix; \ + using XVector = Kokkos::View>; \ + using YVector = Kokkos::View; \ + \ + using coefficient_type = typename YVector::non_const_value_type; \ + \ + static void spmv_mv_bsrmatrix(const Kokkos::Cuda& exec, Handle* handle, const char mode[], \ + const coefficient_type& alpha, const AMatrix& A, const XVector& x, \ + const coefficient_type& beta, const YVector& y) { \ + std::string label = \ + "KokkosSparse::spmv_mv[TPL_CUSPARSE,BSRMATRIX," + KokkosKernels::ArithTraits::name() + "]"; \ + Kokkos::Profiling::pushRegion(label); \ + spmv_mv_bsr_cusparse(exec, handle, mode, alpha, A, x, beta, y); \ + Kokkos::Profiling::popRegion(); \ + } \ }; KOKKOSSPARSE_SPMV_MV_CUSPARSE(double, int, int, Kokkos::CudaSpace, true) @@ -782,35 +785,36 @@ void spmv_bsr_rocsparse(const Kokkos::HIP& exec, Handle* handle, const char mode #endif } // spmv_bsr_rocsparse -#define KOKKOSSPARSE_SPMV_ROCSPARSE(SCALAR, ORDINAL, OFFSET, LAYOUT, SPACE) \ - template <> \ - struct SPMV_BSRMATRIX< \ - Kokkos::HIP, KokkosSparse::Impl::SPMVHandleImpl, \ - ::KokkosSparse::Experimental::BsrMatrix, \ - Kokkos::MemoryTraits, OFFSET const>, \ - Kokkos::View, \ - Kokkos::MemoryTraits>, \ - Kokkos::View, Kokkos::MemoryTraits>, \ - true> { \ - using device_type = Kokkos::Device; \ - using memory_trait_type = Kokkos::MemoryTraits; \ - using Handle = KokkosSparse::Impl::SPMVHandleImpl; \ - using AMatrix = ::KokkosSparse::Experimental::BsrMatrix; \ - using XVector = Kokkos::View>; \ - using YVector = Kokkos::View; \ - \ - using coefficient_type = typename YVector::non_const_value_type; \ - \ - static void spmv_bsrmatrix(const Kokkos::HIP& exec, Handle* handle, const char mode[], \ - const coefficient_type& alpha, const AMatrix& A, const XVector& x, \ - const coefficient_type& beta, const YVector& y) { \ - std::string label = "KokkosSparse::spmv[TPL_ROCSPARSE,BSRMATRIX," + KokkosKernels::ArithTraits::name() + "]"; \ - Kokkos::Profiling::pushRegion(label); \ - spmv_bsr_rocsparse(exec, handle, mode, alpha, A, x, beta, y); \ - Kokkos::Profiling::popRegion(); \ - } \ +#define KOKKOSSPARSE_SPMV_ROCSPARSE(SCALAR, ORDINAL, OFFSET, LAYOUT, SPACE) \ + template <> \ + struct SPMV_BSRMATRIX< \ + Kokkos::HIP, KokkosSparse::Impl::SPMVHandleImpl, \ + ::KokkosSparse::Experimental::BsrMatrix, \ + Kokkos::MemoryTraits, OFFSET const>, \ + Kokkos::View, \ + Kokkos::MemoryTraits>, \ + Kokkos::View, Kokkos::MemoryTraits>, \ + true> { \ + using device_type = Kokkos::Device; \ + using memory_trait_type = Kokkos::MemoryTraits; \ + using Handle = KokkosSparse::Impl::SPMVHandleImpl; \ + using AMatrix = ::KokkosSparse::Experimental::BsrMatrix; \ + using XVector = Kokkos::View>; \ + using YVector = Kokkos::View; \ + \ + using coefficient_type = typename YVector::non_const_value_type; \ + \ + static void spmv_bsrmatrix(const Kokkos::HIP& exec, Handle* handle, const char mode[], \ + const coefficient_type& alpha, const AMatrix& A, const XVector& x, \ + const coefficient_type& beta, const YVector& y) { \ + std::string label = \ + "KokkosSparse::spmv[TPL_ROCSPARSE,BSRMATRIX," + KokkosKernels::ArithTraits::name() + "]"; \ + Kokkos::Profiling::pushRegion(label); \ + spmv_bsr_rocsparse(exec, handle, mode, alpha, A, x, beta, y); \ + Kokkos::Profiling::popRegion(); \ + } \ }; KOKKOSSPARSE_SPMV_ROCSPARSE(float, rocsparse_int, rocsparse_int, Kokkos::LayoutLeft, Kokkos::HIPSpace); diff --git a/sparse/tpls/KokkosSparse_spmv_mv_tpl_spec_decl.hpp b/sparse/tpls/KokkosSparse_spmv_mv_tpl_spec_decl.hpp index e036a302a3..ac3633c0e5 100644 --- a/sparse/tpls/KokkosSparse_spmv_mv_tpl_spec_decl.hpp +++ b/sparse/tpls/KokkosSparse_spmv_mv_tpl_spec_decl.hpp @@ -217,7 +217,7 @@ void spmv_mv_cusparse(const Kokkos::Cuda &exec, Handle *handle, const char mode[ \ static void spmv_mv(const Kokkos::Cuda &exec, Handle *handle, const char mode[], const coefficient_type &alpha, \ const AMatrix &A, const XVector &x, const coefficient_type &beta, const YVector &y) { \ - std::string label = "KokkosSparse::spmv_mv[TPL_CUSPARSE," + KokkosKernels::ArithTraits::name() + "]"; \ + std::string label = "KokkosSparse::spmv_mv[TPL_CUSPARSE," + KokkosKernels::ArithTraits::name() + "]"; \ Kokkos::Profiling::pushRegion(label); \ spmv_mv_cusparse(exec, handle, mode, alpha, A, x, beta, y); \ Kokkos::Profiling::popRegion(); \ @@ -409,7 +409,7 @@ void spmv_mv_rocsparse(const Kokkos::HIP &exec, Handle *handle, const char mode[ \ static void spmv_mv(const Kokkos::HIP &exec, Handle *handle, const char mode[], const coefficient_type &alpha, \ const AMatrix &A, const XVector &x, const coefficient_type &beta, const YVector &y) { \ - std::string label = "KokkosSparse::spmv_mv[TPL_ROCSPARSE," + KokkosKernels::ArithTraits::name() + "]"; \ + std::string label = "KokkosSparse::spmv_mv[TPL_ROCSPARSE," + KokkosKernels::ArithTraits::name() + "]"; \ Kokkos::Profiling::pushRegion(label); \ spmv_mv_rocsparse(exec, handle, mode, alpha, A, x, beta, y); \ Kokkos::Profiling::popRegion(); \ diff --git a/sparse/tpls/KokkosSparse_spmv_tpl_spec_decl.hpp b/sparse/tpls/KokkosSparse_spmv_tpl_spec_decl.hpp index 42201ecf2c..3a1728407d 100644 --- a/sparse/tpls/KokkosSparse_spmv_tpl_spec_decl.hpp +++ b/sparse/tpls/KokkosSparse_spmv_tpl_spec_decl.hpp @@ -54,7 +54,8 @@ void spmv_cusparse(const Kokkos::Cuda& exec, Handle* handle, const char mode[], } // cuSPARSE doesn't directly support mode H with real values, but this is // equivalent to mode T - if (myCusparseOperation == CUSPARSE_OPERATION_CONJUGATE_TRANSPOSE && !KokkosKernels::ArithTraits::isComplex) + if (myCusparseOperation == CUSPARSE_OPERATION_CONJUGATE_TRANSPOSE && + !KokkosKernels::ArithTraits::isComplex) myCusparseOperation = CUSPARSE_OPERATION_TRANSPOSE; // Hopefully this corresponds to CUDA reelase 10.1, which is the first to @@ -217,7 +218,7 @@ void spmv_cusparse(const Kokkos::Cuda& exec, Handle* handle, const char mode[], \ static void spmv(const Kokkos::Cuda& exec, Handle* handle, const char mode[], const coefficient_type& alpha, \ const AMatrix& A, const XVector& x, const coefficient_type& beta, const YVector& y) { \ - std::string label = "KokkosSparse::spmv[TPL_CUSPARSE," + KokkosKernels::ArithTraits::name() + "]"; \ + std::string label = "KokkosSparse::spmv[TPL_CUSPARSE," + KokkosKernels::ArithTraits::name() + "]"; \ Kokkos::Profiling::pushRegion(label); \ spmv_cusparse(exec, handle, mode, alpha, A, x, beta, y); \ Kokkos::Profiling::popRegion(); \ @@ -408,7 +409,7 @@ void spmv_rocsparse(const Kokkos::HIP& exec, Handle* handle, const char mode[], \ static void spmv(const Kokkos::HIP& exec, Handle* handle, const char mode[], const coefficient_type& alpha, \ const AMatrix& A, const XVector& x, const coefficient_type& beta, const YVector& y) { \ - std::string label = "KokkosSparse::spmv[TPL_ROCSPARSE," + KokkosKernels::ArithTraits::name() + "]"; \ + std::string label = "KokkosSparse::spmv[TPL_ROCSPARSE," + KokkosKernels::ArithTraits::name() + "]"; \ Kokkos::Profiling::pushRegion(label); \ spmv_rocsparse(exec, handle, mode, alpha, A, x, beta, y); \ Kokkos::Profiling::popRegion(); \ @@ -525,7 +526,7 @@ inline void spmv_mkl(Handle* handle, sparse_operation_t op, Scalar alpha, Scalar \ static void spmv(const EXECSPACE&, Handle* handle, const char mode[], const coefficient_type& alpha, \ const AMatrix& A, const XVector& x, const coefficient_type& beta, const YVector& y) { \ - std::string label = "KokkosSparse::spmv[TPL_MKL," + KokkosKernels::ArithTraits::name() + "]"; \ + std::string label = "KokkosSparse::spmv[TPL_MKL," + KokkosKernels::ArithTraits::name() + "]"; \ Kokkos::Profiling::pushRegion(label); \ spmv_mkl(handle, mode_kk_to_mkl(mode[0]), alpha, beta, A.numRows(), A.numCols(), A.graph.row_map.data(), \ A.graph.entries.data(), A.values.data(), x.data(), y.data()); \ @@ -627,7 +628,7 @@ inline void spmv_onemkl(const execution_space& exec, Handle* handle, oneapi::mkl \ static void spmv(const execution_space& exec, Handle* handle, const char mode[], const coefficient_type& alpha, \ const AMatrix& A, const XVector& x, const coefficient_type& beta, const YVector& y) { \ - std::string label = "KokkosSparse::spmv[TPL_ONEMKL," + KokkosKernels::ArithTraits::name() + "]"; \ + std::string label = "KokkosSparse::spmv[TPL_ONEMKL," + KokkosKernels::ArithTraits::name() + "]"; \ Kokkos::Profiling::pushRegion(label); \ oneapi::mkl::transpose mkl_mode = mode_kk_to_onemkl(mode[0]); \ spmv_onemkl(exec, handle, mkl_mode, alpha, A, x, beta, y); \ diff --git a/sparse/unit_test/Test_Sparse_block_gauss_seidel.hpp b/sparse/unit_test/Test_Sparse_block_gauss_seidel.hpp index c74fa03b28..a954bb5fa6 100644 --- a/sparse/unit_test/Test_Sparse_block_gauss_seidel.hpp +++ b/sparse/unit_test/Test_Sparse_block_gauss_seidel.hpp @@ -291,7 +291,8 @@ void test_block_gauss_seidel_rank2(lno_t numRows, size_type nnz, lno_t bandwidth scalar_t diff = x_host(r, c) - solution_host(r, c); sum += diff * diff; } - mag_t result_res = KokkosKernels::ArithTraits::sqrt(KokkosKernels::ArithTraits::abs(sum)); + mag_t result_res = + KokkosKernels::ArithTraits::sqrt(KokkosKernels::ArithTraits::abs(sum)); EXPECT_LT(result_res, params.tolerance * initial_norms[c]); } } From f0c21cad0d2a77fd117416dc1654e6ae46493254 Mon Sep 17 00:00:00 2001 From: Luc Berger-Vergiat Date: Mon, 29 Sep 2025 15:48:40 -0600 Subject: [PATCH 4/7] More fixes for std::complex Signed-off-by: Luc Berger-Vergiat --- common/src/Kokkos_ArithTraits.hpp | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/common/src/Kokkos_ArithTraits.hpp b/common/src/Kokkos_ArithTraits.hpp index d15e6255f1..6f964ccb7a 100644 --- a/common/src/Kokkos_ArithTraits.hpp +++ b/common/src/Kokkos_ArithTraits.hpp @@ -1093,14 +1093,12 @@ class ArithTraits> { } else { KOKKOS_IF_ON_HOST((using std::isinf;)) KOKKOS_IF_ON_DEVICE((using sycl::isinf;)) - return isinf(real(x)) || isinf(imag(x)); + return isinf(std::real(x)) || isinf(std::imag(x)); } } #else static bool isInf(const std::complex& x) { - KOKKOS_IF_ON_HOST((using std::isinf;)) - KOKKOS_IF_ON_DEVICE((using Kokkos::isinf;)) - return isinf(real(x)) || isinf(imag(x)); + return std::isinf(std::real(x)) || std::isinf(std::imag(x)); } #endif @@ -1113,14 +1111,12 @@ class ArithTraits> { } else { KOKKOS_IF_ON_HOST((using std::isnan;)) KOKKOS_IF_ON_DEVICE((using sycl::isnan;)) - return isnan(real(x)) || isnan(imag(x)); + return isnan(std::real(x)) || isnan(std::imag(x)); } } #else static bool isNan(const std::complex& x) { - KOKKOS_IF_ON_HOST((using std::isnan;)) - KOKKOS_IF_ON_DEVICE((using Kokkos::isnan;)) - return isnan(real(x)) || isnan(imag(x)); + return std::isnan(std::real(x)) || std::isnan(std::imag(x)); } #endif static mag_type abs(const std::complex& x) { return std::abs(x); } From b615b2783f8f3acade35ed33f6d82a27ace5c1a5 Mon Sep 17 00:00:00 2001 From: Luc Berger-Vergiat Date: Tue, 30 Sep 2025 09:38:34 -0600 Subject: [PATCH 5/7] common: moving ArithTraits to KokkosKernels_ArithTraits.hpp This avoid having us use the naming convention of Kokkos Core for something that lives in Kokkos Kernels. Next, I will modify header inclusions in the library to reflect this change. Signed-off-by: Luc Berger-Vergiat --- common/src/KokkosKernels_ArithTraits.hpp | 1648 ++++++++++++++++++++++ common/src/Kokkos_ArithTraits.hpp | 1628 +-------------------- 2 files changed, 1651 insertions(+), 1625 deletions(-) create mode 100644 common/src/KokkosKernels_ArithTraits.hpp diff --git a/common/src/KokkosKernels_ArithTraits.hpp b/common/src/KokkosKernels_ArithTraits.hpp new file mode 100644 index 0000000000..2bfeb8559c --- /dev/null +++ b/common/src/KokkosKernels_ArithTraits.hpp @@ -0,0 +1,1648 @@ +//@HEADER +// ************************************************************************ +// +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering +// Solutions of Sandia, LLC (NTESS). +// +// Under the terms of Contract DE-NA0003525 with NTESS, +// the U.S. Government retains certain rights in this software. +// +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//@HEADER + +#ifndef KOKKOSKERNELS_ARITHTRAITS_HPP +#define KOKKOSKERNELS_ARITHTRAITS_HPP + +/// \file KokkosKernels_ArithTraits.hpp +/// \brief Declaration and definition of KokkosKernels::ArithTraits + +#include +#include +#include +#include +#include + +#include + +#include +#include +#include +#include // std::complex +#include // std::numeric_limits +#ifdef __CUDACC__ +#include +#endif + +namespace { // anonymous + +/// \fn intPowImpl +/// \tparam IntType A built-in integer type. +/// \brief Implementation of intPowSigned and intPowUnsigned. +/// +/// \pre x != 0 +/// \pre y > 0 +/// +/// Use intPowSigned or intPowUnsigned for general y. +template +KOKKOS_FORCEINLINE_FUNCTION IntType intPowImpl(const IntType x, const IntType y) { + // Recursion (unrolled into while loop): pow(x, 2y) = (x^y)^2 + IntType prod = x; + IntType y_cur = 1; + // If y == 1, then prod stays x. + while (y_cur < y) { + prod = prod * prod; + y_cur = y_cur << 1; + } + // abs(y - y_cur) < floor(log2(y)), so it won't hurt asymptotic run + // time to finish the remainder in a linear iteration. + if (y > y_cur) { + const IntType left = y - y_cur; + for (IntType k = 0; k < left; ++k) { + prod = prod * x; + } + } else if (y < y_cur) { + // There's probably a better way to do this in order to avoid the + // (expensive) integer division, but I'm not motivated to think of + // it at the moment. + const IntType left = y_cur - y; + for (IntType k = 0; k < left; ++k) { + prod = prod / x; + } + } + return prod; + + // y = 8: + // + // x,1 -> x^2,2 + // x^2,2 -> x^4,4 + // x^4,4 -> x^8,8 + // + // y = 9: + // + // x,1 -> x^2,2 + // x^2,2 -> x^4,4 + // x^4,4 -> x^8,8 + // + // y - y_cur is what's left over. Just do it one at a time. + // + // y = 3: + // x,1 -> x^2,2 + // x^2,2 -> x^4,4 +} + +// Warning free abs function for types where we don't know whether they are +// signed (like char) +template ::is_signed> +struct integer_abs { + static KOKKOS_INLINE_FUNCTION T abs(const T& val); +}; + +template +struct integer_abs { + static KOKKOS_INLINE_FUNCTION T abs(const T& x) { return x < 0 ? -x : x; } +}; + +template +struct integer_abs { + static KOKKOS_INLINE_FUNCTION T abs(const T& x) { return x; } +}; + +/// \fn intPowSigned +/// \tparam IntType A built-in signed integer type. +/// \brief Compute x raised to the power y. +/// +/// If the arguments are invalid (e.g., if x and y are both zero), the +/// result of this function is undefined. However, this function will +/// not throw an exception in that case. +template +KOKKOS_FORCEINLINE_FUNCTION typename std::enable_if::is_signed, IntType>::type +intPowSigned(const IntType x, const IntType y) { + // It's not entirely clear what to return if x and y are both zero. + // In the case of floating-point numbers, 0^0 is NaN. Here, though, + // I think it's safe to return 0. + if (x == 0) { + return 0; + } else if (y == 0) { + return 1; + } else if (y < 0) { + if (x == 1) { + return 1; + } else if (x == -1) { + return (y % 2 == 0) ? 1 : -1; + } else { + return 0; // round the fraction to zero + } + } + return intPowImpl(x, y); +} +template +KOKKOS_FORCEINLINE_FUNCTION typename std::enable_if::is_signed, IntType>::type +intPowSigned(const IntType x, const IntType y) { + // It's not entirely clear what to return if x and y are both zero. + // In the case of floating-point numbers, 0^0 is NaN. Here, though, + // I think it's safe to return 0. + if (x == 0) { + return 0; + } else if (y == 0) { + return 1; + } + return intPowImpl(x, y); +} + +/// \fn intPowUnsigned +/// \tparam IntType A built-in unsigned integer type. +/// \brief Compute x raised to the power y. +/// +/// If the arguments are invalid (e.g., if x and y are both zero), the +/// result of this function is undefined. However, this function will +/// not throw an exception in that case. +template +KOKKOS_FORCEINLINE_FUNCTION IntType intPowUnsigned(const IntType x, const IntType y) { + // It's not entirely clear what to return if x and y are both zero. + // In the case of floating-point numbers, 0^0 is NaN. Here, though, + // I think it's safe to return 0. + if (x == 0) { + return 0; + } else if (y == 0) { + return 1; + } else { + return intPowImpl(x, y); + } +} + +// It might make sense to use special sqrt() approximations for +// integer arguments, like those presented on the following web site: +// +// http://www.azillionmonkeys.com/qed/sqroot.html#implementations +// +// Note that some of the implementations on the above page break ANSI +// C(++) aliasing rules (by assigning to the results of +// reinterpret_cast-ing between int and float). It's also just a +// performance optimization and not required for a reasonable +// implementation. + +} // namespace + +namespace KokkosKernels { + +// Macro to automate the wrapping of Kokkos Mathematical Functions +#define KOKKOSKERNELS_ARITHTRAITS_REAL_FP(FUNC_QUAL) \ + static FUNC_QUAL val_type zero() { return static_cast(0); } \ + static FUNC_QUAL val_type one() { return static_cast(1); } \ + static FUNC_QUAL val_type min() { return Kokkos::Experimental::finite_min::value; } \ + static FUNC_QUAL val_type max() { return Kokkos::Experimental::finite_max::value; } \ + static FUNC_QUAL val_type infinity() { return Kokkos::Experimental::infinity::value; } \ + static FUNC_QUAL val_type nan() { return Kokkos::Experimental::quiet_NaN::value; } \ + static FUNC_QUAL mag_type epsilon() { return Kokkos::Experimental::epsilon::value; } \ + static FUNC_QUAL mag_type sfmin() { return Kokkos::Experimental::norm_min::value; } \ + static FUNC_QUAL int base() { return Kokkos::Experimental::radix::value; } \ + static FUNC_QUAL mag_type prec() { return epsilon() * static_cast(base()); } \ + static FUNC_QUAL int t() { return Kokkos::Experimental::digits::value; } \ + static FUNC_QUAL mag_type rnd() { return one(); } \ + static FUNC_QUAL int emin() { return Kokkos::Experimental::min_exponent::value; } \ + static FUNC_QUAL mag_type rmin() { return Kokkos::Experimental::norm_min::value; } \ + static FUNC_QUAL int emax() { return Kokkos::Experimental::max_exponent::value; } \ + static FUNC_QUAL mag_type rmax() { return Kokkos::Experimental::finite_max::value; } \ + \ + static FUNC_QUAL bool isInf(const val_type x) { return Kokkos::isinf(x); } \ + static FUNC_QUAL bool isNan(const val_type x) { return Kokkos::isnan(x); } \ + static FUNC_QUAL mag_type abs(const val_type x) { return Kokkos::abs(x); } \ + static FUNC_QUAL mag_type real(const val_type x) { return Kokkos::real(x); } \ + static FUNC_QUAL mag_type imag(const val_type x) { return Kokkos::imag(x); } \ + static FUNC_QUAL val_type conj(const val_type x) { return x; } \ + static FUNC_QUAL val_type pow(const val_type x, const val_type y) { return Kokkos::pow(x, y); } \ + static FUNC_QUAL val_type sqrt(const val_type x) { return Kokkos::sqrt(x); } \ + static FUNC_QUAL val_type cbrt(const val_type x) { return Kokkos::cbrt(x); } \ + static FUNC_QUAL val_type exp(const val_type x) { return Kokkos::exp(x); } \ + static FUNC_QUAL val_type log(const val_type x) { return Kokkos::log(x); } \ + static FUNC_QUAL val_type log10(const val_type x) { return Kokkos::log10(x); } \ + static FUNC_QUAL val_type sin(const val_type x) { return Kokkos::sin(x); } \ + static FUNC_QUAL val_type cos(const val_type x) { return Kokkos::cos(x); } \ + static FUNC_QUAL val_type tan(const val_type x) { return Kokkos::tan(x); } \ + static FUNC_QUAL val_type sinh(const val_type x) { return Kokkos::sinh(x); } \ + static FUNC_QUAL val_type cosh(const val_type x) { return Kokkos::cosh(x); } \ + static FUNC_QUAL val_type tanh(const val_type x) { return Kokkos::tanh(x); } \ + static FUNC_QUAL val_type asin(const val_type x) { return Kokkos::asin(x); } \ + static FUNC_QUAL val_type acos(const val_type x) { return Kokkos::acos(x); } \ + static FUNC_QUAL val_type atan(const val_type x) { return Kokkos::atan(x); } \ + \ + static FUNC_QUAL bool isnaninf(const val_type x) { return isNan(x) || isInf(x); } \ + static FUNC_QUAL magnitudeType magnitude(const val_type x) { return abs(x); } \ + static FUNC_QUAL val_type conjugate(const val_type x) { return conj(x); } \ + static FUNC_QUAL val_type squareroot(const val_type x) { return sqrt(x); } \ + static FUNC_QUAL mag_type eps() { return epsilon(); } + +// Macro to automate the wrapping of Kokkos Mathematical Functions +#define KOKKOSKERNELS_ARITHTRAITS_HALF_FP(FUNC_QUAL) \ + static FUNC_QUAL val_type zero() { return static_cast(0); } \ + static FUNC_QUAL val_type one() { return static_cast(1); } \ + static FUNC_QUAL val_type min() { return Kokkos::Experimental::finite_min::value; } \ + static FUNC_QUAL val_type max() { return Kokkos::Experimental::finite_max::value; } \ + static FUNC_QUAL val_type infinity() { return Kokkos::Experimental::infinity::value; } \ + static FUNC_QUAL val_type nan() { return Kokkos::Experimental::quiet_NaN::value; } \ + static FUNC_QUAL mag_type epsilon() { return Kokkos::Experimental::epsilon::value; } \ + static FUNC_QUAL mag_type sfmin() { return Kokkos::Experimental::norm_min::value; } \ + static FUNC_QUAL int base() { return Kokkos::Experimental::radix::value; } \ + static FUNC_QUAL mag_type prec() { return epsilon() * static_cast(base()); } \ + static FUNC_QUAL int t() { return Kokkos::Experimental::digits::value; } \ + static FUNC_QUAL mag_type rnd() { return one(); } \ + static FUNC_QUAL int emin() { return Kokkos::Experimental::min_exponent::value; } \ + static FUNC_QUAL mag_type rmin() { return Kokkos::Experimental::norm_min::value; } \ + static FUNC_QUAL int emax() { return Kokkos::Experimental::max_exponent::value; } \ + static FUNC_QUAL mag_type rmax() { return Kokkos::Experimental::finite_max::value; } \ + \ + static FUNC_QUAL bool isInf(const val_type x) { return Kokkos::isinf(x); } \ + static FUNC_QUAL mag_type abs(const val_type x) { return Kokkos::abs(x); } \ + static FUNC_QUAL mag_type real(const val_type x) { return Kokkos::real(x); } \ + static FUNC_QUAL mag_type imag(const val_type x) { return Kokkos::imag(x); } \ + static FUNC_QUAL val_type conj(const val_type x) { return x; } \ + static FUNC_QUAL val_type pow(const val_type x, const val_type y) { return Kokkos::pow(x, y); } \ + static FUNC_QUAL val_type sqrt(const val_type x) { return Kokkos::sqrt(x); } \ + static FUNC_QUAL val_type cbrt(const val_type x) { return Kokkos::cbrt(x); } \ + static FUNC_QUAL val_type exp(const val_type x) { return Kokkos::exp(x); } \ + static FUNC_QUAL val_type log(const val_type x) { return Kokkos::log(x); } \ + static FUNC_QUAL val_type log10(const val_type x) { return Kokkos::log10(x); } \ + static FUNC_QUAL val_type sin(const val_type x) { return Kokkos::sin(x); } \ + static FUNC_QUAL val_type cos(const val_type x) { return Kokkos::cos(x); } \ + static FUNC_QUAL val_type tan(const val_type x) { return Kokkos::tan(x); } \ + static FUNC_QUAL val_type sinh(const val_type x) { return Kokkos::sinh(x); } \ + static FUNC_QUAL val_type cosh(const val_type x) { return Kokkos::cosh(x); } \ + static FUNC_QUAL val_type tanh(const val_type x) { return Kokkos::tanh(x); } \ + static FUNC_QUAL val_type asin(const val_type x) { return Kokkos::asin(x); } \ + static FUNC_QUAL val_type acos(const val_type x) { return Kokkos::acos(x); } \ + static FUNC_QUAL val_type atan(const val_type x) { return Kokkos::atan(x); } \ + \ + static FUNC_QUAL magnitudeType magnitude(const val_type x) { return abs(x); } \ + static FUNC_QUAL val_type conjugate(const val_type x) { return conj(x); } \ + static FUNC_QUAL val_type squareroot(const val_type x) { return sqrt(x); } \ + static FUNC_QUAL mag_type eps() { return epsilon(); } + +#define KOKKOSKERNELS_ARITHTRAITS_CMPLX_FP(FUNC_QUAL) \ + \ + static constexpr bool is_specialized = true; \ + static constexpr bool is_signed = true; \ + static constexpr bool is_integer = false; \ + static constexpr bool is_exact = false; \ + static constexpr bool is_complex = true; \ + static constexpr bool has_infinity = true; \ + \ + using magnitudeType = mag_type; \ + using halfPrecision = ::Kokkos::complex::halfPrecision>; \ + using doublePrecision = ::Kokkos::complex::doublePrecision>; \ + \ + static constexpr bool isComplex = true; \ + static constexpr bool isOrdinal = false; \ + static constexpr bool isComparable = false; \ + static constexpr bool hasMachineParameters = ArithTraits::hasMachineParameters; \ + \ + static FUNC_QUAL val_type zero() { return val_type(ArithTraits::zero(), ArithTraits::zero()); } \ + static FUNC_QUAL val_type one() { return val_type(ArithTraits::one(), ArithTraits::zero()); } \ + static FUNC_QUAL val_type min() { return val_type(ArithTraits::min(), ArithTraits::min()); } \ + static FUNC_QUAL val_type max() { return val_type(ArithTraits::max(), ArithTraits::max()); } \ + static FUNC_QUAL val_type infinity() { \ + return val_type(ArithTraits::infinity(), ArithTraits::infinity()); \ + } \ + static FUNC_QUAL val_type nan() { return val_type(ArithTraits::nan(), ArithTraits::nan()); } \ + static FUNC_QUAL mag_type epsilon() { return ArithTraits::epsilon(); } \ + static FUNC_QUAL mag_type sfmin() { return ArithTraits::sfmin(); } \ + static FUNC_QUAL int base() { return ArithTraits::base(); } \ + static FUNC_QUAL mag_type prec() { return ArithTraits::prec(); } \ + static FUNC_QUAL int t() { return ArithTraits::t(); } \ + static FUNC_QUAL mag_type rnd() { return ArithTraits::rnd(); } \ + static FUNC_QUAL int emin() { return ArithTraits::emin(); } \ + static FUNC_QUAL mag_type rmin() { return ArithTraits::rmin(); } \ + static FUNC_QUAL int emax() { return ArithTraits::emax(); } \ + static FUNC_QUAL mag_type rmax() { return ArithTraits::rmax(); } \ + static FUNC_QUAL bool isInf(const val_type x) { \ + return ArithTraits::isInf(x.real()) || ArithTraits::isInf(x.imag()); \ + } \ + static FUNC_QUAL bool isNan(const val_type x) { \ + return ArithTraits::isNan(x.real()) || ArithTraits::isNan(x.imag()); \ + } \ + static FUNC_QUAL mag_type abs(const val_type x) { return ::Kokkos::abs(x); } \ + static FUNC_QUAL mag_type real(const val_type x) { return x.real(); } \ + static FUNC_QUAL mag_type imag(const val_type x) { return x.imag(); } \ + static FUNC_QUAL val_type conj(const val_type x) { return ::Kokkos::conj(x); } \ + static FUNC_QUAL val_type pow(const val_type x, const val_type y) { return Kokkos::pow(x, y); } \ + static FUNC_QUAL val_type pow(const val_type x, const mag_type y) { return Kokkos::pow(x, y); } \ + static FUNC_QUAL val_type pow(const mag_type x, const val_type y) { return Kokkos::pow(x, y); } \ + static FUNC_QUAL val_type sqrt(const val_type x) { return ::Kokkos::sqrt(x); } \ + static FUNC_QUAL val_type exp(const val_type x) { return Kokkos::exp(x); } \ + static FUNC_QUAL val_type log(const val_type x) { return Kokkos::log(x); } \ + static FUNC_QUAL val_type log10(const val_type x) { return Kokkos::log10(x); } \ + static FUNC_QUAL val_type sin(const val_type x) { return Kokkos::sin(x); } \ + static FUNC_QUAL val_type cos(const val_type x) { return Kokkos::cos(x); } \ + static FUNC_QUAL val_type tan(const val_type x) { return Kokkos::tan(x); } \ + static FUNC_QUAL val_type sinh(const val_type x) { return Kokkos::sinh(x); } \ + static FUNC_QUAL val_type cosh(const val_type x) { return Kokkos::cosh(x); } \ + static FUNC_QUAL val_type tanh(const val_type x) { return Kokkos::tanh(x); } \ + static FUNC_QUAL val_type asin(const val_type x) { return Kokkos::asin(x); } \ + static FUNC_QUAL val_type acos(const val_type x) { return Kokkos::acos(x); } \ + static FUNC_QUAL val_type atan(const val_type x) { return Kokkos::atan(x); } \ + static FUNC_QUAL bool isnaninf(const val_type& x) { return isNan(x) || isInf(x); } \ + static FUNC_QUAL mag_type magnitude(const val_type x) { return abs(x); } \ + static FUNC_QUAL val_type conjugate(const val_type x) { return conj(x); } \ + static FUNC_QUAL val_type squareroot(const val_type x) { return sqrt(x); } \ + static FUNC_QUAL mag_type eps() { return epsilon(); } + +template +static KOKKOS_FUNCTION typename std::enable_if::is_signed, val_type>::type +KokkosKernelsAbs(const val_type x) { + return Kokkos::abs(x); +} + +template +static KOKKOS_FUNCTION typename std::enable_if::is_signed, val_type>::type +KokkosKernelsAbs(const val_type x) { + return x; +} + +template +static KOKKOS_FUNCTION typename std::enable_if::is_signed, val_type>::type +KokkosKernelsNan() { + return -1; +} + +template +static KOKKOS_FUNCTION typename std::enable_if::is_signed, val_type>::type +KokkosKernelsNan() { + return Kokkos::Experimental::finite_max::value; +} + +#define KOKKOSKERNELS_ARITHTRAITS_INTEGRAL() \ + \ + static constexpr bool is_specialized = true; \ + static constexpr bool is_integer = true; \ + static constexpr bool is_exact = true; \ + static constexpr bool is_complex = false; \ + static constexpr bool has_infinity = false; \ + \ + using magnitudeType = mag_type; \ + using halfPrecision = val_type; \ + using doublePrecision = val_type; \ + \ + static constexpr bool isComplex = false; \ + static constexpr bool isOrdinal = true; \ + static constexpr bool isComparable = true; \ + static constexpr bool hasMachineParameters = false; \ + \ + static KOKKOS_FUNCTION val_type zero() { return static_cast(0); } \ + static KOKKOS_FUNCTION val_type one() { return static_cast(1); } \ + static KOKKOS_FUNCTION val_type min() { return Kokkos::Experimental::finite_min::value; } \ + static KOKKOS_FUNCTION val_type max() { return Kokkos::Experimental::finite_max::value; } \ + static KOKKOS_FUNCTION val_type infinity() { return static_cast(0); } \ + static KOKKOS_FUNCTION val_type nan() { return KokkosKernelsNan(); } \ + static KOKKOS_FUNCTION bool isInf(const val_type) { return false; } \ + static KOKKOS_FUNCTION bool isNan(const val_type) { return false; } \ + static KOKKOS_FUNCTION mag_type abs(const val_type x) { return KokkosKernelsAbs(x); } \ + static KOKKOS_FUNCTION mag_type real(const val_type x) { return Kokkos::real(x); } \ + static KOKKOS_FUNCTION mag_type imag(const val_type) { return zero(); } \ + static KOKKOS_FUNCTION val_type conj(const val_type x) { return x; } \ + static KOKKOS_FUNCTION val_type pow(const val_type x, const val_type y) { return Kokkos::pow(x, y); } \ + static KOKKOS_FUNCTION val_type sqrt(const val_type x) { return static_cast(Kokkos::sqrt(abs(x))); } \ + static KOKKOS_FUNCTION val_type cbrt(const val_type x) { return static_cast(Kokkos::cbrt(abs(x))); } \ + static KOKKOS_FUNCTION val_type exp(const val_type x) { return static_cast(Kokkos::exp(abs(x))); } \ + static KOKKOS_FUNCTION val_type log(const val_type x) { return static_cast(Kokkos::log(abs(x))); } \ + static KOKKOS_FUNCTION val_type log10(const val_type x) { return static_cast(Kokkos::log10(abs(x))); } \ + static KOKKOS_FUNCTION mag_type epsilon() { return zero(); } \ + static KOKKOS_FUNCTION magnitudeType magnitude(const val_type x) { return abs(x); } \ + static KOKKOS_FUNCTION val_type conjugate(const val_type x) { return conj(x); } \ + static KOKKOS_FUNCTION bool isnaninf(const val_type) { return false; } \ + static KOKKOS_FUNCTION val_type squareroot(const val_type x) { return sqrt(x); } + +/// \class ArithTraits +/// \brief Traits class for arithmetic on type T. +/// \tparam T "Scalar" type of interest +/// +/// This is a traits class for the "arithmetic" type T. "Arithmetic +/// types" include built-in signed and unsigned integer types, +/// floating-point types, complex-valued types, and anything else that +/// looks like these. This class is useful for implementing numerical +/// algorithms that are generic on the data type. You may also use +/// this class to query attributes of T, like whether it is signed or +/// complex, or its precision. +/// +/// We really did not want to implement this class or expose it to +/// users. It would be much better to use existing traits classes +/// like std::numeric_limits. We decided to implement and expose this +/// class for the following reasons: +///
    +///
  1. std::numeric_limits class methods cannot be used in CUDA +/// device functions, since they themselves are not device +/// functions
  2. +///
  3. Existing traits classes like std::numeric_limits do not +/// provide enough information to implement algorithms that are +/// agnostic of whether T is real-valued or complex-valued.
  4. +///
+/// +/// All class methods must be suitable for parallel kernels, if the +/// type T itself is suitable for parallel kernels. In particular, +/// specializations for types T that make sense to use on a CUDA +/// device must mark all class methods as device (and host) functions, +/// using the KOKKOS_FORCEINLINE_FUNCTION macro. All class methods must be +/// callable both inside and outside a parallel kernel (for CUDA, this +/// means they must be marked as both device and host functions). +/// +/// \section Kokkos_ArithTraits_compat Compatibility +/// +/// Whenever possible, class methods in ArithTraits use the same names +/// as their equivalents in the C++ Standard Library. If this was not +/// possible, for example with isInf and isNan, we explain why in +/// their documentation. +/// +/// This class has redundant typedefs and methods in order to maintain +/// backwards compatibility with Teuchos::ScalarTraits, while +/// preferring forwards (partial) compatibility with +/// std::numeric_limits. Users should prefer typedefs, \c bool +/// constants, and class methods compatible with std::numeric_limits, +/// to those from Teuchos::ScalarTraits. The latter may go away at +/// any time. Furthermore, Teuchos::ScalarTraits contains methods +/// that do not make sense for use as parallel device functions, in +/// particular those relating to pseudorandom number generation that +/// refer to hidden state, so we will never include all class methods +/// from Teuchos::ScalarTraits in ArithTraits. +/// +/// \section Kokkos_ArithTraits_unsupp Unsupported types on CUDA devices +/// +/// CUDA does not support long double or std::complex in device +/// functions. ArithTraits does have specializations for these types, +/// but the class methods therein are not marked as device functions. +/// +/// \section Kokkos_ArithTraits_whyNotC99 What about C99 integer types? +/// +/// C99 and C++11 include typedefs int${N}_t and uint${N}_t, where N +/// is the number of bits in the integer. These typedefs are useful +/// because they make the length of the type explicit. Users are +/// welcome to use these types as the template parameter of +/// ArithTraits. +/// +/// We chose not to use these types when defining full +/// specializations of ArithTraits. This is because the C99 integer +/// types are typedefs, not types in themselves. This makes it +/// impossible to avoid duplicate or missing full specializations of +/// ArithTraits. For example, on my Mac, for CUDA 5.5, gcc 4.2.1, and +/// Clang 3.2, int64_t is a typedef of long long, +/// but long long and long are separate types, even +/// though they have the same length (64 bits). In contrast, on +/// Windows (even Win64), long is a 32-bit type (but a +/// distinct type from int), and long long is a +/// 64-bit type. Thus, if we define full specializations of +/// ArithTraits using only the C99 integer types, we will be +/// missing a specialization for long on at least one +/// platform. +/// +/// Rather than trouble ourselves with trying to figure this out for +/// each platform, we decided to provide specializations only for the +/// integer types in the C89 and C++03 language standards. This +/// includes signed and unsigned versions of char, +/// short, int, and long. We also include +/// long long if your platform supports it. We may thus have +/// left out some C99 integer type, but this is only possible if the +/// C89 / C++03 integer types do not have complete coverage of all +/// powers of two bits from 8 up to the longest provided length (e.g., +/// 64 on a 64-bit system). On all platforms I have encountered, +/// char has 8 bits and short has 16 bits, so I am +/// not worried about missing specializations for int16_t or +/// uint16_t. If you should find that either of these +/// specializations are missing, though, please let us know. +/// +/// Note that char, signed char, and unsigned +/// char are distinct types, whether char is signed or +/// unsigned. (The language standards do not specify whether +/// char is signed or unsigned.) That is, char is +/// not a typedef of signed char or unsigned +/// char. This is why we provide full specializations of +/// ArithTraits for each of these types. Interestingly enough, on my +/// system, char and int8_t are different types, but +/// signed char and int8_t are the same. +/// +/// \section Kokkos_ArithTraits_impl Implementation notes +/// +/// This section contains notes to developers who which to add a +/// partial specialization of this class for a new type T. If you +/// decide to write a default templated implementation, it must not +/// declare any methods as device functions. This ensures correct +/// behavior for arbitrary T, but does require specializations for +/// common types like T = float and double, as well as for other types +/// T that make sense to use on a CUDA device. +template +class ArithTraits { + public: + /// \brief A type that acts like T and works with Kokkos. + /// + /// This is usually just an alias for T. However, some types T do + /// not work well with Kokkos. In that case, we use a mostly + /// equivalent type here. For example, ArithTraits + /// >::val_type is Kokkos::complex. + using val_type = T; + /// \brief The type of the magnitude (absolute value) of T. + /// + /// We define this as the type returned by abs() in this class. If + /// T is real (not complex), then \c val_type and \c mag_type are + /// usually the same. If T is std::complex for some R, + /// then R and \c mag_type are usually the same. + using mag_type = T; + + //! Whether ArithTraits has a specialization for T. + static constexpr bool is_specialized = false; + //! Whether T is a signed type (has negative values). + static constexpr bool is_signed = false; + //! Whether T is an integer type. + static constexpr bool is_integer = false; + /// \brief Whether T "uses exact representations." + /// + /// The opposite of is_exact is "is approximate," that is, "may + /// commit rounding error." + static constexpr bool is_exact = false; + //! Whether T is a complex-valued type. + static constexpr bool is_complex = false; + + /// \brief Whether x is Inf. + /// + /// This can only be true for floating-point types T that support + /// Inf. If T is a complex type, we say that a T instance x is Inf + /// if and only if isinf(real(x)) || isinf(imag(x)). + /// + /// Unfortunately we can't call this "isinf" (the equivalent C99 + /// function), because CUDA appears to implement that function using + /// a macro, rather than using a function (as C++11 requires). + static KOKKOS_FUNCTION bool isInf(const T& x); + + /// \brief Whether x is NaN (not a number). + /// + /// This can only be true for floating-point types T that support + /// NaN. If T is a complex type, we say that a T instance x is NaN + /// if and only if isNan(real(x)) || isNan(imag(x)). + /// + /// Unfortunately we can't call this "isnan" (the equivalent C99 + /// function), because CUDA appears to implement that function using + /// a macro, rather than using a function (as C++11 requires). + static KOKKOS_FUNCTION bool isNan(const T& x); + + //! The absolute value (magnitude) of x. + static KOKKOS_FUNCTION mag_type abs(const T& x); + + //! The zero value of T; the arithmetic identity. + static KOKKOS_FUNCTION T zero(); + + //! The one value of T; the multiplicative identity. + static KOKKOS_FUNCTION T one(); + + /// \brief True if this type T is capable of representing the + /// positive infinity as a distinct special value, as with + /// std::numeric_limits::has_infinity. + static constexpr bool has_infinity = false; + + /// \brief Returns the special value "positive infinity", as + /// represented by the floating-point type T. Only meaningful if + /// KokkosArithTraits::has_infinity == true. Provides same + /// functionality as std::numeric_limits::infinity(). + /// + /// \note Would have liked to mark it as constexpr but then would + /// not be able to provide the specialization for std::complex + /// since its constructor only becomes constexpr with C++14. + static KOKKOS_FUNCTION T infinity(); + + /// \brief The minimum possible value of T. + /// + /// If T is a real floating-point type, then this is the minimum + /// positive value, as with std::numeric_limits::min(). + static KOKKOS_FUNCTION T min(); + + //! The maximum possible value of T. + static KOKKOS_FUNCTION T max(); + + /// \brief The real part of x. + /// + /// If \c is_complex is false, then this just returns x. + static KOKKOS_FUNCTION mag_type real(const T& x); + + /// \brief The imaginary part of x. + /// + /// If \c is_complex is false, then this just returns zero(). + static KOKKOS_FUNCTION mag_type imag(const T&); + + /// \brief The complex conjugate of x. + /// + /// If \c is_complex is false, then this just returns x. + static KOKKOS_FUNCTION T conj(const T&); + + //! x raised to the power y. + static KOKKOS_FUNCTION T pow(const T& x, const T& y); + + /// \brief The square root of x. + /// + /// If T is an integer type, this is the floor of the square root. + /// If T is a complex-valued type, then this method returns the + /// principal branch of the square root. + /// + /// If T is real-valued and x is negative, the result of the square + /// root is undefined in general. (CUDA does not allow throwing + /// exceptions in device functions.) Implementations should return + /// NaN if the type T supports this. Of course, in that case, the + /// square of the result will not equal x. + static KOKKOS_FUNCTION T sqrt(const T& x); + + /// \brief The cubic root of x. + /// + /// If T is an integer type, this is the floor of the cubic root. + /// If T is a complex-valued type, then this method returns the + /// principal branch of the cubic root. + /// + /// If T is real-valued and x is negative, the result of the cubic + /// root is undefined in general. (CUDA does not allow throwing + /// exceptions in device functions.) Implementations should return + /// NaN if the type T supports this. Of course, in that case, the + /// cubic of the result will not equal x. + static KOKKOS_FUNCTION T cbrt(const T& x); + + /// \brief The natural (base e) exponential function of x. + /// + /// If T is an integer type, this is the floor of the exponential + /// function. If T is a complex-valued type, then this method + /// returns \f$e^{x+iy} = e^x ( cos(y) + i sin(y) )\f$. + /// + static KOKKOS_FUNCTION T exp(const T& x); + + /// \brief The natural (base e) logarithm of x. + /// + /// If T is an integer type, this is the floor of the logarithm. If + /// T is a complex-valued type, then this method returns the + /// principal branch of the logarithm. + /// + /// If T is real-valued and x is negative, the result of the + /// logarithm is undefined in general. (CUDA does not allow + /// throwing exceptions in device functions.) Implementations + /// should return NaN if the type T supports this. Of course, in + /// that case, if y is the result, \f$e^y\f$ will not equal x. + static KOKKOS_FUNCTION T log(const T& x); + + /// \brief The base ten logarithm of the input. + /// + /// If T is an integer type, this is the floor of the logarithm. If + /// T is a complex-valued type, then this method returns the + /// principal branch of the logarithm. + /// + /// If T is real-valued and x is negative, the result of the + /// logarithm is undefined in general. (CUDA does not allow + /// throwing exceptions in device functions.) Implementations + /// should return NaN if the type T supports this. Of course, in + /// that case, if y is the result, \f$10^y\f$ will not equal x. + static KOKKOS_FUNCTION T log10(const T& x); + + /// Trigonometric and hyperbolic functions are not available + /// for integer types. This is because asin(sin(x)) is not x + /// when x is integer with a rounding error. + /// + /// KJ: log, exp also has this problem. We probably need to + /// disable them for integer types instead of providing + /// functionality with floor. + + /// \brief The sin function of x + /// + static KOKKOS_FUNCTION T sin(const T& x); + + /// \brief The cos function of x + /// + static KOKKOS_FUNCTION T cos(const T& x); + + /// \brief The tan function of x + /// + static KOKKOS_FUNCTION T tan(const T& x); + + /// \brief The sin hyperbolic function of x + /// + static KOKKOS_FUNCTION T sinh(const T& x); + + /// \brief The cos hyperbolic function of x + /// + static KOKKOS_FUNCTION T cosh(const T& x); + + /// \brief The tan hyperbolic function of x + /// + static KOKKOS_FUNCTION T tanh(const T& x); + + /// \brief The asin function of x + /// + static KOKKOS_FUNCTION T asin(const T& x); + + /// \brief The acos function of x + /// + static KOKKOS_FUNCTION T acos(const T& x); + + /// \brief The atan function of x + /// + static KOKKOS_FUNCTION T atan(const T& x); + + /// \brief Return a silent NaN, if appropriate for T. + /// + /// If T does not implement a silent NaN, the return value is + /// undefined, but calling this method is still allowed. + static KOKKOS_FUNCTION T nan(); + + /// \brief Machine epsilon. + /// + /// If T is an integer type (std::numeric_traits::is_exact is + /// true), then epsilon() returns 0. Otherwise, if T is a + /// floating-point type, it returns machine epsilon that T. + static KOKKOS_FUNCTION mag_type epsilon(); + + //@{ + /// \name Traits defined for backwards compatibility with + /// Teuchos::ScalarTraits + /// + /// All of the typedefs, \c bool constants, and class methods in + /// this section are defined in order that one may replace most uses + /// of Teuchos::ScalarTraits with ArithTraits. Users who do not + /// have this backwards compatibility requirement should prefer + /// equivalents in other sections. Those class methods which have + /// the same name and meaning in both Teuchos::ScalarTraits and this + /// class, such as log() and pow(), are not in this section. + + //! Same as mag_type; the type of the absolute value (magnitude) of T. + using magnitudeType = T; + + /// \brief The type with "half the precision" of T. + /// + /// This typedef only makes sense if T is a floating-point type. + using halfPrecision = T; + + /// \brief The type with "twice the the precision" of T. + /// + /// This typedef only makes sense if T is a floating-point type. + using doublePrecision = T; + + static constexpr bool isComplex = false; + static constexpr bool isOrdinal = false; + static constexpr bool isComparable = false; + + /// \brief True if this type T has floating-point parameters. + /// + /// This is true if and only if this specialization of ArithTraits + /// has "machine-specific" parameters eps(), sfmin(), base(), + /// prec(), t(), rnd(), emin(), rmin(), emax(), and rmax(), relating + /// to floating-point types. + static constexpr bool hasMachineParameters = false; + + //! Return relative machine precision. + static KOKKOS_FUNCTION mag_type eps(); + + //! Return safe minimum (sfmin), such that 1/sfmin does not overflow. + static KOKKOS_FUNCTION mag_type sfmin(); + + //! Return the base of the scalar type T. + static KOKKOS_FUNCTION int base(); + + //! Return eps*base. + static KOKKOS_FUNCTION mag_type prec(); + + //! Returns the number of (base) digits in the significand. + static KOKKOS_FUNCTION int t(); + + //! 1.0 when rounding occurs in addition, else 0.0. + static KOKKOS_FUNCTION mag_type rnd(); + + //! Returns the minimum exponent before (gradual) underflow. + static KOKKOS_FUNCTION int emin(); + + //! Returns the underflow threshold: base^(emin-1) + static KOKKOS_FUNCTION mag_type rmin(); + + //! Returns the largest exponent before overflow. + static KOKKOS_FUNCTION int emax(); + + //! Overflow theshold: (base^emax)*(1-eps) + static KOKKOS_FUNCTION mag_type rmax(); + + //! Same as abs(); return the magnitude of x. + static KOKKOS_FUNCTION magnitudeType magnitude(const T& x); + + //! Same as conj(); return the complex conjugate of x. + static KOKKOS_FUNCTION T conjugate(const T& x); + + /// \brief Whether x is (silent) NaN or Inf. + /// + /// This is the same as isNan(x) || isInf(x). + static KOKKOS_FUNCTION bool isnaninf(const T& x); + + /// \brief The string name of T. + /// + /// Note that this is not a device function. + static std::string name(); + + //! Same as sqrt(x); the square root of x. + static KOKKOS_FUNCTION T squareroot(const T& x); + //@} +}; + +#if defined(KOKKOS_HALF_T_IS_FLOAT) && !KOKKOS_HALF_T_IS_FLOAT +template <> +class ArithTraits { + public: + using val_type = Kokkos::Experimental::half_t; + using mag_type = val_type; + + static constexpr bool is_specialized = true; + static constexpr bool is_signed = true; + static constexpr bool is_integer = false; + static constexpr bool is_exact = false; + static constexpr bool is_complex = false; + static constexpr bool has_infinity = true; + + // Backwards compatibility with Teuchos::ScalarTraits. + using magnitudeType = mag_type; + using halfPrecision = Kokkos::Experimental::half_t; + using doublePrecision = float; + + static std::string name() { return "half_t"; } + + static constexpr bool isComplex = false; + static constexpr bool isOrdinal = false; + static constexpr bool isComparable = true; + static constexpr bool hasMachineParameters = true; + +#if defined(KOKKOS_ENABLE_SYCL) || defined(KOKKOS_ENABLE_HIP) + KOKKOSKERNELS_ARITHTRAITS_HALF_FP(KOKKOS_FUNCTION) +#else + KOKKOSKERNELS_ARITHTRAITS_REAL_FP(KOKKOS_FUNCTION) +#endif +}; +#endif // #if defined(KOKKOS_HALF_T_IS_FLOAT) && !KOKKOS_HALF_T_IS_FLOAT + +// Since Kokkos::Experimental::bhalf_t falls back to float, only define +// ArithTraits if bhalf_t is a backend specialization +#if defined(KOKKOS_BHALF_T_IS_FLOAT) && !KOKKOS_BHALF_T_IS_FLOAT +template <> +class ArithTraits { + public: + using val_type = Kokkos::Experimental::bhalf_t; + using mag_type = val_type; + + static constexpr bool is_specialized = true; + static constexpr bool is_signed = true; + static constexpr bool is_integer = false; + static constexpr bool is_exact = false; + static constexpr bool is_complex = false; + static constexpr bool has_infinity = true; + + // Backwards compatibility with Teuchos::ScalarTraits. + using magnitudeType = mag_type; + using bhalfPrecision = Kokkos::Experimental::bhalf_t; + // There is no type that has twice the precision as bhalf_t. + // The closest type would be float. + using doublePrecision = void; + + static constexpr bool isComplex = false; + static constexpr bool isOrdinal = false; + static constexpr bool isComparable = true; + static constexpr bool hasMachineParameters = true; + + static std::string name() { return "bhalf_t"; } + +#if defined(KOKKOS_ENABLE_SYCL) || defined(KOKKOS_ENABLE_HIP) + KOKKOSKERNELS_ARITHTRAITS_HALF_FP(KOKKOS_FUNCTION) +#else + KOKKOSKERNELS_ARITHTRAITS_REAL_FP(KOKKOS_FUNCTION) +#endif +}; +#endif // #if defined(KOKKOS_BHALF_T_IS_FLOAT) && !KOKKOS_BHALF_T_IS_FLOAT + +template <> +class ArithTraits { + public: + using val_type = float; + using mag_type = val_type; + + static constexpr bool is_specialized = true; + static constexpr bool is_signed = true; + static constexpr bool is_integer = false; + static constexpr bool is_exact = false; + static constexpr bool is_complex = false; + static constexpr bool has_infinity = true; + + // Backwards compatibility with Teuchos::ScalarTraits. + using magnitudeType = mag_type; + using halfPrecision = float; // Should we switch to Kokkos::half_t + using doublePrecision = double; + + static constexpr bool isComplex = false; + static constexpr bool isOrdinal = false; + static constexpr bool isComparable = true; + static constexpr bool hasMachineParameters = true; + + static std::string name() { return "float"; } + + KOKKOSKERNELS_ARITHTRAITS_REAL_FP(KOKKOS_FUNCTION) +}; + +template <> +class ArithTraits { + public: + using val_type = double; + using mag_type = val_type; + + static constexpr bool is_specialized = true; + static constexpr bool is_signed = true; + static constexpr bool is_integer = false; + static constexpr bool is_exact = false; + static constexpr bool is_complex = false; + static constexpr bool has_infinity = true; + + // Backwards compatibility with Teuchos::ScalarTraits. + using magnitudeType = mag_type; + using halfPrecision = float; +#if defined(__CUDA_ARCH__) + using doublePrecision = double; // CUDA doesn't support long double, unfortunately +#elif defined(__HIP_DEVICE_COMPILE__) + using doublePrecision = double; // HIP does not support long double unfortunately +#else + using doublePrecision = long double; +#endif // __CUDA_ARCH__ + static constexpr bool isComplex = false; + static constexpr bool isOrdinal = false; + static constexpr bool isComparable = true; + static constexpr bool hasMachineParameters = true; + + static std::string name() { return "double"; } + + KOKKOSKERNELS_ARITHTRAITS_REAL_FP(KOKKOS_FUNCTION) +}; + +// CUDA and HIP do not support long double in device functions, +// so none of the class methods in this specialization are marked +// as device functions. +template <> +class ArithTraits { + public: + using val_type = long double; + using mag_type = long double; + + static constexpr bool is_specialized = true; + static constexpr bool is_signed = true; + static constexpr bool is_integer = false; + static constexpr bool is_exact = false; + static constexpr bool is_complex = false; + static constexpr bool has_infinity = true; + + // Backwards compatibility with Teuchos::ScalarTraits. + using magnitudeType = mag_type; + using halfPrecision = double; + // It might be appropriate to use QD's qd_real here. + // For now, long double is the most you get. + using doublePrecision = val_type; + + static constexpr bool isComplex = false; + static constexpr bool isOrdinal = false; + static constexpr bool isComparable = true; + static constexpr bool hasMachineParameters = true; + + static std::string name() { return "long double"; } + + KOKKOSKERNELS_ARITHTRAITS_REAL_FP() +}; // long double specialization + +#if defined(KOKKOS_ENABLE_LIBQUADMATH) +// CUDA does not support __float128 in device functions, so none of +// the class methods in this specialization are marked as device +// functions. +template <> +class ArithTraits<__float128> { + public: + using val_type = __float128; + using mag_type = val_type; + + static constexpr bool is_specialized = true; + static constexpr bool is_signed = true; + static constexpr bool is_integer = false; + static constexpr bool is_exact = false; + static constexpr bool is_complex = false; + static constexpr bool has_infinity = true; + + // Backwards compatibility with Teuchos::ScalarTraits. + using magnitudeType = mag_type; + using halfPrecision = double; + // Unfortunately, we can't rely on a standard __float256 type. + using doublePrecision = __float128; + + static constexpr bool isComplex = false; + static constexpr bool isOrdinal = false; + static constexpr bool isComparable = true; + static constexpr bool hasMachineParameters = true; + + static std::string name() { return "__float128"; } + + KOKKOSKERNELS_ARITHTRAITS_REAL_FP() +}; // __float128 specialization +#endif // KOKKOS_ENABLE_LIBQUADMATH + +template <> +class ArithTraits<::Kokkos::complex> { + public: + using val_type = ::Kokkos::complex; + using mag_type = float; + + static std::string name() { return "Kokkos::complex"; } + + KOKKOSKERNELS_ARITHTRAITS_CMPLX_FP(KOKKOS_FUNCTION) +}; + +template <> +class ArithTraits<::Kokkos::complex> { + public: + using val_type = ::Kokkos::complex; + using mag_type = double; + + static std::string name() { return "Kokkos::complex"; } + + KOKKOSKERNELS_ARITHTRAITS_CMPLX_FP(KOKKOS_FUNCTION) +}; + +/// \brief Partial specialization for std::complex. +/// +/// The C++ Standard Library (with C++03 at least) only allows +/// std::complex for RealFloatType = float, double, or +/// long double. +template +class ArithTraits> { + public: + //! Kokkos internally replaces std::complex with Kokkos::complex. + using val_type = ::Kokkos::complex; + using mag_type = RealFloatType; + + static constexpr bool is_specialized = true; + static constexpr bool is_signed = true; + static constexpr bool is_integer = false; + static constexpr bool is_exact = false; + static constexpr bool is_complex = true; + + static constexpr bool has_infinity = true; + static std::complex infinity() { + return std::complex(ArithTraits::infinity(), ArithTraits::infinity()); + } + +#ifdef KOKKOS_ENABLE_SYCL + template + static bool isInf(const std::complex& x) { + if constexpr (std::is_same_v) { + Kokkos::abort("isInf not available for std::complex!\n"); + return true; + } else { + KOKKOS_IF_ON_HOST((using std::isinf;)) + KOKKOS_IF_ON_DEVICE((using sycl::isinf;)) + return isinf(std::real(x)) || isinf(std::imag(x)); + } + } +#else + static bool isInf(const std::complex& x) { + return std::isinf(std::real(x)) || std::isinf(std::imag(x)); + } +#endif + +#ifdef KOKKOS_ENABLE_SYCL + template + static bool isNan(const std::complex& x) { + if constexpr (std::is_same_v) { + Kokkos::abort("isNan not available for std::complex!\n"); + return true; + } else { + KOKKOS_IF_ON_HOST((using std::isnan;)) + KOKKOS_IF_ON_DEVICE((using sycl::isnan;)) + return isnan(std::real(x)) || isnan(std::imag(x)); + } + } +#else + static bool isNan(const std::complex& x) { + return std::isnan(std::real(x)) || std::isnan(std::imag(x)); + } +#endif + static mag_type abs(const std::complex& x) { return std::abs(x); } + static std::complex zero() { + return std::complex(ArithTraits::zero(), ArithTraits::zero()); + } + static std::complex one() { + return std::complex(ArithTraits::one(), ArithTraits::zero()); + } + static std::complex min() { + return std::complex(ArithTraits::min(), ArithTraits::zero()); + } + static std::complex max() { + return std::complex(ArithTraits::max(), ArithTraits::zero()); + } + static mag_type real(const std::complex& x) { return std::real(x); } + static mag_type imag(const std::complex& x) { return std::imag(x); } + static std::complex conj(const std::complex& x) { return std::conj(x); } + static std::complex pow(const std::complex& x, const std::complex& y) { + // Fix for some weird gcc 4.2.1 inaccuracy. + if (y == one()) { + return x; + } else if (y == one() + one()) { + return x * x; + } else { + return std::pow(x, y); + } + } + static std::complex pow(const std::complex& x, const RealFloatType& y) { + // Fix for some weird gcc 4.2.1 inaccuracy. + if (y == ArithTraits::one()) { + return x; + } else if (y == ArithTraits::one() + ArithTraits::one()) { + return x * x; + } else { + return std::pow(x, y); + } + } + static std::complex sqrt(const std::complex& x) { return std::sqrt(x); } + static std::complex cbrt(const std::complex& x) { +#ifdef KOKKOS_ENABLE_SYCL + KOKKOS_IF_ON_DEVICE((return sycl::cbrt(x);)) + KOKKOS_IF_ON_HOST((return ::cbrt(x);)) +#else + return ::cbrt(x); +#endif + } + static std::complex exp(const std::complex& x) { return std::exp(x); } + static std::complex log(const std::complex& x) { return std::log(x); } + static std::complex log10(const std::complex& x) { return std::log10(x); } + static std::complex sin(const std::complex& x) { return std::sin(x); } + static std::complex cos(const std::complex& x) { return std::cos(x); } + static std::complex tan(const std::complex& x) { +#ifdef KOKKOS_ENABLE_SYCL + KOKKOS_IF_ON_DEVICE((return sycl::tan(x);)) + KOKKOS_IF_ON_HOST((return std::tan(x);)) +#else + return std::tan(x); +#endif + } + static std::complex sinh(const std::complex& x) { return std::sinh(x); } + static std::complex cosh(const std::complex& x) { return std::cosh(x); } + static std::complex tanh(const std::complex& x) { return std::tanh(x); } + static std::complex asin(const std::complex& x) { +#ifdef KOKKOS_ENABLE_SYCL + KOKKOS_IF_ON_DEVICE((return sycl::asin(x);)) + KOKKOS_IF_ON_HOST((return ::asin(x);)) +#else + return ::asin(x); +#endif + } + static std::complex acos(const std::complex& x) { +#ifdef KOKKOS_ENABLE_SYCL + KOKKOS_IF_ON_DEVICE((return sycl::acos(x);)) + KOKKOS_IF_ON_HOST((return ::acos(x);)) +#else + return ::acos(x); +#endif + } + static std::complex atan(const std::complex& x) { +#ifdef KOKKOS_ENABLE_SYCL + KOKKOS_IF_ON_DEVICE((using sycl::atan;)) + KOKKOS_IF_ON_HOST((using ::atan;)) +#else + using std::atan; +#endif + return atan(x); + } + static std::complex nan() { + const mag_type mag_nan = ArithTraits::nan(); + return std::complex(mag_nan, mag_nan); + } + static mag_type epsilon() { return ArithTraits::epsilon(); } + + // Backwards compatibility with Teuchos::ScalarTraits. + using magnitudeType = mag_type; + using halfPrecision = std::complex::halfPrecision>; + using doublePrecision = std::complex::doublePrecision>; + + static constexpr bool isComplex = true; + static constexpr bool isOrdinal = false; + static constexpr bool isComparable = false; + static constexpr bool hasMachineParameters = true; + static bool isnaninf(const std::complex& x) { return isNan(x) || isInf(x); } + static mag_type magnitude(const std::complex& x) { return abs(x); } + static std::complex conjugate(const std::complex& x) { return conj(x); } + static std::string name() { return std::string("std::complex<") + ArithTraits::name() + ">"; } + static std::complex squareroot(const std::complex& x) { return sqrt(x); } + static mag_type eps() { return epsilon(); } + static mag_type sfmin() { return ArithTraits::sfmin(); } + static int base() { return ArithTraits::base(); } + static mag_type prec() { return ArithTraits::prec(); } + static int t() { return ArithTraits::t(); } + static mag_type rnd() { return ArithTraits::one(); } + static int emin() { return ArithTraits::emin(); } + static mag_type rmin() { return ArithTraits::rmin(); } + static int emax() { return ArithTraits::emax(); } + static mag_type rmax() { return ArithTraits::rmax(); } +}; + +template <> +class ArithTraits { + public: + using val_type = char; + using mag_type = val_type; + + // The C(++) standard does not require that char be signed. In + // fact, signed char, unsigned char, and char are distinct types. + // We can use std::numeric_limits here because it's a const bool, + // not a class method. + static constexpr bool is_signed = std::numeric_limits::is_signed; + + static std::string name() { return "char"; } + + KOKKOSKERNELS_ARITHTRAITS_INTEGRAL() +}; + +template <> +class ArithTraits { + public: + using val_type = signed char; + using mag_type = val_type; + + static constexpr bool is_signed = true; + + static std::string name() { return "signed char"; } + + KOKKOSKERNELS_ARITHTRAITS_INTEGRAL() +}; + +template <> +class ArithTraits { + public: + using val_type = unsigned char; + using mag_type = val_type; + + static constexpr bool is_signed = false; + + static std::string name() { return "unsigned char"; } + + KOKKOSKERNELS_ARITHTRAITS_INTEGRAL() +}; + +template <> +class ArithTraits { + public: + using val_type = short; + using mag_type = val_type; + + static constexpr bool is_signed = true; + + static std::string name() { return "short"; } + + KOKKOSKERNELS_ARITHTRAITS_INTEGRAL() +}; + +template <> +class ArithTraits { + public: + using val_type = unsigned short; + using mag_type = val_type; + + static constexpr bool is_signed = false; + + static std::string name() { return "unsigned short"; } + + KOKKOSKERNELS_ARITHTRAITS_INTEGRAL() +}; + +template <> +class ArithTraits { + public: + using val_type = int; + using mag_type = val_type; + + static constexpr bool is_signed = true; + + static std::string name() { return "int"; } + + KOKKOSKERNELS_ARITHTRAITS_INTEGRAL() +}; + +template <> +class ArithTraits { + public: + using val_type = unsigned int; + using mag_type = val_type; + + static constexpr bool is_signed = false; + + static std::string name() { return "unsigned int"; } + + KOKKOSKERNELS_ARITHTRAITS_INTEGRAL() +}; + +template <> +class ArithTraits { + public: + using val_type = long; + using mag_type = val_type; + + static constexpr bool is_signed = true; + + static std::string name() { return "long"; } + + KOKKOSKERNELS_ARITHTRAITS_INTEGRAL() +}; + +template <> +class ArithTraits { + public: + using val_type = unsigned long; + using mag_type = val_type; + + static constexpr bool is_signed = false; + + static std::string name() { return "unsigned long"; } + + KOKKOSKERNELS_ARITHTRAITS_INTEGRAL() +}; + +template <> +class ArithTraits { + public: + using val_type = long long; + using mag_type = val_type; + + static constexpr bool is_signed = true; + + static std::string name() { return "long long"; } + + KOKKOSKERNELS_ARITHTRAITS_INTEGRAL() +}; + +template <> +class ArithTraits { + public: + using val_type = unsigned long long; + using mag_type = val_type; + + static constexpr bool is_signed = false; + + static std::string name() { return "unsigned long long"; } + + KOKKOSKERNELS_ARITHTRAITS_INTEGRAL() +}; + +// dd_real and qd_real are floating-point types provided by the QD +// library of David Bailey (LBNL): +// +// http://crd-legacy.lbl.gov/~dhbailey/mpdist/ +// +// dd_real uses two doubles (128 bits), and qd_real uses four doubles +// (256 bits). +// +// Kokkos does not currently support these types in device +// functions. It should be possible to use Kokkos' support for +// aggregate types to implement device function support for dd_real +// and qd_real, but we have not done this yet (as of 09 Jan 2015). +// Hence, the class methods of the ArithTraits specializations for +// dd_real and qd_real are not marked as device functions. +#ifdef HAVE_KOKKOS_QD +// LBV: I would like to deprecate this strange optional +// dependency on the lbnl package, is there anyone actully +// using this? It certainly is never tested by CI or nightly +// so probably does not work... +template <> +struct [[deprecated]] ArithTraits { + typedef dd_real val_type; + typedef dd_real mag_type; + + static const bool is_specialized = true; + static const bool is_signed = true; + static const bool is_integer = false; + static const bool is_exact = false; + static const bool is_complex = false; + + static inline bool isInf(const val_type& x) { return isinf(x); } + static inline bool isNan(const val_type& x) { return isnan(x); } + static inline mag_type abs(const val_type& x) { return ::abs(x); } + static inline val_type zero() { return val_type(0.0); } + static inline val_type one() { return val_type(1.0); } + static inline val_type min() { return std::numeric_limits::min(); } + static inline val_type max() { return std::numeric_limits::max(); } + static inline mag_type real(const val_type& x) { return x; } + static inline mag_type imag(const val_type&) { return zero(); } + static inline val_type conj(const val_type& x) { return x; } + static inline val_type pow(const val_type& x, const val_type& y) { return ::pow(x, y); } + static inline val_type sqrt(const val_type& x) { +#ifdef KOKKOS_ENABLE_SYCL + KOKKOS_IF_ON_DEVICE((return sycl::sqrt(x);)) + KOKKOS_IF_ON_HOST((return ::sqrt(x);)) +#else + return ::sqrt(x); +#endif + } + static inline val_type cbrt(const val_type& x) { +#ifdef KOKKOS_ENABLE_SYCL + KOKKOS_IF_ON_DEVICE((return sycl::cbrt(x);)) + KOKKOS_IF_ON_HOST((return ::cbrt(x);)) +#else + return ::cbrt(x); +#endif + } + static inline val_type exp(const val_type& x) { return ::exp(x); } + static inline val_type log(const val_type& x) { + // dd_real puts its transcendental functions in the global namespace. + return ::log(x); + } + static inline val_type log10(const val_type& x) { return ::log10(x); } + static KOKKOS_FUNCTION val_type sin(const val_type x) { return ::sin(x); } + static KOKKOS_FUNCTION val_type cos(const val_type x) { return ::cos(x); } + static KOKKOS_FUNCTION val_type tan(const val_type x) { +#ifdef KOKKOS_ENABLE_SYCL + KOKKOS_IF_ON_DEVICE((return sycl::tan(x);)) + KOKKOS_IF_ON_HOST((return std::tan(x);)) +#else + return std::tan(x); +#endif + } + static KOKKOS_FUNCTION val_type sinh(const val_type x) { return ::sinh(x); } + static KOKKOS_FUNCTION val_type cosh(const val_type x) { return ::cosh(x); } + static KOKKOS_FUNCTION val_type tanh(const val_type x) { return ::tanh(x); } + static KOKKOS_FUNCTION val_type asin(const val_type x) { +#ifdef KOKKOS_ENABLE_SYCL + KOKKOS_IF_ON_DEVICE((return sycl::asin(x);)) + KOKKOS_IF_ON_HOST((return ::asin(x);)) +#else + return ::asin(x); +#endif + } + static KOKKOS_FUNCTION val_type acos(const val_type x) { +#ifdef KOKKOS_ENABLE_SYCL + KOKKOS_IF_ON_DEVICE((return sycl::acos(x);)) + KOKKOS_IF_ON_HOST((return ::acos(x);)) +#else + return ::acos(x); +#endif + } + static KOKKOS_FUNCTION val_type atan(const val_type x) { +#ifdef KOKKOS_ENABLE_SYCL + KOKKOS_IF_ON_DEVICE((return sycl::atan(x);)) + KOKKOS_IF_ON_HOST((return ::atan(x);)) +#else + return ::atan(x); +#endif + } + static inline val_type nan() { return val_type::_nan; } + static val_type epsilon() { return std::numeric_limits::epsilon(); } + + typedef dd_real magnitudeType; + typedef double halfPrecision; + typedef qd_real doublePrecision; + + static const bool isComplex = false; + static const bool isOrdinal = false; + static const bool isComparable = true; + static const bool hasMachineParameters = true; + + static mag_type eps() { return epsilon(); } + static mag_type sfmin() { return min(); } + static int base() { return std::numeric_limits::radix; } + static mag_type prec() { return eps() * base(); } + static int t() { return std::numeric_limits::digits; } + static mag_type rnd() { return std::numeric_limits::round_style == std::round_to_nearest ? one() : zero(); } + static int emin() { return std::numeric_limits::min_exponent; } + static mag_type rmin() { return std::numeric_limits::min(); } + static int emax() { return std::numeric_limits::max_exponent; } + static mag_type rmax() { return std::numeric_limits::max(); } + static mag_type magnitude(const val_type& x) { return ::abs(x); } + static val_type conjugate(const val_type& x) { return conj(x); } + static bool isnaninf(const val_type& x) { return isNan(x) || isInf(x); } + static std::string name() { return "dd_real"; } + static val_type squareroot(const val_type& x) { +#ifdef KOKKOS_ENABLE_SYCL + KOKKOS_IF_ON_DEVICE((return sycl::sqrt(x);)) + KOKKOS_IF_ON_HOST((return ::sqrt(x);)) +#else + return ::sqrt(x); +#endif + } +}; + +template <> +struct [[deprecated]] ArithTraits { + typedef qd_real val_type; + typedef qd_real mag_type; + + static const bool is_specialized = true; + static const bool is_signed = true; + static const bool is_integer = false; + static const bool is_exact = false; + static const bool is_complex = false; + + static inline bool isInf(const val_type& x) { return isinf(x); } + static inline bool isNan(const val_type& x) { return isnan(x); } + static inline mag_type abs(const val_type& x) { return ::abs(x); } + static inline val_type zero() { return val_type(0.0); } + static inline val_type one() { return val_type(1.0); } + static inline val_type min() { return std::numeric_limits::min(); } + static inline val_type max() { return std::numeric_limits::max(); } + static inline mag_type real(const val_type& x) { return x; } + static inline mag_type imag(const val_type&) { return zero(); } + static inline val_type conj(const val_type& x) { return x; } + static inline val_type pow(const val_type& x, const val_type& y) { return ::pow(x, y); } + static inline val_type sqrt(const val_type& x) { +#ifdef KOKKOS_ENABLE_SYCL + KOKKOS_IF_ON_DEVICE((return sycl::sqrt(x);)) + KOKKOS_IF_ON_HOST((return ::sqrt(x);)) +#else + return ::sqrt(x); +#endif + } + static inline val_type cbrt(const val_type& x) { +#ifdef KOKKOS_ENABLE_SYCL + KOKKOS_IF_ON_DEVICE((return sycl::cbrt(x);)) + KOKKOS_IF_ON_HOST((return ::cbrt(x);)) +#else + return ::cbrt(x); +#endif + } + static inline val_type exp(const val_type& x) { return ::exp(x); } + static inline val_type log(const val_type& x) { + // val_type puts its transcendental functions in the global namespace. + return ::log(x); + } + static inline val_type log10(const val_type& x) { return ::log10(x); } + static KOKKOS_FUNCTION val_type sin(const val_type x) { return ::sin(x); } + static KOKKOS_FUNCTION val_type cos(const val_type x) { return ::cos(x); } + static KOKKOS_FUNCTION val_type tan(const val_type x) { +#ifdef KOKKOS_ENABLE_SYCL + KOKKOS_IF_ON_DEVICE((return sycl::tan(x);)) + KOKKOS_IF_ON_HOST((return ::tan(x);)) +#else + return std::tan(x); +#endif + } + static KOKKOS_FUNCTION val_type sinh(const val_type x) { return ::sinh(x); } + static KOKKOS_FUNCTION val_type cosh(const val_type x) { return ::cosh(x); } + static KOKKOS_FUNCTION val_type tanh(const val_type x) { return ::tanh(x); } + static KOKKOS_FUNCTION val_type asin(const val_type x) { +#ifdef KOKKOS_ENABLE_SYCL + KOKKOS_IF_ON_DEVICE((return sycl::asin(x);)) + KOKKOS_IF_ON_HOST((return ::asin(x);)) +#else + return ::asin(x); +#endif + } + static KOKKOS_FUNCTION val_type acos(const val_type x) { +#ifdef KOKKOS_ENABLE_SYCL + KOKKOS_IF_ON_DEVICE((return sycl::acos(x);)) + KOKKOS_IF_ON_HOST((return ::acos(x);)) +#else + return ::acos(x); +#endif + } + static KOKKOS_FUNCTION val_type atan(const val_type x) { +#ifdef KOKKOS_ENABLE_SYCL + KOKKOS_IF_ON_DEVICE((return sycl::atan(x);)) + KOKKOS_IF_ON_HOST((return ::atan(x);)) +#else + return ::atan(x); +#endif + } + static inline val_type nan() { return val_type::_nan; } + static inline val_type epsilon() { return std::numeric_limits::epsilon(); } + + typedef qd_real magnitudeType; + typedef dd_real halfPrecision; + // The QD library does not have an "oct-double real" class. One + // could use an arbitrary-precision library like MPFR or ARPREC, + // with the precision set appropriately, to get an + // extended-precision type for qd_real. + typedef qd_real doublePrecision; + + static const bool isComplex = false; + static const bool isOrdinal = false; + static const bool isComparable = true; + static const bool hasMachineParameters = true; + + static mag_type eps() { return epsilon(); } + static mag_type sfmin() { return min(); } + static int base() { return std::numeric_limits::radix; } + static mag_type prec() { return eps() * base(); } + static int t() { return std::numeric_limits::digits; } + static mag_type rnd() { return std::numeric_limits::round_style == std::round_to_nearest ? one() : zero(); } + static int emin() { return std::numeric_limits::min_exponent; } + static mag_type rmin() { return std::numeric_limits::min(); } + static int emax() { return std::numeric_limits::max_exponent; } + static mag_type rmax() { return std::numeric_limits::max(); } + static mag_type magnitude(const val_type& x) { return ::abs(x); } + static val_type conjugate(const val_type& x) { return conj(x); } + static bool isnaninf(const val_type& x) { return isNan(x) || isInf(x); } + static std::string name() { return "qd_real"; } + static val_type squareroot(const val_type& x) { +#ifdef KOKKOS_ENABLE_SYCL + KOKKOS_IF_ON_DEVICE((return sycl::sqrt(x);)) + KOKKOS_IF_ON_HOST((return ::sqrt(x);)) +#else + return ::sqrt(x); +#endif + } +}; +#endif // HAVE_KOKKOS_QD + +} // namespace KokkosKernels + + +#endif // KOKKOSKERNELS_ARITHTRAITS_HPP diff --git a/common/src/Kokkos_ArithTraits.hpp b/common/src/Kokkos_ArithTraits.hpp index 6f964ccb7a..5bea222650 100644 --- a/common/src/Kokkos_ArithTraits.hpp +++ b/common/src/Kokkos_ArithTraits.hpp @@ -20,1637 +20,15 @@ /// \file Kokkos_ArithTraits.hpp /// \brief Declaration and definition of KokkosKernels::ArithTraits -#include -#include -#include -#include -#include - -#include - -#include -#include -#include -#include // std::complex -#include // std::numeric_limits -#ifdef __CUDACC__ -#include -#endif - -namespace { // anonymous - -/// \fn intPowImpl -/// \tparam IntType A built-in integer type. -/// \brief Implementation of intPowSigned and intPowUnsigned. -/// -/// \pre x != 0 -/// \pre y > 0 -/// -/// Use intPowSigned or intPowUnsigned for general y. -template -KOKKOS_FORCEINLINE_FUNCTION IntType intPowImpl(const IntType x, const IntType y) { - // Recursion (unrolled into while loop): pow(x, 2y) = (x^y)^2 - IntType prod = x; - IntType y_cur = 1; - // If y == 1, then prod stays x. - while (y_cur < y) { - prod = prod * prod; - y_cur = y_cur << 1; - } - // abs(y - y_cur) < floor(log2(y)), so it won't hurt asymptotic run - // time to finish the remainder in a linear iteration. - if (y > y_cur) { - const IntType left = y - y_cur; - for (IntType k = 0; k < left; ++k) { - prod = prod * x; - } - } else if (y < y_cur) { - // There's probably a better way to do this in order to avoid the - // (expensive) integer division, but I'm not motivated to think of - // it at the moment. - const IntType left = y_cur - y; - for (IntType k = 0; k < left; ++k) { - prod = prod / x; - } - } - return prod; - - // y = 8: - // - // x,1 -> x^2,2 - // x^2,2 -> x^4,4 - // x^4,4 -> x^8,8 - // - // y = 9: - // - // x,1 -> x^2,2 - // x^2,2 -> x^4,4 - // x^4,4 -> x^8,8 - // - // y - y_cur is what's left over. Just do it one at a time. - // - // y = 3: - // x,1 -> x^2,2 - // x^2,2 -> x^4,4 -} - -// Warning free abs function for types where we don't know whether they are -// signed (like char) -template ::is_signed> -struct integer_abs { - static KOKKOS_INLINE_FUNCTION T abs(const T& val); -}; - -template -struct integer_abs { - static KOKKOS_INLINE_FUNCTION T abs(const T& x) { return x < 0 ? -x : x; } -}; - -template -struct integer_abs { - static KOKKOS_INLINE_FUNCTION T abs(const T& x) { return x; } -}; - -/// \fn intPowSigned -/// \tparam IntType A built-in signed integer type. -/// \brief Compute x raised to the power y. -/// -/// If the arguments are invalid (e.g., if x and y are both zero), the -/// result of this function is undefined. However, this function will -/// not throw an exception in that case. -template -KOKKOS_FORCEINLINE_FUNCTION typename std::enable_if::is_signed, IntType>::type -intPowSigned(const IntType x, const IntType y) { - // It's not entirely clear what to return if x and y are both zero. - // In the case of floating-point numbers, 0^0 is NaN. Here, though, - // I think it's safe to return 0. - if (x == 0) { - return 0; - } else if (y == 0) { - return 1; - } else if (y < 0) { - if (x == 1) { - return 1; - } else if (x == -1) { - return (y % 2 == 0) ? 1 : -1; - } else { - return 0; // round the fraction to zero - } - } - return intPowImpl(x, y); -} -template -KOKKOS_FORCEINLINE_FUNCTION typename std::enable_if::is_signed, IntType>::type -intPowSigned(const IntType x, const IntType y) { - // It's not entirely clear what to return if x and y are both zero. - // In the case of floating-point numbers, 0^0 is NaN. Here, though, - // I think it's safe to return 0. - if (x == 0) { - return 0; - } else if (y == 0) { - return 1; - } - return intPowImpl(x, y); -} - -/// \fn intPowUnsigned -/// \tparam IntType A built-in unsigned integer type. -/// \brief Compute x raised to the power y. -/// -/// If the arguments are invalid (e.g., if x and y are both zero), the -/// result of this function is undefined. However, this function will -/// not throw an exception in that case. -template -KOKKOS_FORCEINLINE_FUNCTION IntType intPowUnsigned(const IntType x, const IntType y) { - // It's not entirely clear what to return if x and y are both zero. - // In the case of floating-point numbers, 0^0 is NaN. Here, though, - // I think it's safe to return 0. - if (x == 0) { - return 0; - } else if (y == 0) { - return 1; - } else { - return intPowImpl(x, y); - } -} - -// It might make sense to use special sqrt() approximations for -// integer arguments, like those presented on the following web site: -// -// http://www.azillionmonkeys.com/qed/sqroot.html#implementations -// -// Note that some of the implementations on the above page break ANSI -// C(++) aliasing rules (by assigning to the results of -// reinterpret_cast-ing between int and float). It's also just a -// performance optimization and not required for a reasonable -// implementation. - -} // namespace - -namespace KokkosKernels { - -// Macro to automate the wrapping of Kokkos Mathematical Functions -#define KOKKOSKERNELS_ARITHTRAITS_REAL_FP(FUNC_QUAL) \ - static FUNC_QUAL val_type zero() { return static_cast(0); } \ - static FUNC_QUAL val_type one() { return static_cast(1); } \ - static FUNC_QUAL val_type min() { return Kokkos::Experimental::finite_min::value; } \ - static FUNC_QUAL val_type max() { return Kokkos::Experimental::finite_max::value; } \ - static FUNC_QUAL val_type infinity() { return Kokkos::Experimental::infinity::value; } \ - static FUNC_QUAL val_type nan() { return Kokkos::Experimental::quiet_NaN::value; } \ - static FUNC_QUAL mag_type epsilon() { return Kokkos::Experimental::epsilon::value; } \ - static FUNC_QUAL mag_type sfmin() { return Kokkos::Experimental::norm_min::value; } \ - static FUNC_QUAL int base() { return Kokkos::Experimental::radix::value; } \ - static FUNC_QUAL mag_type prec() { return epsilon() * static_cast(base()); } \ - static FUNC_QUAL int t() { return Kokkos::Experimental::digits::value; } \ - static FUNC_QUAL mag_type rnd() { return one(); } \ - static FUNC_QUAL int emin() { return Kokkos::Experimental::min_exponent::value; } \ - static FUNC_QUAL mag_type rmin() { return Kokkos::Experimental::norm_min::value; } \ - static FUNC_QUAL int emax() { return Kokkos::Experimental::max_exponent::value; } \ - static FUNC_QUAL mag_type rmax() { return Kokkos::Experimental::finite_max::value; } \ - \ - static FUNC_QUAL bool isInf(const val_type x) { return Kokkos::isinf(x); } \ - static FUNC_QUAL bool isNan(const val_type x) { return Kokkos::isnan(x); } \ - static FUNC_QUAL mag_type abs(const val_type x) { return Kokkos::abs(x); } \ - static FUNC_QUAL mag_type real(const val_type x) { return Kokkos::real(x); } \ - static FUNC_QUAL mag_type imag(const val_type x) { return Kokkos::imag(x); } \ - static FUNC_QUAL val_type conj(const val_type x) { return x; } \ - static FUNC_QUAL val_type pow(const val_type x, const val_type y) { return Kokkos::pow(x, y); } \ - static FUNC_QUAL val_type sqrt(const val_type x) { return Kokkos::sqrt(x); } \ - static FUNC_QUAL val_type cbrt(const val_type x) { return Kokkos::cbrt(x); } \ - static FUNC_QUAL val_type exp(const val_type x) { return Kokkos::exp(x); } \ - static FUNC_QUAL val_type log(const val_type x) { return Kokkos::log(x); } \ - static FUNC_QUAL val_type log10(const val_type x) { return Kokkos::log10(x); } \ - static FUNC_QUAL val_type sin(const val_type x) { return Kokkos::sin(x); } \ - static FUNC_QUAL val_type cos(const val_type x) { return Kokkos::cos(x); } \ - static FUNC_QUAL val_type tan(const val_type x) { return Kokkos::tan(x); } \ - static FUNC_QUAL val_type sinh(const val_type x) { return Kokkos::sinh(x); } \ - static FUNC_QUAL val_type cosh(const val_type x) { return Kokkos::cosh(x); } \ - static FUNC_QUAL val_type tanh(const val_type x) { return Kokkos::tanh(x); } \ - static FUNC_QUAL val_type asin(const val_type x) { return Kokkos::asin(x); } \ - static FUNC_QUAL val_type acos(const val_type x) { return Kokkos::acos(x); } \ - static FUNC_QUAL val_type atan(const val_type x) { return Kokkos::atan(x); } \ - \ - static FUNC_QUAL bool isnaninf(const val_type x) { return isNan(x) || isInf(x); } \ - static FUNC_QUAL magnitudeType magnitude(const val_type x) { return abs(x); } \ - static FUNC_QUAL val_type conjugate(const val_type x) { return conj(x); } \ - static FUNC_QUAL val_type squareroot(const val_type x) { return sqrt(x); } \ - static FUNC_QUAL mag_type eps() { return epsilon(); } - -// Macro to automate the wrapping of Kokkos Mathematical Functions -#define KOKKOSKERNELS_ARITHTRAITS_HALF_FP(FUNC_QUAL) \ - static FUNC_QUAL val_type zero() { return static_cast(0); } \ - static FUNC_QUAL val_type one() { return static_cast(1); } \ - static FUNC_QUAL val_type min() { return Kokkos::Experimental::finite_min::value; } \ - static FUNC_QUAL val_type max() { return Kokkos::Experimental::finite_max::value; } \ - static FUNC_QUAL val_type infinity() { return Kokkos::Experimental::infinity::value; } \ - static FUNC_QUAL val_type nan() { return Kokkos::Experimental::quiet_NaN::value; } \ - static FUNC_QUAL mag_type epsilon() { return Kokkos::Experimental::epsilon::value; } \ - static FUNC_QUAL mag_type sfmin() { return Kokkos::Experimental::norm_min::value; } \ - static FUNC_QUAL int base() { return Kokkos::Experimental::radix::value; } \ - static FUNC_QUAL mag_type prec() { return epsilon() * static_cast(base()); } \ - static FUNC_QUAL int t() { return Kokkos::Experimental::digits::value; } \ - static FUNC_QUAL mag_type rnd() { return one(); } \ - static FUNC_QUAL int emin() { return Kokkos::Experimental::min_exponent::value; } \ - static FUNC_QUAL mag_type rmin() { return Kokkos::Experimental::norm_min::value; } \ - static FUNC_QUAL int emax() { return Kokkos::Experimental::max_exponent::value; } \ - static FUNC_QUAL mag_type rmax() { return Kokkos::Experimental::finite_max::value; } \ - \ - static FUNC_QUAL bool isInf(const val_type x) { return Kokkos::isinf(x); } \ - static FUNC_QUAL mag_type abs(const val_type x) { return Kokkos::abs(x); } \ - static FUNC_QUAL mag_type real(const val_type x) { return Kokkos::real(x); } \ - static FUNC_QUAL mag_type imag(const val_type x) { return Kokkos::imag(x); } \ - static FUNC_QUAL val_type conj(const val_type x) { return x; } \ - static FUNC_QUAL val_type pow(const val_type x, const val_type y) { return Kokkos::pow(x, y); } \ - static FUNC_QUAL val_type sqrt(const val_type x) { return Kokkos::sqrt(x); } \ - static FUNC_QUAL val_type cbrt(const val_type x) { return Kokkos::cbrt(x); } \ - static FUNC_QUAL val_type exp(const val_type x) { return Kokkos::exp(x); } \ - static FUNC_QUAL val_type log(const val_type x) { return Kokkos::log(x); } \ - static FUNC_QUAL val_type log10(const val_type x) { return Kokkos::log10(x); } \ - static FUNC_QUAL val_type sin(const val_type x) { return Kokkos::sin(x); } \ - static FUNC_QUAL val_type cos(const val_type x) { return Kokkos::cos(x); } \ - static FUNC_QUAL val_type tan(const val_type x) { return Kokkos::tan(x); } \ - static FUNC_QUAL val_type sinh(const val_type x) { return Kokkos::sinh(x); } \ - static FUNC_QUAL val_type cosh(const val_type x) { return Kokkos::cosh(x); } \ - static FUNC_QUAL val_type tanh(const val_type x) { return Kokkos::tanh(x); } \ - static FUNC_QUAL val_type asin(const val_type x) { return Kokkos::asin(x); } \ - static FUNC_QUAL val_type acos(const val_type x) { return Kokkos::acos(x); } \ - static FUNC_QUAL val_type atan(const val_type x) { return Kokkos::atan(x); } \ - \ - static FUNC_QUAL magnitudeType magnitude(const val_type x) { return abs(x); } \ - static FUNC_QUAL val_type conjugate(const val_type x) { return conj(x); } \ - static FUNC_QUAL val_type squareroot(const val_type x) { return sqrt(x); } \ - static FUNC_QUAL mag_type eps() { return epsilon(); } - -#define KOKKOSKERNELS_ARITHTRAITS_CMPLX_FP(FUNC_QUAL) \ - \ - static constexpr bool is_specialized = true; \ - static constexpr bool is_signed = true; \ - static constexpr bool is_integer = false; \ - static constexpr bool is_exact = false; \ - static constexpr bool is_complex = true; \ - static constexpr bool has_infinity = true; \ - \ - using magnitudeType = mag_type; \ - using halfPrecision = ::Kokkos::complex::halfPrecision>; \ - using doublePrecision = ::Kokkos::complex::doublePrecision>; \ - \ - static constexpr bool isComplex = true; \ - static constexpr bool isOrdinal = false; \ - static constexpr bool isComparable = false; \ - static constexpr bool hasMachineParameters = ArithTraits::hasMachineParameters; \ - \ - static FUNC_QUAL val_type zero() { return val_type(ArithTraits::zero(), ArithTraits::zero()); } \ - static FUNC_QUAL val_type one() { return val_type(ArithTraits::one(), ArithTraits::zero()); } \ - static FUNC_QUAL val_type min() { return val_type(ArithTraits::min(), ArithTraits::min()); } \ - static FUNC_QUAL val_type max() { return val_type(ArithTraits::max(), ArithTraits::max()); } \ - static FUNC_QUAL val_type infinity() { \ - return val_type(ArithTraits::infinity(), ArithTraits::infinity()); \ - } \ - static FUNC_QUAL val_type nan() { return val_type(ArithTraits::nan(), ArithTraits::nan()); } \ - static FUNC_QUAL mag_type epsilon() { return ArithTraits::epsilon(); } \ - static FUNC_QUAL mag_type sfmin() { return ArithTraits::sfmin(); } \ - static FUNC_QUAL int base() { return ArithTraits::base(); } \ - static FUNC_QUAL mag_type prec() { return ArithTraits::prec(); } \ - static FUNC_QUAL int t() { return ArithTraits::t(); } \ - static FUNC_QUAL mag_type rnd() { return ArithTraits::rnd(); } \ - static FUNC_QUAL int emin() { return ArithTraits::emin(); } \ - static FUNC_QUAL mag_type rmin() { return ArithTraits::rmin(); } \ - static FUNC_QUAL int emax() { return ArithTraits::emax(); } \ - static FUNC_QUAL mag_type rmax() { return ArithTraits::rmax(); } \ - static FUNC_QUAL bool isInf(const val_type x) { \ - return ArithTraits::isInf(x.real()) || ArithTraits::isInf(x.imag()); \ - } \ - static FUNC_QUAL bool isNan(const val_type x) { \ - return ArithTraits::isNan(x.real()) || ArithTraits::isNan(x.imag()); \ - } \ - static FUNC_QUAL mag_type abs(const val_type x) { return ::Kokkos::abs(x); } \ - static FUNC_QUAL mag_type real(const val_type x) { return x.real(); } \ - static FUNC_QUAL mag_type imag(const val_type x) { return x.imag(); } \ - static FUNC_QUAL val_type conj(const val_type x) { return ::Kokkos::conj(x); } \ - static FUNC_QUAL val_type pow(const val_type x, const val_type y) { return Kokkos::pow(x, y); } \ - static FUNC_QUAL val_type pow(const val_type x, const mag_type y) { return Kokkos::pow(x, y); } \ - static FUNC_QUAL val_type pow(const mag_type x, const val_type y) { return Kokkos::pow(x, y); } \ - static FUNC_QUAL val_type sqrt(const val_type x) { return ::Kokkos::sqrt(x); } \ - static FUNC_QUAL val_type exp(const val_type x) { return Kokkos::exp(x); } \ - static FUNC_QUAL val_type log(const val_type x) { return Kokkos::log(x); } \ - static FUNC_QUAL val_type log10(const val_type x) { return Kokkos::log10(x); } \ - static FUNC_QUAL val_type sin(const val_type x) { return Kokkos::sin(x); } \ - static FUNC_QUAL val_type cos(const val_type x) { return Kokkos::cos(x); } \ - static FUNC_QUAL val_type tan(const val_type x) { return Kokkos::tan(x); } \ - static FUNC_QUAL val_type sinh(const val_type x) { return Kokkos::sinh(x); } \ - static FUNC_QUAL val_type cosh(const val_type x) { return Kokkos::cosh(x); } \ - static FUNC_QUAL val_type tanh(const val_type x) { return Kokkos::tanh(x); } \ - static FUNC_QUAL val_type asin(const val_type x) { return Kokkos::asin(x); } \ - static FUNC_QUAL val_type acos(const val_type x) { return Kokkos::acos(x); } \ - static FUNC_QUAL val_type atan(const val_type x) { return Kokkos::atan(x); } \ - static FUNC_QUAL bool isnaninf(const val_type& x) { return isNan(x) || isInf(x); } \ - static FUNC_QUAL mag_type magnitude(const val_type x) { return abs(x); } \ - static FUNC_QUAL val_type conjugate(const val_type x) { return conj(x); } \ - static FUNC_QUAL val_type squareroot(const val_type x) { return sqrt(x); } \ - static FUNC_QUAL mag_type eps() { return epsilon(); } - -template -static KOKKOS_FUNCTION typename std::enable_if::is_signed, val_type>::type -KokkosKernelsAbs(const val_type x) { - return Kokkos::abs(x); -} - -template -static KOKKOS_FUNCTION typename std::enable_if::is_signed, val_type>::type -KokkosKernelsAbs(const val_type x) { - return x; -} - -template -static KOKKOS_FUNCTION typename std::enable_if::is_signed, val_type>::type -KokkosKernelsNan() { - return -1; -} - -template -static KOKKOS_FUNCTION typename std::enable_if::is_signed, val_type>::type -KokkosKernelsNan() { - return Kokkos::Experimental::finite_max::value; -} - -#define KOKKOSKERNELS_ARITHTRAITS_INTEGRAL() \ - \ - static constexpr bool is_specialized = true; \ - static constexpr bool is_integer = true; \ - static constexpr bool is_exact = true; \ - static constexpr bool is_complex = false; \ - static constexpr bool has_infinity = false; \ - \ - using magnitudeType = mag_type; \ - using halfPrecision = val_type; \ - using doublePrecision = val_type; \ - \ - static constexpr bool isComplex = false; \ - static constexpr bool isOrdinal = true; \ - static constexpr bool isComparable = true; \ - static constexpr bool hasMachineParameters = false; \ - \ - static KOKKOS_FUNCTION val_type zero() { return static_cast(0); } \ - static KOKKOS_FUNCTION val_type one() { return static_cast(1); } \ - static KOKKOS_FUNCTION val_type min() { return Kokkos::Experimental::finite_min::value; } \ - static KOKKOS_FUNCTION val_type max() { return Kokkos::Experimental::finite_max::value; } \ - static KOKKOS_FUNCTION val_type infinity() { return static_cast(0); } \ - static KOKKOS_FUNCTION val_type nan() { return KokkosKernelsNan(); } \ - static KOKKOS_FUNCTION bool isInf(const val_type) { return false; } \ - static KOKKOS_FUNCTION bool isNan(const val_type) { return false; } \ - static KOKKOS_FUNCTION mag_type abs(const val_type x) { return KokkosKernelsAbs(x); } \ - static KOKKOS_FUNCTION mag_type real(const val_type x) { return Kokkos::real(x); } \ - static KOKKOS_FUNCTION mag_type imag(const val_type) { return zero(); } \ - static KOKKOS_FUNCTION val_type conj(const val_type x) { return x; } \ - static KOKKOS_FUNCTION val_type pow(const val_type x, const val_type y) { return Kokkos::pow(x, y); } \ - static KOKKOS_FUNCTION val_type sqrt(const val_type x) { return static_cast(Kokkos::sqrt(abs(x))); } \ - static KOKKOS_FUNCTION val_type cbrt(const val_type x) { return static_cast(Kokkos::cbrt(abs(x))); } \ - static KOKKOS_FUNCTION val_type exp(const val_type x) { return static_cast(Kokkos::exp(abs(x))); } \ - static KOKKOS_FUNCTION val_type log(const val_type x) { return static_cast(Kokkos::log(abs(x))); } \ - static KOKKOS_FUNCTION val_type log10(const val_type x) { return static_cast(Kokkos::log10(abs(x))); } \ - static KOKKOS_FUNCTION mag_type epsilon() { return zero(); } \ - static KOKKOS_FUNCTION magnitudeType magnitude(const val_type x) { return abs(x); } \ - static KOKKOS_FUNCTION val_type conjugate(const val_type x) { return conj(x); } \ - static KOKKOS_FUNCTION bool isnaninf(const val_type) { return false; } \ - static KOKKOS_FUNCTION val_type squareroot(const val_type x) { return sqrt(x); } - -/// \class ArithTraits -/// \brief Traits class for arithmetic on type T. -/// \tparam T "Scalar" type of interest -/// -/// This is a traits class for the "arithmetic" type T. "Arithmetic -/// types" include built-in signed and unsigned integer types, -/// floating-point types, complex-valued types, and anything else that -/// looks like these. This class is useful for implementing numerical -/// algorithms that are generic on the data type. You may also use -/// this class to query attributes of T, like whether it is signed or -/// complex, or its precision. -/// -/// We really did not want to implement this class or expose it to -/// users. It would be much better to use existing traits classes -/// like std::numeric_limits. We decided to implement and expose this -/// class for the following reasons: -///
    -///
  1. std::numeric_limits class methods cannot be used in CUDA -/// device functions, since they themselves are not device -/// functions
  2. -///
  3. Existing traits classes like std::numeric_limits do not -/// provide enough information to implement algorithms that are -/// agnostic of whether T is real-valued or complex-valued.
  4. -///
-/// -/// All class methods must be suitable for parallel kernels, if the -/// type T itself is suitable for parallel kernels. In particular, -/// specializations for types T that make sense to use on a CUDA -/// device must mark all class methods as device (and host) functions, -/// using the KOKKOS_FORCEINLINE_FUNCTION macro. All class methods must be -/// callable both inside and outside a parallel kernel (for CUDA, this -/// means they must be marked as both device and host functions). -/// -/// \section Kokkos_ArithTraits_compat Compatibility -/// -/// Whenever possible, class methods in ArithTraits use the same names -/// as their equivalents in the C++ Standard Library. If this was not -/// possible, for example with isInf and isNan, we explain why in -/// their documentation. -/// -/// This class has redundant typedefs and methods in order to maintain -/// backwards compatibility with Teuchos::ScalarTraits, while -/// preferring forwards (partial) compatibility with -/// std::numeric_limits. Users should prefer typedefs, \c bool -/// constants, and class methods compatible with std::numeric_limits, -/// to those from Teuchos::ScalarTraits. The latter may go away at -/// any time. Furthermore, Teuchos::ScalarTraits contains methods -/// that do not make sense for use as parallel device functions, in -/// particular those relating to pseudorandom number generation that -/// refer to hidden state, so we will never include all class methods -/// from Teuchos::ScalarTraits in ArithTraits. -/// -/// \section Kokkos_ArithTraits_unsupp Unsupported types on CUDA devices -/// -/// CUDA does not support long double or std::complex in device -/// functions. ArithTraits does have specializations for these types, -/// but the class methods therein are not marked as device functions. -/// -/// \section Kokkos_ArithTraits_whyNotC99 What about C99 integer types? -/// -/// C99 and C++11 include typedefs int${N}_t and uint${N}_t, where N -/// is the number of bits in the integer. These typedefs are useful -/// because they make the length of the type explicit. Users are -/// welcome to use these types as the template parameter of -/// ArithTraits. -/// -/// We chose not to use these types when defining full -/// specializations of ArithTraits. This is because the C99 integer -/// types are typedefs, not types in themselves. This makes it -/// impossible to avoid duplicate or missing full specializations of -/// ArithTraits. For example, on my Mac, for CUDA 5.5, gcc 4.2.1, and -/// Clang 3.2, int64_t is a typedef of long long, -/// but long long and long are separate types, even -/// though they have the same length (64 bits). In contrast, on -/// Windows (even Win64), long is a 32-bit type (but a -/// distinct type from int), and long long is a -/// 64-bit type. Thus, if we define full specializations of -/// ArithTraits using only the C99 integer types, we will be -/// missing a specialization for long on at least one -/// platform. -/// -/// Rather than trouble ourselves with trying to figure this out for -/// each platform, we decided to provide specializations only for the -/// integer types in the C89 and C++03 language standards. This -/// includes signed and unsigned versions of char, -/// short, int, and long. We also include -/// long long if your platform supports it. We may thus have -/// left out some C99 integer type, but this is only possible if the -/// C89 / C++03 integer types do not have complete coverage of all -/// powers of two bits from 8 up to the longest provided length (e.g., -/// 64 on a 64-bit system). On all platforms I have encountered, -/// char has 8 bits and short has 16 bits, so I am -/// not worried about missing specializations for int16_t or -/// uint16_t. If you should find that either of these -/// specializations are missing, though, please let us know. -/// -/// Note that char, signed char, and unsigned -/// char are distinct types, whether char is signed or -/// unsigned. (The language standards do not specify whether -/// char is signed or unsigned.) That is, char is -/// not a typedef of signed char or unsigned -/// char. This is why we provide full specializations of -/// ArithTraits for each of these types. Interestingly enough, on my -/// system, char and int8_t are different types, but -/// signed char and int8_t are the same. -/// -/// \section Kokkos_ArithTraits_impl Implementation notes -/// -/// This section contains notes to developers who which to add a -/// partial specialization of this class for a new type T. If you -/// decide to write a default templated implementation, it must not -/// declare any methods as device functions. This ensures correct -/// behavior for arbitrary T, but does require specializations for -/// common types like T = float and double, as well as for other types -/// T that make sense to use on a CUDA device. -template -class ArithTraits { - public: - /// \brief A type that acts like T and works with Kokkos. - /// - /// This is usually just an alias for T. However, some types T do - /// not work well with Kokkos. In that case, we use a mostly - /// equivalent type here. For example, ArithTraits - /// >::val_type is Kokkos::complex. - using val_type = T; - /// \brief The type of the magnitude (absolute value) of T. - /// - /// We define this as the type returned by abs() in this class. If - /// T is real (not complex), then \c val_type and \c mag_type are - /// usually the same. If T is std::complex for some R, - /// then R and \c mag_type are usually the same. - using mag_type = T; - - //! Whether ArithTraits has a specialization for T. - static constexpr bool is_specialized = false; - //! Whether T is a signed type (has negative values). - static constexpr bool is_signed = false; - //! Whether T is an integer type. - static constexpr bool is_integer = false; - /// \brief Whether T "uses exact representations." - /// - /// The opposite of is_exact is "is approximate," that is, "may - /// commit rounding error." - static constexpr bool is_exact = false; - //! Whether T is a complex-valued type. - static constexpr bool is_complex = false; - - /// \brief Whether x is Inf. - /// - /// This can only be true for floating-point types T that support - /// Inf. If T is a complex type, we say that a T instance x is Inf - /// if and only if isinf(real(x)) || isinf(imag(x)). - /// - /// Unfortunately we can't call this "isinf" (the equivalent C99 - /// function), because CUDA appears to implement that function using - /// a macro, rather than using a function (as C++11 requires). - static KOKKOS_FUNCTION bool isInf(const T& x); - - /// \brief Whether x is NaN (not a number). - /// - /// This can only be true for floating-point types T that support - /// NaN. If T is a complex type, we say that a T instance x is NaN - /// if and only if isNan(real(x)) || isNan(imag(x)). - /// - /// Unfortunately we can't call this "isnan" (the equivalent C99 - /// function), because CUDA appears to implement that function using - /// a macro, rather than using a function (as C++11 requires). - static KOKKOS_FUNCTION bool isNan(const T& x); - - //! The absolute value (magnitude) of x. - static KOKKOS_FUNCTION mag_type abs(const T& x); - - //! The zero value of T; the arithmetic identity. - static KOKKOS_FUNCTION T zero(); - - //! The one value of T; the multiplicative identity. - static KOKKOS_FUNCTION T one(); - - /// \brief True if this type T is capable of representing the - /// positive infinity as a distinct special value, as with - /// std::numeric_limits::has_infinity. - static constexpr bool has_infinity = false; - - /// \brief Returns the special value "positive infinity", as - /// represented by the floating-point type T. Only meaningful if - /// KokkosArithTraits::has_infinity == true. Provides same - /// functionality as std::numeric_limits::infinity(). - /// - /// \note Would have liked to mark it as constexpr but then would - /// not be able to provide the specialization for std::complex - /// since its constructor only becomes constexpr with C++14. - static KOKKOS_FUNCTION T infinity(); - - /// \brief The minimum possible value of T. - /// - /// If T is a real floating-point type, then this is the minimum - /// positive value, as with std::numeric_limits::min(). - static KOKKOS_FUNCTION T min(); - - //! The maximum possible value of T. - static KOKKOS_FUNCTION T max(); - - /// \brief The real part of x. - /// - /// If \c is_complex is false, then this just returns x. - static KOKKOS_FUNCTION mag_type real(const T& x); - - /// \brief The imaginary part of x. - /// - /// If \c is_complex is false, then this just returns zero(). - static KOKKOS_FUNCTION mag_type imag(const T&); - - /// \brief The complex conjugate of x. - /// - /// If \c is_complex is false, then this just returns x. - static KOKKOS_FUNCTION T conj(const T&); - - //! x raised to the power y. - static KOKKOS_FUNCTION T pow(const T& x, const T& y); - - /// \brief The square root of x. - /// - /// If T is an integer type, this is the floor of the square root. - /// If T is a complex-valued type, then this method returns the - /// principal branch of the square root. - /// - /// If T is real-valued and x is negative, the result of the square - /// root is undefined in general. (CUDA does not allow throwing - /// exceptions in device functions.) Implementations should return - /// NaN if the type T supports this. Of course, in that case, the - /// square of the result will not equal x. - static KOKKOS_FUNCTION T sqrt(const T& x); - - /// \brief The cubic root of x. - /// - /// If T is an integer type, this is the floor of the cubic root. - /// If T is a complex-valued type, then this method returns the - /// principal branch of the cubic root. - /// - /// If T is real-valued and x is negative, the result of the cubic - /// root is undefined in general. (CUDA does not allow throwing - /// exceptions in device functions.) Implementations should return - /// NaN if the type T supports this. Of course, in that case, the - /// cubic of the result will not equal x. - static KOKKOS_FUNCTION T cbrt(const T& x); - - /// \brief The natural (base e) exponential function of x. - /// - /// If T is an integer type, this is the floor of the exponential - /// function. If T is a complex-valued type, then this method - /// returns \f$e^{x+iy} = e^x ( cos(y) + i sin(y) )\f$. - /// - static KOKKOS_FUNCTION T exp(const T& x); - - /// \brief The natural (base e) logarithm of x. - /// - /// If T is an integer type, this is the floor of the logarithm. If - /// T is a complex-valued type, then this method returns the - /// principal branch of the logarithm. - /// - /// If T is real-valued and x is negative, the result of the - /// logarithm is undefined in general. (CUDA does not allow - /// throwing exceptions in device functions.) Implementations - /// should return NaN if the type T supports this. Of course, in - /// that case, if y is the result, \f$e^y\f$ will not equal x. - static KOKKOS_FUNCTION T log(const T& x); - - /// \brief The base ten logarithm of the input. - /// - /// If T is an integer type, this is the floor of the logarithm. If - /// T is a complex-valued type, then this method returns the - /// principal branch of the logarithm. - /// - /// If T is real-valued and x is negative, the result of the - /// logarithm is undefined in general. (CUDA does not allow - /// throwing exceptions in device functions.) Implementations - /// should return NaN if the type T supports this. Of course, in - /// that case, if y is the result, \f$10^y\f$ will not equal x. - static KOKKOS_FUNCTION T log10(const T& x); - - /// Trigonometric and hyperbolic functions are not available - /// for integer types. This is because asin(sin(x)) is not x - /// when x is integer with a rounding error. - /// - /// KJ: log, exp also has this problem. We probably need to - /// disable them for integer types instead of providing - /// functionality with floor. - - /// \brief The sin function of x - /// - static KOKKOS_FUNCTION T sin(const T& x); - - /// \brief The cos function of x - /// - static KOKKOS_FUNCTION T cos(const T& x); - - /// \brief The tan function of x - /// - static KOKKOS_FUNCTION T tan(const T& x); - - /// \brief The sin hyperbolic function of x - /// - static KOKKOS_FUNCTION T sinh(const T& x); - - /// \brief The cos hyperbolic function of x - /// - static KOKKOS_FUNCTION T cosh(const T& x); - - /// \brief The tan hyperbolic function of x - /// - static KOKKOS_FUNCTION T tanh(const T& x); - - /// \brief The asin function of x - /// - static KOKKOS_FUNCTION T asin(const T& x); - - /// \brief The acos function of x - /// - static KOKKOS_FUNCTION T acos(const T& x); - - /// \brief The atan function of x - /// - static KOKKOS_FUNCTION T atan(const T& x); - - /// \brief Return a silent NaN, if appropriate for T. - /// - /// If T does not implement a silent NaN, the return value is - /// undefined, but calling this method is still allowed. - static KOKKOS_FUNCTION T nan(); - - /// \brief Machine epsilon. - /// - /// If T is an integer type (std::numeric_traits::is_exact is - /// true), then epsilon() returns 0. Otherwise, if T is a - /// floating-point type, it returns machine epsilon that T. - static KOKKOS_FUNCTION mag_type epsilon(); - - //@{ - /// \name Traits defined for backwards compatibility with - /// Teuchos::ScalarTraits - /// - /// All of the typedefs, \c bool constants, and class methods in - /// this section are defined in order that one may replace most uses - /// of Teuchos::ScalarTraits with ArithTraits. Users who do not - /// have this backwards compatibility requirement should prefer - /// equivalents in other sections. Those class methods which have - /// the same name and meaning in both Teuchos::ScalarTraits and this - /// class, such as log() and pow(), are not in this section. - - //! Same as mag_type; the type of the absolute value (magnitude) of T. - using magnitudeType = T; - - /// \brief The type with "half the precision" of T. - /// - /// This typedef only makes sense if T is a floating-point type. - using halfPrecision = T; - - /// \brief The type with "twice the the precision" of T. - /// - /// This typedef only makes sense if T is a floating-point type. - using doublePrecision = T; - - static constexpr bool isComplex = false; - static constexpr bool isOrdinal = false; - static constexpr bool isComparable = false; - - /// \brief True if this type T has floating-point parameters. - /// - /// This is true if and only if this specialization of ArithTraits - /// has "machine-specific" parameters eps(), sfmin(), base(), - /// prec(), t(), rnd(), emin(), rmin(), emax(), and rmax(), relating - /// to floating-point types. - static constexpr bool hasMachineParameters = false; - - //! Return relative machine precision. - static KOKKOS_FUNCTION mag_type eps(); - - //! Return safe minimum (sfmin), such that 1/sfmin does not overflow. - static KOKKOS_FUNCTION mag_type sfmin(); - - //! Return the base of the scalar type T. - static KOKKOS_FUNCTION int base(); - - //! Return eps*base. - static KOKKOS_FUNCTION mag_type prec(); - - //! Returns the number of (base) digits in the significand. - static KOKKOS_FUNCTION int t(); - - //! 1.0 when rounding occurs in addition, else 0.0. - static KOKKOS_FUNCTION mag_type rnd(); - - //! Returns the minimum exponent before (gradual) underflow. - static KOKKOS_FUNCTION int emin(); - - //! Returns the underflow threshold: base^(emin-1) - static KOKKOS_FUNCTION mag_type rmin(); - - //! Returns the largest exponent before overflow. - static KOKKOS_FUNCTION int emax(); - - //! Overflow theshold: (base^emax)*(1-eps) - static KOKKOS_FUNCTION mag_type rmax(); - - //! Same as abs(); return the magnitude of x. - static KOKKOS_FUNCTION magnitudeType magnitude(const T& x); - - //! Same as conj(); return the complex conjugate of x. - static KOKKOS_FUNCTION T conjugate(const T& x); - - /// \brief Whether x is (silent) NaN or Inf. - /// - /// This is the same as isNan(x) || isInf(x). - static KOKKOS_FUNCTION bool isnaninf(const T& x); - - /// \brief The string name of T. - /// - /// Note that this is not a device function. - static std::string name(); - - //! Same as sqrt(x); the square root of x. - static KOKKOS_FUNCTION T squareroot(const T& x); - //@} -}; - -#if defined(KOKKOS_HALF_T_IS_FLOAT) && !KOKKOS_HALF_T_IS_FLOAT -template <> -class ArithTraits { - public: - using val_type = Kokkos::Experimental::half_t; - using mag_type = val_type; - - static constexpr bool is_specialized = true; - static constexpr bool is_signed = true; - static constexpr bool is_integer = false; - static constexpr bool is_exact = false; - static constexpr bool is_complex = false; - static constexpr bool has_infinity = true; - - // Backwards compatibility with Teuchos::ScalarTraits. - using magnitudeType = mag_type; - using halfPrecision = Kokkos::Experimental::half_t; - using doublePrecision = float; - - static std::string name() { return "half_t"; } - - static constexpr bool isComplex = false; - static constexpr bool isOrdinal = false; - static constexpr bool isComparable = true; - static constexpr bool hasMachineParameters = true; - -#if defined(KOKKOS_ENABLE_SYCL) || defined(KOKKOS_ENABLE_HIP) - KOKKOSKERNELS_ARITHTRAITS_HALF_FP(KOKKOS_FUNCTION) -#else - KOKKOSKERNELS_ARITHTRAITS_REAL_FP(KOKKOS_FUNCTION) -#endif -}; -#endif // #if defined(KOKKOS_HALF_T_IS_FLOAT) && !KOKKOS_HALF_T_IS_FLOAT - -// Since Kokkos::Experimental::bhalf_t falls back to float, only define -// ArithTraits if bhalf_t is a backend specialization -#if defined(KOKKOS_BHALF_T_IS_FLOAT) && !KOKKOS_BHALF_T_IS_FLOAT -template <> -class ArithTraits { - public: - using val_type = Kokkos::Experimental::bhalf_t; - using mag_type = val_type; - - static constexpr bool is_specialized = true; - static constexpr bool is_signed = true; - static constexpr bool is_integer = false; - static constexpr bool is_exact = false; - static constexpr bool is_complex = false; - static constexpr bool has_infinity = true; - - // Backwards compatibility with Teuchos::ScalarTraits. - using magnitudeType = mag_type; - using bhalfPrecision = Kokkos::Experimental::bhalf_t; - // There is no type that has twice the precision as bhalf_t. - // The closest type would be float. - using doublePrecision = void; - - static constexpr bool isComplex = false; - static constexpr bool isOrdinal = false; - static constexpr bool isComparable = true; - static constexpr bool hasMachineParameters = true; - - static std::string name() { return "bhalf_t"; } - -#if defined(KOKKOS_ENABLE_SYCL) || defined(KOKKOS_ENABLE_HIP) - KOKKOSKERNELS_ARITHTRAITS_HALF_FP(KOKKOS_FUNCTION) -#else - KOKKOSKERNELS_ARITHTRAITS_REAL_FP(KOKKOS_FUNCTION) -#endif -}; -#endif // #if defined(KOKKOS_BHALF_T_IS_FLOAT) && !KOKKOS_BHALF_T_IS_FLOAT - -template <> -class ArithTraits { - public: - using val_type = float; - using mag_type = val_type; - - static constexpr bool is_specialized = true; - static constexpr bool is_signed = true; - static constexpr bool is_integer = false; - static constexpr bool is_exact = false; - static constexpr bool is_complex = false; - static constexpr bool has_infinity = true; - - // Backwards compatibility with Teuchos::ScalarTraits. - using magnitudeType = mag_type; - using halfPrecision = float; // Should we switch to Kokkos::half_t - using doublePrecision = double; - - static constexpr bool isComplex = false; - static constexpr bool isOrdinal = false; - static constexpr bool isComparable = true; - static constexpr bool hasMachineParameters = true; - - static std::string name() { return "float"; } - - KOKKOSKERNELS_ARITHTRAITS_REAL_FP(KOKKOS_FUNCTION) -}; - -template <> -class ArithTraits { - public: - using val_type = double; - using mag_type = val_type; - - static constexpr bool is_specialized = true; - static constexpr bool is_signed = true; - static constexpr bool is_integer = false; - static constexpr bool is_exact = false; - static constexpr bool is_complex = false; - static constexpr bool has_infinity = true; - - // Backwards compatibility with Teuchos::ScalarTraits. - using magnitudeType = mag_type; - using halfPrecision = float; -#if defined(__CUDA_ARCH__) - using doublePrecision = double; // CUDA doesn't support long double, unfortunately -#elif defined(__HIP_DEVICE_COMPILE__) - using doublePrecision = double; // HIP does not support long double unfortunately -#else - using doublePrecision = long double; -#endif // __CUDA_ARCH__ - static constexpr bool isComplex = false; - static constexpr bool isOrdinal = false; - static constexpr bool isComparable = true; - static constexpr bool hasMachineParameters = true; - - static std::string name() { return "double"; } - - KOKKOSKERNELS_ARITHTRAITS_REAL_FP(KOKKOS_FUNCTION) -}; - -// CUDA and HIP do not support long double in device functions, -// so none of the class methods in this specialization are marked -// as device functions. -template <> -class ArithTraits { - public: - using val_type = long double; - using mag_type = long double; - - static constexpr bool is_specialized = true; - static constexpr bool is_signed = true; - static constexpr bool is_integer = false; - static constexpr bool is_exact = false; - static constexpr bool is_complex = false; - static constexpr bool has_infinity = true; - - // Backwards compatibility with Teuchos::ScalarTraits. - using magnitudeType = mag_type; - using halfPrecision = double; - // It might be appropriate to use QD's qd_real here. - // For now, long double is the most you get. - using doublePrecision = val_type; - - static constexpr bool isComplex = false; - static constexpr bool isOrdinal = false; - static constexpr bool isComparable = true; - static constexpr bool hasMachineParameters = true; - - static std::string name() { return "long double"; } - - KOKKOSKERNELS_ARITHTRAITS_REAL_FP() -}; // long double specialization - -#if defined(KOKKOS_ENABLE_LIBQUADMATH) -// CUDA does not support __float128 in device functions, so none of -// the class methods in this specialization are marked as device -// functions. -template <> -class ArithTraits<__float128> { - public: - using val_type = __float128; - using mag_type = val_type; - - static constexpr bool is_specialized = true; - static constexpr bool is_signed = true; - static constexpr bool is_integer = false; - static constexpr bool is_exact = false; - static constexpr bool is_complex = false; - static constexpr bool has_infinity = true; - - // Backwards compatibility with Teuchos::ScalarTraits. - using magnitudeType = mag_type; - using halfPrecision = double; - // Unfortunately, we can't rely on a standard __float256 type. - using doublePrecision = __float128; - - static constexpr bool isComplex = false; - static constexpr bool isOrdinal = false; - static constexpr bool isComparable = true; - static constexpr bool hasMachineParameters = true; - - static std::string name() { return "__float128"; } - - KOKKOSKERNELS_ARITHTRAITS_REAL_FP() -}; // __float128 specialization -#endif // KOKKOS_ENABLE_LIBQUADMATH - -template <> -class ArithTraits<::Kokkos::complex> { - public: - using val_type = ::Kokkos::complex; - using mag_type = float; - - static std::string name() { return "Kokkos::complex"; } - - KOKKOSKERNELS_ARITHTRAITS_CMPLX_FP(KOKKOS_FUNCTION) -}; - -template <> -class ArithTraits<::Kokkos::complex> { - public: - using val_type = ::Kokkos::complex; - using mag_type = double; - - static std::string name() { return "Kokkos::complex"; } - - KOKKOSKERNELS_ARITHTRAITS_CMPLX_FP(KOKKOS_FUNCTION) -}; - -/// \brief Partial specialization for std::complex. -/// -/// The C++ Standard Library (with C++03 at least) only allows -/// std::complex for RealFloatType = float, double, or -/// long double. -template -class ArithTraits> { - public: - //! Kokkos internally replaces std::complex with Kokkos::complex. - using val_type = ::Kokkos::complex; - using mag_type = RealFloatType; - - static constexpr bool is_specialized = true; - static constexpr bool is_signed = true; - static constexpr bool is_integer = false; - static constexpr bool is_exact = false; - static constexpr bool is_complex = true; - - static constexpr bool has_infinity = true; - static std::complex infinity() { - return std::complex(ArithTraits::infinity(), ArithTraits::infinity()); - } - -#ifdef KOKKOS_ENABLE_SYCL - template - static bool isInf(const std::complex& x) { - if constexpr (std::is_same_v) { - Kokkos::abort("isInf not available for std::complex!\n"); - return true; - } else { - KOKKOS_IF_ON_HOST((using std::isinf;)) - KOKKOS_IF_ON_DEVICE((using sycl::isinf;)) - return isinf(std::real(x)) || isinf(std::imag(x)); - } - } -#else - static bool isInf(const std::complex& x) { - return std::isinf(std::real(x)) || std::isinf(std::imag(x)); - } -#endif - -#ifdef KOKKOS_ENABLE_SYCL - template - static bool isNan(const std::complex& x) { - if constexpr (std::is_same_v) { - Kokkos::abort("isNan not available for std::complex!\n"); - return true; - } else { - KOKKOS_IF_ON_HOST((using std::isnan;)) - KOKKOS_IF_ON_DEVICE((using sycl::isnan;)) - return isnan(std::real(x)) || isnan(std::imag(x)); - } - } -#else - static bool isNan(const std::complex& x) { - return std::isnan(std::real(x)) || std::isnan(std::imag(x)); - } -#endif - static mag_type abs(const std::complex& x) { return std::abs(x); } - static std::complex zero() { - return std::complex(ArithTraits::zero(), ArithTraits::zero()); - } - static std::complex one() { - return std::complex(ArithTraits::one(), ArithTraits::zero()); - } - static std::complex min() { - return std::complex(ArithTraits::min(), ArithTraits::zero()); - } - static std::complex max() { - return std::complex(ArithTraits::max(), ArithTraits::zero()); - } - static mag_type real(const std::complex& x) { return std::real(x); } - static mag_type imag(const std::complex& x) { return std::imag(x); } - static std::complex conj(const std::complex& x) { return std::conj(x); } - static std::complex pow(const std::complex& x, const std::complex& y) { - // Fix for some weird gcc 4.2.1 inaccuracy. - if (y == one()) { - return x; - } else if (y == one() + one()) { - return x * x; - } else { - return std::pow(x, y); - } - } - static std::complex pow(const std::complex& x, const RealFloatType& y) { - // Fix for some weird gcc 4.2.1 inaccuracy. - if (y == ArithTraits::one()) { - return x; - } else if (y == ArithTraits::one() + ArithTraits::one()) { - return x * x; - } else { - return std::pow(x, y); - } - } - static std::complex sqrt(const std::complex& x) { return std::sqrt(x); } - static std::complex cbrt(const std::complex& x) { -#ifdef KOKKOS_ENABLE_SYCL - KOKKOS_IF_ON_DEVICE((return sycl::cbrt(x);)) - KOKKOS_IF_ON_HOST((return ::cbrt(x);)) -#else - return ::cbrt(x); -#endif - } - static std::complex exp(const std::complex& x) { return std::exp(x); } - static std::complex log(const std::complex& x) { return std::log(x); } - static std::complex log10(const std::complex& x) { return std::log10(x); } - static std::complex sin(const std::complex& x) { return std::sin(x); } - static std::complex cos(const std::complex& x) { return std::cos(x); } - static std::complex tan(const std::complex& x) { -#ifdef KOKKOS_ENABLE_SYCL - KOKKOS_IF_ON_DEVICE((return sycl::tan(x);)) - KOKKOS_IF_ON_HOST((return std::tan(x);)) -#else - return std::tan(x); -#endif - } - static std::complex sinh(const std::complex& x) { return std::sinh(x); } - static std::complex cosh(const std::complex& x) { return std::cosh(x); } - static std::complex tanh(const std::complex& x) { return std::tanh(x); } - static std::complex asin(const std::complex& x) { -#ifdef KOKKOS_ENABLE_SYCL - KOKKOS_IF_ON_DEVICE((return sycl::asin(x);)) - KOKKOS_IF_ON_HOST((return ::asin(x);)) -#else - return ::asin(x); -#endif - } - static std::complex acos(const std::complex& x) { -#ifdef KOKKOS_ENABLE_SYCL - KOKKOS_IF_ON_DEVICE((return sycl::acos(x);)) - KOKKOS_IF_ON_HOST((return ::acos(x);)) -#else - return ::acos(x); -#endif - } - static std::complex atan(const std::complex& x) { -#ifdef KOKKOS_ENABLE_SYCL - KOKKOS_IF_ON_DEVICE((using sycl::atan;)) - KOKKOS_IF_ON_HOST((using ::atan;)) -#else - using std::atan; -#endif - return atan(x); - } - static std::complex nan() { - const mag_type mag_nan = ArithTraits::nan(); - return std::complex(mag_nan, mag_nan); - } - static mag_type epsilon() { return ArithTraits::epsilon(); } - - // Backwards compatibility with Teuchos::ScalarTraits. - using magnitudeType = mag_type; - using halfPrecision = std::complex::halfPrecision>; - using doublePrecision = std::complex::doublePrecision>; - - static constexpr bool isComplex = true; - static constexpr bool isOrdinal = false; - static constexpr bool isComparable = false; - static constexpr bool hasMachineParameters = true; - static bool isnaninf(const std::complex& x) { return isNan(x) || isInf(x); } - static mag_type magnitude(const std::complex& x) { return abs(x); } - static std::complex conjugate(const std::complex& x) { return conj(x); } - static std::string name() { return std::string("std::complex<") + ArithTraits::name() + ">"; } - static std::complex squareroot(const std::complex& x) { return sqrt(x); } - static mag_type eps() { return epsilon(); } - static mag_type sfmin() { return ArithTraits::sfmin(); } - static int base() { return ArithTraits::base(); } - static mag_type prec() { return ArithTraits::prec(); } - static int t() { return ArithTraits::t(); } - static mag_type rnd() { return ArithTraits::one(); } - static int emin() { return ArithTraits::emin(); } - static mag_type rmin() { return ArithTraits::rmin(); } - static int emax() { return ArithTraits::emax(); } - static mag_type rmax() { return ArithTraits::rmax(); } -}; - -template <> -class ArithTraits { - public: - using val_type = char; - using mag_type = val_type; - - // The C(++) standard does not require that char be signed. In - // fact, signed char, unsigned char, and char are distinct types. - // We can use std::numeric_limits here because it's a const bool, - // not a class method. - static constexpr bool is_signed = std::numeric_limits::is_signed; - - static std::string name() { return "char"; } - - KOKKOSKERNELS_ARITHTRAITS_INTEGRAL() -}; - -template <> -class ArithTraits { - public: - using val_type = signed char; - using mag_type = val_type; - - static constexpr bool is_signed = true; - - static std::string name() { return "signed char"; } - - KOKKOSKERNELS_ARITHTRAITS_INTEGRAL() -}; - -template <> -class ArithTraits { - public: - using val_type = unsigned char; - using mag_type = val_type; - - static constexpr bool is_signed = false; - - static std::string name() { return "unsigned char"; } - - KOKKOSKERNELS_ARITHTRAITS_INTEGRAL() -}; - -template <> -class ArithTraits { - public: - using val_type = short; - using mag_type = val_type; - - static constexpr bool is_signed = true; - - static std::string name() { return "short"; } - - KOKKOSKERNELS_ARITHTRAITS_INTEGRAL() -}; - -template <> -class ArithTraits { - public: - using val_type = unsigned short; - using mag_type = val_type; - - static constexpr bool is_signed = false; - - static std::string name() { return "unsigned short"; } - - KOKKOSKERNELS_ARITHTRAITS_INTEGRAL() -}; - -template <> -class ArithTraits { - public: - using val_type = int; - using mag_type = val_type; - - static constexpr bool is_signed = true; - - static std::string name() { return "int"; } - - KOKKOSKERNELS_ARITHTRAITS_INTEGRAL() -}; - -template <> -class ArithTraits { - public: - using val_type = unsigned int; - using mag_type = val_type; - - static constexpr bool is_signed = false; - - static std::string name() { return "unsigned int"; } - - KOKKOSKERNELS_ARITHTRAITS_INTEGRAL() -}; - -template <> -class ArithTraits { - public: - using val_type = long; - using mag_type = val_type; - - static constexpr bool is_signed = true; - - static std::string name() { return "long"; } - - KOKKOSKERNELS_ARITHTRAITS_INTEGRAL() -}; - -template <> -class ArithTraits { - public: - using val_type = unsigned long; - using mag_type = val_type; - - static constexpr bool is_signed = false; - - static std::string name() { return "unsigned long"; } - - KOKKOSKERNELS_ARITHTRAITS_INTEGRAL() -}; - -template <> -class ArithTraits { - public: - using val_type = long long; - using mag_type = val_type; - - static constexpr bool is_signed = true; - - static std::string name() { return "long long"; } - - KOKKOSKERNELS_ARITHTRAITS_INTEGRAL() -}; - -template <> -class ArithTraits { - public: - using val_type = unsigned long long; - using mag_type = val_type; - - static constexpr bool is_signed = false; - - static std::string name() { return "unsigned long long"; } - - KOKKOSKERNELS_ARITHTRAITS_INTEGRAL() -}; - -// dd_real and qd_real are floating-point types provided by the QD -// library of David Bailey (LBNL): -// -// http://crd-legacy.lbl.gov/~dhbailey/mpdist/ -// -// dd_real uses two doubles (128 bits), and qd_real uses four doubles -// (256 bits). -// -// Kokkos does not currently support these types in device -// functions. It should be possible to use Kokkos' support for -// aggregate types to implement device function support for dd_real -// and qd_real, but we have not done this yet (as of 09 Jan 2015). -// Hence, the class methods of the ArithTraits specializations for -// dd_real and qd_real are not marked as device functions. -#ifdef HAVE_KOKKOS_QD -// LBV: I would like to deprecate this strange optional -// dependency on the lbnl package, is there anyone actully -// using this? It certainly is never tested by CI or nightly -// so probably does not work... -template <> -struct [[deprecated]] ArithTraits { - typedef dd_real val_type; - typedef dd_real mag_type; - - static const bool is_specialized = true; - static const bool is_signed = true; - static const bool is_integer = false; - static const bool is_exact = false; - static const bool is_complex = false; - - static inline bool isInf(const val_type& x) { return isinf(x); } - static inline bool isNan(const val_type& x) { return isnan(x); } - static inline mag_type abs(const val_type& x) { return ::abs(x); } - static inline val_type zero() { return val_type(0.0); } - static inline val_type one() { return val_type(1.0); } - static inline val_type min() { return std::numeric_limits::min(); } - static inline val_type max() { return std::numeric_limits::max(); } - static inline mag_type real(const val_type& x) { return x; } - static inline mag_type imag(const val_type&) { return zero(); } - static inline val_type conj(const val_type& x) { return x; } - static inline val_type pow(const val_type& x, const val_type& y) { return ::pow(x, y); } - static inline val_type sqrt(const val_type& x) { -#ifdef KOKKOS_ENABLE_SYCL - KOKKOS_IF_ON_DEVICE((return sycl::sqrt(x);)) - KOKKOS_IF_ON_HOST((return ::sqrt(x);)) -#else - return ::sqrt(x); -#endif - } - static inline val_type cbrt(const val_type& x) { -#ifdef KOKKOS_ENABLE_SYCL - KOKKOS_IF_ON_DEVICE((return sycl::cbrt(x);)) - KOKKOS_IF_ON_HOST((return ::cbrt(x);)) -#else - return ::cbrt(x); -#endif - } - static inline val_type exp(const val_type& x) { return ::exp(x); } - static inline val_type log(const val_type& x) { - // dd_real puts its transcendental functions in the global namespace. - return ::log(x); - } - static inline val_type log10(const val_type& x) { return ::log10(x); } - static KOKKOS_FUNCTION val_type sin(const val_type x) { return ::sin(x); } - static KOKKOS_FUNCTION val_type cos(const val_type x) { return ::cos(x); } - static KOKKOS_FUNCTION val_type tan(const val_type x) { -#ifdef KOKKOS_ENABLE_SYCL - KOKKOS_IF_ON_DEVICE((return sycl::tan(x);)) - KOKKOS_IF_ON_HOST((return std::tan(x);)) -#else - return std::tan(x); -#endif - } - static KOKKOS_FUNCTION val_type sinh(const val_type x) { return ::sinh(x); } - static KOKKOS_FUNCTION val_type cosh(const val_type x) { return ::cosh(x); } - static KOKKOS_FUNCTION val_type tanh(const val_type x) { return ::tanh(x); } - static KOKKOS_FUNCTION val_type asin(const val_type x) { -#ifdef KOKKOS_ENABLE_SYCL - KOKKOS_IF_ON_DEVICE((return sycl::asin(x);)) - KOKKOS_IF_ON_HOST((return ::asin(x);)) -#else - return ::asin(x); -#endif - } - static KOKKOS_FUNCTION val_type acos(const val_type x) { -#ifdef KOKKOS_ENABLE_SYCL - KOKKOS_IF_ON_DEVICE((return sycl::acos(x);)) - KOKKOS_IF_ON_HOST((return ::acos(x);)) -#else - return ::acos(x); -#endif - } - static KOKKOS_FUNCTION val_type atan(const val_type x) { -#ifdef KOKKOS_ENABLE_SYCL - KOKKOS_IF_ON_DEVICE((return sycl::atan(x);)) - KOKKOS_IF_ON_HOST((return ::atan(x);)) -#else - return ::atan(x); -#endif - } - static inline val_type nan() { return val_type::_nan; } - static val_type epsilon() { return std::numeric_limits::epsilon(); } - - typedef dd_real magnitudeType; - typedef double halfPrecision; - typedef qd_real doublePrecision; - - static const bool isComplex = false; - static const bool isOrdinal = false; - static const bool isComparable = true; - static const bool hasMachineParameters = true; - - static mag_type eps() { return epsilon(); } - static mag_type sfmin() { return min(); } - static int base() { return std::numeric_limits::radix; } - static mag_type prec() { return eps() * base(); } - static int t() { return std::numeric_limits::digits; } - static mag_type rnd() { return std::numeric_limits::round_style == std::round_to_nearest ? one() : zero(); } - static int emin() { return std::numeric_limits::min_exponent; } - static mag_type rmin() { return std::numeric_limits::min(); } - static int emax() { return std::numeric_limits::max_exponent; } - static mag_type rmax() { return std::numeric_limits::max(); } - static mag_type magnitude(const val_type& x) { return ::abs(x); } - static val_type conjugate(const val_type& x) { return conj(x); } - static bool isnaninf(const val_type& x) { return isNan(x) || isInf(x); } - static std::string name() { return "dd_real"; } - static val_type squareroot(const val_type& x) { -#ifdef KOKKOS_ENABLE_SYCL - KOKKOS_IF_ON_DEVICE((return sycl::sqrt(x);)) - KOKKOS_IF_ON_HOST((return ::sqrt(x);)) -#else - return ::sqrt(x); -#endif - } -}; - -template <> -struct [[deprecated]] ArithTraits { - typedef qd_real val_type; - typedef qd_real mag_type; - - static const bool is_specialized = true; - static const bool is_signed = true; - static const bool is_integer = false; - static const bool is_exact = false; - static const bool is_complex = false; - - static inline bool isInf(const val_type& x) { return isinf(x); } - static inline bool isNan(const val_type& x) { return isnan(x); } - static inline mag_type abs(const val_type& x) { return ::abs(x); } - static inline val_type zero() { return val_type(0.0); } - static inline val_type one() { return val_type(1.0); } - static inline val_type min() { return std::numeric_limits::min(); } - static inline val_type max() { return std::numeric_limits::max(); } - static inline mag_type real(const val_type& x) { return x; } - static inline mag_type imag(const val_type&) { return zero(); } - static inline val_type conj(const val_type& x) { return x; } - static inline val_type pow(const val_type& x, const val_type& y) { return ::pow(x, y); } - static inline val_type sqrt(const val_type& x) { -#ifdef KOKKOS_ENABLE_SYCL - KOKKOS_IF_ON_DEVICE((return sycl::sqrt(x);)) - KOKKOS_IF_ON_HOST((return ::sqrt(x);)) -#else - return ::sqrt(x); -#endif - } - static inline val_type cbrt(const val_type& x) { -#ifdef KOKKOS_ENABLE_SYCL - KOKKOS_IF_ON_DEVICE((return sycl::cbrt(x);)) - KOKKOS_IF_ON_HOST((return ::cbrt(x);)) -#else - return ::cbrt(x); -#endif - } - static inline val_type exp(const val_type& x) { return ::exp(x); } - static inline val_type log(const val_type& x) { - // val_type puts its transcendental functions in the global namespace. - return ::log(x); - } - static inline val_type log10(const val_type& x) { return ::log10(x); } - static KOKKOS_FUNCTION val_type sin(const val_type x) { return ::sin(x); } - static KOKKOS_FUNCTION val_type cos(const val_type x) { return ::cos(x); } - static KOKKOS_FUNCTION val_type tan(const val_type x) { -#ifdef KOKKOS_ENABLE_SYCL - KOKKOS_IF_ON_DEVICE((return sycl::tan(x);)) - KOKKOS_IF_ON_HOST((return ::tan(x);)) -#else - return std::tan(x); -#endif - } - static KOKKOS_FUNCTION val_type sinh(const val_type x) { return ::sinh(x); } - static KOKKOS_FUNCTION val_type cosh(const val_type x) { return ::cosh(x); } - static KOKKOS_FUNCTION val_type tanh(const val_type x) { return ::tanh(x); } - static KOKKOS_FUNCTION val_type asin(const val_type x) { -#ifdef KOKKOS_ENABLE_SYCL - KOKKOS_IF_ON_DEVICE((return sycl::asin(x);)) - KOKKOS_IF_ON_HOST((return ::asin(x);)) -#else - return ::asin(x); -#endif - } - static KOKKOS_FUNCTION val_type acos(const val_type x) { -#ifdef KOKKOS_ENABLE_SYCL - KOKKOS_IF_ON_DEVICE((return sycl::acos(x);)) - KOKKOS_IF_ON_HOST((return ::acos(x);)) -#else - return ::acos(x); -#endif - } - static KOKKOS_FUNCTION val_type atan(const val_type x) { -#ifdef KOKKOS_ENABLE_SYCL - KOKKOS_IF_ON_DEVICE((return sycl::atan(x);)) - KOKKOS_IF_ON_HOST((return ::atan(x);)) -#else - return ::atan(x); -#endif - } - static inline val_type nan() { return val_type::_nan; } - static inline val_type epsilon() { return std::numeric_limits::epsilon(); } - - typedef qd_real magnitudeType; - typedef dd_real halfPrecision; - // The QD library does not have an "oct-double real" class. One - // could use an arbitrary-precision library like MPFR or ARPREC, - // with the precision set appropriately, to get an - // extended-precision type for qd_real. - typedef qd_real doublePrecision; - - static const bool isComplex = false; - static const bool isOrdinal = false; - static const bool isComparable = true; - static const bool hasMachineParameters = true; - - static mag_type eps() { return epsilon(); } - static mag_type sfmin() { return min(); } - static int base() { return std::numeric_limits::radix; } - static mag_type prec() { return eps() * base(); } - static int t() { return std::numeric_limits::digits; } - static mag_type rnd() { return std::numeric_limits::round_style == std::round_to_nearest ? one() : zero(); } - static int emin() { return std::numeric_limits::min_exponent; } - static mag_type rmin() { return std::numeric_limits::min(); } - static int emax() { return std::numeric_limits::max_exponent; } - static mag_type rmax() { return std::numeric_limits::max(); } - static mag_type magnitude(const val_type& x) { return ::abs(x); } - static val_type conjugate(const val_type& x) { return conj(x); } - static bool isnaninf(const val_type& x) { return isNan(x) || isInf(x); } - static std::string name() { return "qd_real"; } - static val_type squareroot(const val_type& x) { -#ifdef KOKKOS_ENABLE_SYCL - KOKKOS_IF_ON_DEVICE((return sycl::sqrt(x);)) - KOKKOS_IF_ON_HOST((return ::sqrt(x);)) -#else - return ::sqrt(x); -#endif - } -}; -#endif // HAVE_KOKKOS_QD - -} // namespace KokkosKernels +#include namespace Kokkos { template -using ArithTraits [[deprecated("Use KokkosKernels::ArithTraits instead")]] = ::KokkosKernels::ArithTraits; +using ArithTraits [[deprecated("Use KokkosKernels::ArithTraits from KokkosKernels_ArithTraits.hpp header instead")]] = ::KokkosKernels::ArithTraits; namespace Details { template -using ArithTraits [[deprecated("Use KokkosKernels::ArithTraits instead")]] = ::KokkosKernels::ArithTraits; +using ArithTraits [[deprecated("Use KokkosKernels::ArithTraits from KokkosKernels_ArithTraits.hpp header instead")]] = ::KokkosKernels::ArithTraits; } // namespace Details } // namespace Kokkos From 782b2297622253dc30168e79c13e78ca0267a780 Mon Sep 17 00:00:00 2001 From: Luc Berger-Vergiat Date: Tue, 30 Sep 2025 09:55:21 -0600 Subject: [PATCH 6/7] Updating header inclusion to use new KokkosKernels_ArithTraits.hpp Signed-off-by: Luc Berger-Vergiat --- benchmarks/sparse/KokkosSparse_spmv_bsr_benchmark.cpp | 2 +- blas/impl/KokkosBlas1_abs_impl.hpp | 2 +- blas/impl/KokkosBlas1_abs_spec.hpp | 2 +- blas/impl/KokkosBlas1_dot_spec.hpp | 2 +- blas/impl/KokkosBlas1_iamax_spec.hpp | 2 +- blas/impl/KokkosBlas1_mult_impl.hpp | 2 +- blas/impl/KokkosBlas1_nrm1_spec.hpp | 2 +- blas/impl/KokkosBlas1_nrm2_spec.hpp | 2 +- blas/impl/KokkosBlas1_nrm2w_spec.hpp | 2 +- blas/impl/KokkosBlas1_nrminf_spec.hpp | 2 +- blas/impl/KokkosBlas1_reciprocal_impl.hpp | 2 +- blas/impl/KokkosBlas1_reciprocal_spec.hpp | 2 +- blas/impl/KokkosBlas1_rot_spec.hpp | 2 +- blas/impl/KokkosBlas1_rotg_spec.hpp | 2 +- blas/impl/KokkosBlas1_rotm_impl.hpp | 2 +- blas/impl/KokkosBlas1_rotmg_impl.hpp | 2 +- blas/impl/KokkosBlas1_scal_spec.hpp | 2 +- blas/impl/KokkosBlas1_sum_spec.hpp | 2 +- blas/impl/KokkosBlas1_team_abs_spec.hpp | 2 +- blas/impl/KokkosBlas1_team_axpby_spec.hpp | 2 +- blas/impl/KokkosBlas1_team_dot_spec.hpp | 2 +- blas/impl/KokkosBlas1_team_mult_spec.hpp | 2 +- blas/impl/KokkosBlas1_team_nrm2_spec.hpp | 2 +- blas/impl/KokkosBlas1_team_scal_spec.hpp | 2 +- blas/impl/KokkosBlas1_team_update_spec.hpp | 2 +- blas/impl/KokkosBlas2_gemv_impl.hpp | 2 +- blas/impl/KokkosBlas2_ger_impl.hpp | 2 +- blas/impl/KokkosBlas2_syr2_impl.hpp | 2 +- blas/impl/KokkosBlas2_syr_impl.hpp | 2 +- blas/impl/KokkosBlas2_team_gemv_spec.hpp | 2 +- blas/impl/KokkosBlas3_trmm_impl.hpp | 2 +- blas/impl/KokkosBlas3_trsm_impl.hpp | 2 +- blas/impl/KokkosBlas_util.hpp | 2 +- blas/tpls/KokkosBlas_Host_tpl.hpp | 2 +- blas/unit_test/Test_Blas1_dot.hpp | 2 +- common/impl/KokkosKernels_NaN.hpp | 2 +- common/impl/KokkosKernels_SafeCompare.hpp | 2 +- common/src/KokkosKernels_IOUtils.hpp | 2 +- common/src/KokkosKernels_Predicates.hpp | 2 +- common/src/KokkosKernels_SimpleUtils.hpp | 2 +- common/src/KokkosKernels_Utils.hpp | 2 +- common/src/Kokkos_ArithTraits.hpp | 2 +- common/src/Kokkos_InnerProductSpaceTraits.hpp | 2 +- common/unit_test/Test_Common_ArithTraits.hpp | 2 +- common/unit_test/Test_Common_Sorting.hpp | 2 +- common/unit_test/Test_Common_float128.hpp | 2 +- example/batched_solve/static_pivoting.cpp | 2 +- example/batched_solve/team_GMRES.cpp | 2 +- lapack/impl/KokkosLapack_gesv_impl.hpp | 2 +- lapack/impl/KokkosLapack_gesv_spec.hpp | 2 +- lapack/impl/KokkosLapack_svd_impl.hpp | 2 +- lapack/impl/KokkosLapack_svd_spec.hpp | 2 +- lapack/tpls/KokkosLapack_Host_tpl.hpp | 2 +- lapack/tpls/KokkosLapack_svd_tpl_spec_decl.hpp | 2 +- .../batched/dense/KokkosBatched_Test_BlockJacobi_Tutorial.cpp | 2 +- .../batched/dense/KokkosBatched_Test_BlockTridiagDirect.cpp | 2 +- .../batched/dense/KokkosBatched_Test_BlockTridiagJacobi.cpp | 2 +- perf_test/batched/sparse/CG/KokkosBatched_Test_CG.cpp | 2 +- perf_test/batched/sparse/GMRES/KokkosBatched_Test_GMRES.cpp | 2 +- perf_test/batched/sparse/SPMV/KokkosBatched_Test_SPMV.cpp | 2 +- .../batched/sparse/cusolver/KokkosBatched_Test_cusolverDn.cpp | 2 +- .../batched/sparse/cusolver/KokkosBatched_Test_cusolverSp.cpp | 2 +- perf_test/blas/blas3/KokkosBlas3_gemm_perf_test.hpp | 2 +- sparse/impl/KokkosSparse_bspgemm_numeric_spec.hpp | 2 +- sparse/impl/KokkosSparse_gauss_seidel_spec.hpp | 2 +- sparse/impl/KokkosSparse_getDiagCopyWithOffsets_impl.hpp | 2 +- sparse/impl/KokkosSparse_gmres_impl.hpp | 2 +- sparse/impl/KokkosSparse_gmres_spec.hpp | 2 +- sparse/impl/KokkosSparse_mdf_impl.hpp | 2 +- sparse/impl/KokkosSparse_par_ilut_numeric_impl.hpp | 2 +- sparse/impl/KokkosSparse_par_ilut_numeric_spec.hpp | 2 +- sparse/impl/KokkosSparse_par_ilut_symbolic_impl.hpp | 2 +- sparse/impl/KokkosSparse_par_ilut_symbolic_spec.hpp | 2 +- sparse/impl/KokkosSparse_sor_sequential_impl.hpp | 2 +- sparse/impl/KokkosSparse_spadd_numeric_impl.hpp | 2 +- sparse/impl/KokkosSparse_spadd_symbolic_impl.hpp | 2 +- sparse/impl/KokkosSparse_spgemm_numeric_spec.hpp | 2 +- sparse/impl/KokkosSparse_spgemm_symbolic_spec.hpp | 2 +- sparse/impl/KokkosSparse_spiluk_numeric_impl.hpp | 2 +- sparse/impl/KokkosSparse_spiluk_numeric_spec.hpp | 2 +- sparse/impl/KokkosSparse_spiluk_symbolic_impl.hpp | 2 +- sparse/impl/KokkosSparse_spiluk_symbolic_spec.hpp | 2 +- sparse/impl/KokkosSparse_spmv_bsrmatrix_spec.hpp | 2 +- sparse/impl/KokkosSparse_spmv_spec.hpp | 2 +- sparse/impl/KokkosSparse_spmv_struct_spec.hpp | 2 +- sparse/impl/KokkosSparse_spmv_team_impl.hpp | 2 +- sparse/impl/KokkosSparse_spmv_team_spec.hpp | 2 +- sparse/impl/KokkosSparse_sptrsv_solve_impl.hpp | 2 +- sparse/impl/KokkosSparse_sptrsv_solve_spec.hpp | 2 +- sparse/impl/KokkosSparse_sptrsv_symbolic_impl.hpp | 2 +- sparse/impl/KokkosSparse_sptrsv_symbolic_spec.hpp | 2 +- sparse/impl/KokkosSparse_trsv_impl.hpp | 2 +- sparse/impl/KokkosSparse_trsv_spec.hpp | 2 +- sparse/src/KokkosSparse_BsrMatrix.hpp | 2 +- sparse/src/KokkosSparse_Preconditioner.hpp | 2 +- sparse/unit_test/Test_Sparse_CrsMatrix.hpp | 2 +- sparse/unit_test/Test_Sparse_SortCrs.hpp | 2 +- sparse/unit_test/Test_Sparse_removeCrsMatrixZeros.hpp | 2 +- sparse/unit_test/Test_Sparse_replaceSumInto.hpp | 2 +- sparse/unit_test/Test_Sparse_replaceSumIntoLonger.hpp | 2 +- sparse/unit_test/Test_Sparse_spadd.hpp | 2 +- test_common/KokkosKernels_TestMatrixUtils.hpp | 2 +- test_common/KokkosKernels_TestUtils.hpp | 2 +- test_common/KokkosKernels_TestVanilla.hpp | 2 +- 104 files changed, 104 insertions(+), 104 deletions(-) diff --git a/benchmarks/sparse/KokkosSparse_spmv_bsr_benchmark.cpp b/benchmarks/sparse/KokkosSparse_spmv_bsr_benchmark.cpp index 1be1e1bed7..07c551bbbe 100644 --- a/benchmarks/sparse/KokkosSparse_spmv_bsr_benchmark.cpp +++ b/benchmarks/sparse/KokkosSparse_spmv_bsr_benchmark.cpp @@ -43,7 +43,7 @@ namespace fs = std::filesystem; #include -#include +#include #include "Benchmark_Utils.hpp" #include "KokkosSparse_CrsMatrix.hpp" diff --git a/blas/impl/KokkosBlas1_abs_impl.hpp b/blas/impl/KokkosBlas1_abs_impl.hpp index 5091e709ca..c835c7e852 100644 --- a/blas/impl/KokkosBlas1_abs_impl.hpp +++ b/blas/impl/KokkosBlas1_abs_impl.hpp @@ -18,7 +18,7 @@ #include #include -#include +#include namespace KokkosBlas { namespace Impl { diff --git a/blas/impl/KokkosBlas1_abs_spec.hpp b/blas/impl/KokkosBlas1_abs_spec.hpp index a00daf0683..2bd95d87a1 100644 --- a/blas/impl/KokkosBlas1_abs_spec.hpp +++ b/blas/impl/KokkosBlas1_abs_spec.hpp @@ -18,7 +18,7 @@ #include #include -#include +#include // Include the actual functors #if !defined(KOKKOSKERNELS_ETI_ONLY) || KOKKOSKERNELS_IMPL_COMPILE_LIBRARY diff --git a/blas/impl/KokkosBlas1_dot_spec.hpp b/blas/impl/KokkosBlas1_dot_spec.hpp index 05a936ee22..9369739837 100644 --- a/blas/impl/KokkosBlas1_dot_spec.hpp +++ b/blas/impl/KokkosBlas1_dot_spec.hpp @@ -18,7 +18,7 @@ #include #include -#include +#include #include // Include the actual functors diff --git a/blas/impl/KokkosBlas1_iamax_spec.hpp b/blas/impl/KokkosBlas1_iamax_spec.hpp index 28978c034e..2c82286ef8 100644 --- a/blas/impl/KokkosBlas1_iamax_spec.hpp +++ b/blas/impl/KokkosBlas1_iamax_spec.hpp @@ -18,7 +18,7 @@ #include #include -#include +#include #include // Include the actual functors diff --git a/blas/impl/KokkosBlas1_mult_impl.hpp b/blas/impl/KokkosBlas1_mult_impl.hpp index 4b2c882984..66a60c3015 100644 --- a/blas/impl/KokkosBlas1_mult_impl.hpp +++ b/blas/impl/KokkosBlas1_mult_impl.hpp @@ -18,7 +18,7 @@ #include #include -#include +#include namespace KokkosBlas { namespace Impl { diff --git a/blas/impl/KokkosBlas1_nrm1_spec.hpp b/blas/impl/KokkosBlas1_nrm1_spec.hpp index 0ca30ab549..73970d5761 100644 --- a/blas/impl/KokkosBlas1_nrm1_spec.hpp +++ b/blas/impl/KokkosBlas1_nrm1_spec.hpp @@ -18,7 +18,7 @@ #include #include -#include +#include #include // Include the actual functors diff --git a/blas/impl/KokkosBlas1_nrm2_spec.hpp b/blas/impl/KokkosBlas1_nrm2_spec.hpp index 07cc2336c6..694fb8ed72 100644 --- a/blas/impl/KokkosBlas1_nrm2_spec.hpp +++ b/blas/impl/KokkosBlas1_nrm2_spec.hpp @@ -18,7 +18,7 @@ #include #include -#include +#include #include // Include the actual functors diff --git a/blas/impl/KokkosBlas1_nrm2w_spec.hpp b/blas/impl/KokkosBlas1_nrm2w_spec.hpp index 99f82c535b..dbddb5a30a 100644 --- a/blas/impl/KokkosBlas1_nrm2w_spec.hpp +++ b/blas/impl/KokkosBlas1_nrm2w_spec.hpp @@ -18,7 +18,7 @@ #include #include -#include +#include // Include the actual functors #if !defined(KOKKOSKERNELS_ETI_ONLY) || KOKKOSKERNELS_IMPL_COMPILE_LIBRARY diff --git a/blas/impl/KokkosBlas1_nrminf_spec.hpp b/blas/impl/KokkosBlas1_nrminf_spec.hpp index eee326830b..02a6a17c38 100644 --- a/blas/impl/KokkosBlas1_nrminf_spec.hpp +++ b/blas/impl/KokkosBlas1_nrminf_spec.hpp @@ -18,7 +18,7 @@ #include #include -#include +#include #include // Include the actual functors diff --git a/blas/impl/KokkosBlas1_reciprocal_impl.hpp b/blas/impl/KokkosBlas1_reciprocal_impl.hpp index 81bf222236..c76951609f 100644 --- a/blas/impl/KokkosBlas1_reciprocal_impl.hpp +++ b/blas/impl/KokkosBlas1_reciprocal_impl.hpp @@ -18,7 +18,7 @@ #include #include -#include +#include namespace KokkosBlas { namespace Impl { diff --git a/blas/impl/KokkosBlas1_reciprocal_spec.hpp b/blas/impl/KokkosBlas1_reciprocal_spec.hpp index efd6f5a9fe..16e1124098 100644 --- a/blas/impl/KokkosBlas1_reciprocal_spec.hpp +++ b/blas/impl/KokkosBlas1_reciprocal_spec.hpp @@ -18,7 +18,7 @@ #include #include -#include +#include // Include the actual functors #if !defined(KOKKOSKERNELS_ETI_ONLY) || KOKKOSKERNELS_IMPL_COMPILE_LIBRARY diff --git a/blas/impl/KokkosBlas1_rot_spec.hpp b/blas/impl/KokkosBlas1_rot_spec.hpp index 410b88d951..d63ba4eb36 100644 --- a/blas/impl/KokkosBlas1_rot_spec.hpp +++ b/blas/impl/KokkosBlas1_rot_spec.hpp @@ -19,7 +19,7 @@ #include #include -#include +#include // Include the actual functors #if !defined(KOKKOSKERNELS_ETI_ONLY) || KOKKOSKERNELS_IMPL_COMPILE_LIBRARY diff --git a/blas/impl/KokkosBlas1_rotg_spec.hpp b/blas/impl/KokkosBlas1_rotg_spec.hpp index d5beff830e..b563f72c05 100644 --- a/blas/impl/KokkosBlas1_rotg_spec.hpp +++ b/blas/impl/KokkosBlas1_rotg_spec.hpp @@ -18,7 +18,7 @@ #include #include -#include +#include // Include the actual functors #if !defined(KOKKOSKERNELS_ETI_ONLY) || KOKKOSKERNELS_IMPL_COMPILE_LIBRARY diff --git a/blas/impl/KokkosBlas1_rotm_impl.hpp b/blas/impl/KokkosBlas1_rotm_impl.hpp index d410dbc267..de4f71e7c1 100644 --- a/blas/impl/KokkosBlas1_rotm_impl.hpp +++ b/blas/impl/KokkosBlas1_rotm_impl.hpp @@ -18,7 +18,7 @@ #include #include -#include +#include #include namespace KokkosBlas { diff --git a/blas/impl/KokkosBlas1_rotmg_impl.hpp b/blas/impl/KokkosBlas1_rotmg_impl.hpp index 1d0fb72a1d..e835e002cc 100644 --- a/blas/impl/KokkosBlas1_rotmg_impl.hpp +++ b/blas/impl/KokkosBlas1_rotmg_impl.hpp @@ -18,7 +18,7 @@ #include #include -#include +#include #include namespace KokkosBlas { diff --git a/blas/impl/KokkosBlas1_scal_spec.hpp b/blas/impl/KokkosBlas1_scal_spec.hpp index 44ba103cc5..dfc8daf5be 100644 --- a/blas/impl/KokkosBlas1_scal_spec.hpp +++ b/blas/impl/KokkosBlas1_scal_spec.hpp @@ -18,7 +18,7 @@ #include #include -#include +#include // Include the actual functors #if !defined(KOKKOSKERNELS_ETI_ONLY) || KOKKOSKERNELS_IMPL_COMPILE_LIBRARY diff --git a/blas/impl/KokkosBlas1_sum_spec.hpp b/blas/impl/KokkosBlas1_sum_spec.hpp index 9634b91a2d..8fd2043991 100644 --- a/blas/impl/KokkosBlas1_sum_spec.hpp +++ b/blas/impl/KokkosBlas1_sum_spec.hpp @@ -18,7 +18,7 @@ #include #include -#include +#include #include // Include the actual functors diff --git a/blas/impl/KokkosBlas1_team_abs_spec.hpp b/blas/impl/KokkosBlas1_team_abs_spec.hpp index 28a0c4bcc4..46cfd3caa4 100644 --- a/blas/impl/KokkosBlas1_team_abs_spec.hpp +++ b/blas/impl/KokkosBlas1_team_abs_spec.hpp @@ -19,7 +19,7 @@ #include #include -#include +#include #include namespace KokkosBlas { diff --git a/blas/impl/KokkosBlas1_team_axpby_spec.hpp b/blas/impl/KokkosBlas1_team_axpby_spec.hpp index 4cd42ae37d..86637fa585 100644 --- a/blas/impl/KokkosBlas1_team_axpby_spec.hpp +++ b/blas/impl/KokkosBlas1_team_axpby_spec.hpp @@ -19,7 +19,7 @@ #include #include -#include +#include #include namespace KokkosBlas { diff --git a/blas/impl/KokkosBlas1_team_dot_spec.hpp b/blas/impl/KokkosBlas1_team_dot_spec.hpp index 0d423f7d10..47be1c5c8f 100644 --- a/blas/impl/KokkosBlas1_team_dot_spec.hpp +++ b/blas/impl/KokkosBlas1_team_dot_spec.hpp @@ -19,7 +19,7 @@ #include #include -#include +#include #include namespace KokkosBlas { diff --git a/blas/impl/KokkosBlas1_team_mult_spec.hpp b/blas/impl/KokkosBlas1_team_mult_spec.hpp index 6138257582..648b983189 100644 --- a/blas/impl/KokkosBlas1_team_mult_spec.hpp +++ b/blas/impl/KokkosBlas1_team_mult_spec.hpp @@ -19,7 +19,7 @@ #include #include -#include +#include #include namespace KokkosBlas { diff --git a/blas/impl/KokkosBlas1_team_nrm2_spec.hpp b/blas/impl/KokkosBlas1_team_nrm2_spec.hpp index 7a3f127da7..f4dd6e74a5 100644 --- a/blas/impl/KokkosBlas1_team_nrm2_spec.hpp +++ b/blas/impl/KokkosBlas1_team_nrm2_spec.hpp @@ -19,7 +19,7 @@ #include #include -#include +#include #include namespace KokkosBlas { diff --git a/blas/impl/KokkosBlas1_team_scal_spec.hpp b/blas/impl/KokkosBlas1_team_scal_spec.hpp index 3782fb4081..394a81c6e5 100644 --- a/blas/impl/KokkosBlas1_team_scal_spec.hpp +++ b/blas/impl/KokkosBlas1_team_scal_spec.hpp @@ -19,7 +19,7 @@ #include #include -#include +#include #include namespace KokkosBlas { diff --git a/blas/impl/KokkosBlas1_team_update_spec.hpp b/blas/impl/KokkosBlas1_team_update_spec.hpp index 2fbf071d98..573d581365 100644 --- a/blas/impl/KokkosBlas1_team_update_spec.hpp +++ b/blas/impl/KokkosBlas1_team_update_spec.hpp @@ -19,7 +19,7 @@ #include #include -#include +#include #include namespace KokkosBlas { diff --git a/blas/impl/KokkosBlas2_gemv_impl.hpp b/blas/impl/KokkosBlas2_gemv_impl.hpp index 566110285c..ca8450e847 100644 --- a/blas/impl/KokkosBlas2_gemv_impl.hpp +++ b/blas/impl/KokkosBlas2_gemv_impl.hpp @@ -19,7 +19,7 @@ #include "KokkosKernels_config.h" #include "Kokkos_Core.hpp" #include "KokkosKernels_ExecSpaceUtils.hpp" -#include "Kokkos_ArithTraits.hpp" +#include "KokkosKernels_ArithTraits.hpp" namespace KokkosBlas { namespace Impl { diff --git a/blas/impl/KokkosBlas2_ger_impl.hpp b/blas/impl/KokkosBlas2_ger_impl.hpp index d320ddbdb5..82aea2f75f 100644 --- a/blas/impl/KokkosBlas2_ger_impl.hpp +++ b/blas/impl/KokkosBlas2_ger_impl.hpp @@ -20,7 +20,7 @@ #include "KokkosKernels_config.h" #include "Kokkos_Core.hpp" #include "KokkosKernels_ExecSpaceUtils.hpp" -#include "Kokkos_ArithTraits.hpp" +#include "KokkosKernels_ArithTraits.hpp" namespace KokkosBlas { namespace Impl { diff --git a/blas/impl/KokkosBlas2_syr2_impl.hpp b/blas/impl/KokkosBlas2_syr2_impl.hpp index 5d056d2a73..b7dd156891 100644 --- a/blas/impl/KokkosBlas2_syr2_impl.hpp +++ b/blas/impl/KokkosBlas2_syr2_impl.hpp @@ -20,7 +20,7 @@ #include "KokkosKernels_config.h" #include "Kokkos_Core.hpp" #include "KokkosKernels_ExecSpaceUtils.hpp" -#include "Kokkos_ArithTraits.hpp" +#include "KokkosKernels_ArithTraits.hpp" namespace KokkosBlas { namespace Impl { diff --git a/blas/impl/KokkosBlas2_syr_impl.hpp b/blas/impl/KokkosBlas2_syr_impl.hpp index 96e451a45f..45bf7c6b36 100644 --- a/blas/impl/KokkosBlas2_syr_impl.hpp +++ b/blas/impl/KokkosBlas2_syr_impl.hpp @@ -20,7 +20,7 @@ #include "KokkosKernels_config.h" #include "Kokkos_Core.hpp" #include "KokkosKernels_ExecSpaceUtils.hpp" -#include "Kokkos_ArithTraits.hpp" +#include "KokkosKernels_ArithTraits.hpp" namespace KokkosBlas { namespace Impl { diff --git a/blas/impl/KokkosBlas2_team_gemv_spec.hpp b/blas/impl/KokkosBlas2_team_gemv_spec.hpp index 168b5086f8..f4844aef7b 100644 --- a/blas/impl/KokkosBlas2_team_gemv_spec.hpp +++ b/blas/impl/KokkosBlas2_team_gemv_spec.hpp @@ -19,7 +19,7 @@ #include #include -#include +#include #include #include diff --git a/blas/impl/KokkosBlas3_trmm_impl.hpp b/blas/impl/KokkosBlas3_trmm_impl.hpp index a0d5a03c36..b1cca0345a 100644 --- a/blas/impl/KokkosBlas3_trmm_impl.hpp +++ b/blas/impl/KokkosBlas3_trmm_impl.hpp @@ -24,7 +24,7 @@ #include "KokkosKernels_config.h" #include "Kokkos_Core.hpp" -#include "Kokkos_ArithTraits.hpp" +#include "KokkosKernels_ArithTraits.hpp" #include "KokkosBatched_Trmm_Decl.hpp" #include "KokkosBatched_Trmm_Serial_Impl.hpp" diff --git a/blas/impl/KokkosBlas3_trsm_impl.hpp b/blas/impl/KokkosBlas3_trsm_impl.hpp index c328eb52f9..a52e0daa5f 100644 --- a/blas/impl/KokkosBlas3_trsm_impl.hpp +++ b/blas/impl/KokkosBlas3_trsm_impl.hpp @@ -25,7 +25,7 @@ #include "KokkosKernels_config.h" #include "Kokkos_Core.hpp" -#include "Kokkos_ArithTraits.hpp" +#include "KokkosKernels_ArithTraits.hpp" #include "KokkosBlas1_set_impl.hpp" #include "KokkosBatched_Trsm_Decl.hpp" #include "KokkosBatched_Trsm_Serial_Impl.hpp" diff --git a/blas/impl/KokkosBlas_util.hpp b/blas/impl/KokkosBlas_util.hpp index fac2bac999..0dd35c28cf 100644 --- a/blas/impl/KokkosBlas_util.hpp +++ b/blas/impl/KokkosBlas_util.hpp @@ -17,7 +17,7 @@ #ifndef KOKKOSBLAS_UTIL_HPP #define KOKKOSBLAS_UTIL_HPP -#include "Kokkos_ArithTraits.hpp" +#include "KokkosKernels_ArithTraits.hpp" namespace KokkosBlas { namespace Impl { diff --git a/blas/tpls/KokkosBlas_Host_tpl.hpp b/blas/tpls/KokkosBlas_Host_tpl.hpp index c1fde4aa9f..0d1049a126 100644 --- a/blas/tpls/KokkosBlas_Host_tpl.hpp +++ b/blas/tpls/KokkosBlas_Host_tpl.hpp @@ -22,7 +22,7 @@ /// \author Kyungjoo Kim (kyukim@sandia.gov) #include "KokkosKernels_config.h" -#include "Kokkos_ArithTraits.hpp" +#include "KokkosKernels_ArithTraits.hpp" #if defined(KOKKOSKERNELS_ENABLE_TPL_BLAS) #if defined(KOKKOSKERNELS_ENABLE_TPL_MKL) diff --git a/blas/unit_test/Test_Blas1_dot.hpp b/blas/unit_test/Test_Blas1_dot.hpp index 1f43fe7971..a7303e2018 100644 --- a/blas/unit_test/Test_Blas1_dot.hpp +++ b/blas/unit_test/Test_Blas1_dot.hpp @@ -16,7 +16,7 @@ #include #include #include -#include +#include #include #include diff --git a/common/impl/KokkosKernels_NaN.hpp b/common/impl/KokkosKernels_NaN.hpp index 03bf41e4b3..0416597d79 100644 --- a/common/impl/KokkosKernels_NaN.hpp +++ b/common/impl/KokkosKernels_NaN.hpp @@ -17,7 +17,7 @@ #ifndef KOKKOSKERNELS_NAN_HPP #define KOKKOSKERNELS_NAN_HPP -#include +#include #include namespace KokkosKernels::Impl { diff --git a/common/impl/KokkosKernels_SafeCompare.hpp b/common/impl/KokkosKernels_SafeCompare.hpp index dcf3b2d15c..f2f95a4446 100644 --- a/common/impl/KokkosKernels_SafeCompare.hpp +++ b/common/impl/KokkosKernels_SafeCompare.hpp @@ -17,7 +17,7 @@ #ifndef KOKKOSKERNELS_SAFECOMPARE_HPP #define KOKKOSKERNELS_SAFECOMPARE_HPP -#include "Kokkos_ArithTraits.hpp" +#include "KokkosKernels_ArithTraits.hpp" namespace KokkosKernels { namespace Impl { diff --git a/common/src/KokkosKernels_IOUtils.hpp b/common/src/KokkosKernels_IOUtils.hpp index 2aeff5262c..e6e91df3e1 100644 --- a/common/src/KokkosKernels_IOUtils.hpp +++ b/common/src/KokkosKernels_IOUtils.hpp @@ -27,7 +27,7 @@ #ifndef KOKKOSKERNELS_IOUTILS_HPP #define KOKKOSKERNELS_IOUTILS_HPP -#include "Kokkos_ArithTraits.hpp" +#include "KokkosKernels_ArithTraits.hpp" #include #include "Kokkos_Random.hpp" #include "KokkosKernels_SimpleUtils.hpp" diff --git a/common/src/KokkosKernels_Predicates.hpp b/common/src/KokkosKernels_Predicates.hpp index e750f93621..083278bda5 100644 --- a/common/src/KokkosKernels_Predicates.hpp +++ b/common/src/KokkosKernels_Predicates.hpp @@ -17,7 +17,7 @@ #ifndef KOKKOSKERNELS_PREDICATES_HPP #define KOKKOSKERNELS_PREDICATES_HPP -#include "Kokkos_ArithTraits.hpp" +#include "KokkosKernels_ArithTraits.hpp" /*! \file KokkosKernels_Predicates.hpp * Define predicates for KokkosKernels search functions diff --git a/common/src/KokkosKernels_SimpleUtils.hpp b/common/src/KokkosKernels_SimpleUtils.hpp index fd481770f8..7eaf07e8df 100644 --- a/common/src/KokkosKernels_SimpleUtils.hpp +++ b/common/src/KokkosKernels_SimpleUtils.hpp @@ -16,7 +16,7 @@ #ifndef KOKKOSKERNELS_SIMPLEUTILS_HPP #define KOKKOSKERNELS_SIMPLEUTILS_HPP #include "Kokkos_Core.hpp" -#include "Kokkos_ArithTraits.hpp" +#include "KokkosKernels_ArithTraits.hpp" #include #define KOKKOSKERNELS_MACRO_MIN(x, y) ((x) < (y) ? (x) : (y)) diff --git a/common/src/KokkosKernels_Utils.hpp b/common/src/KokkosKernels_Utils.hpp index a98cf98eef..69e51f2747 100644 --- a/common/src/KokkosKernels_Utils.hpp +++ b/common/src/KokkosKernels_Utils.hpp @@ -14,7 +14,7 @@ // //@HEADER #include "Kokkos_Core.hpp" -#include "Kokkos_ArithTraits.hpp" +#include "KokkosKernels_ArithTraits.hpp" #include "Kokkos_UnorderedMap.hpp" #include #include diff --git a/common/src/Kokkos_ArithTraits.hpp b/common/src/Kokkos_ArithTraits.hpp index 5bea222650..e90b724cf1 100644 --- a/common/src/Kokkos_ArithTraits.hpp +++ b/common/src/Kokkos_ArithTraits.hpp @@ -17,7 +17,7 @@ #ifndef KOKKOSKERNELS_KOKKOS_ARITHTRAITS_HPP #define KOKKOSKERNELS_KOKKOS_ARITHTRAITS_HPP -/// \file Kokkos_ArithTraits.hpp +/// \file KokkosKernels_ArithTraits.hpp /// \brief Declaration and definition of KokkosKernels::ArithTraits #include diff --git a/common/src/Kokkos_InnerProductSpaceTraits.hpp b/common/src/Kokkos_InnerProductSpaceTraits.hpp index 64f79f9a85..90edbe656c 100644 --- a/common/src/Kokkos_InnerProductSpaceTraits.hpp +++ b/common/src/Kokkos_InnerProductSpaceTraits.hpp @@ -21,7 +21,7 @@ /// \brief Declaration and definition of /// Kokkos::Details::InnerProductSpaceTraits -#include "Kokkos_ArithTraits.hpp" +#include "KokkosKernels_ArithTraits.hpp" namespace Kokkos { namespace Details { diff --git a/common/unit_test/Test_Common_ArithTraits.hpp b/common/unit_test/Test_Common_ArithTraits.hpp index 3ea1b52783..46f2b0e802 100644 --- a/common/unit_test/Test_Common_ArithTraits.hpp +++ b/common/unit_test/Test_Common_ArithTraits.hpp @@ -30,7 +30,7 @@ #define KOKKOSKERNELS_TEST_COMMON_ARITHTRAITSTEST_HPP #include -#include "Kokkos_ArithTraits.hpp" +#include "KokkosKernels_ArithTraits.hpp" #include // std::numeric_limits #include // typeid (T) #include diff --git a/common/unit_test/Test_Common_Sorting.hpp b/common/unit_test/Test_Common_Sorting.hpp index 8bc1b058fa..dc552cc85a 100644 --- a/common/unit_test/Test_Common_Sorting.hpp +++ b/common/unit_test/Test_Common_Sorting.hpp @@ -25,7 +25,7 @@ #include #include #include -#include +#include #include #include diff --git a/common/unit_test/Test_Common_float128.hpp b/common/unit_test/Test_Common_float128.hpp index b117753493..d1a14a4e67 100644 --- a/common/unit_test/Test_Common_float128.hpp +++ b/common/unit_test/Test_Common_float128.hpp @@ -36,7 +36,7 @@ #include #include -#include +#include #include // GCC / libquadmath doesn't implement an std::ostream operator<< for diff --git a/example/batched_solve/static_pivoting.cpp b/example/batched_solve/static_pivoting.cpp index f34b5bea1b..39f5d43e9f 100644 --- a/example/batched_solve/static_pivoting.cpp +++ b/example/batched_solve/static_pivoting.cpp @@ -29,7 +29,7 @@ #include "KokkosBatched_Vector.hpp" #include "KokkosKernels_IOUtils.hpp" -#include +#include #include #include "examples_helper.hpp" #include diff --git a/example/batched_solve/team_GMRES.cpp b/example/batched_solve/team_GMRES.cpp index f94f8e0050..26632f5253 100644 --- a/example/batched_solve/team_GMRES.cpp +++ b/example/batched_solve/team_GMRES.cpp @@ -29,7 +29,7 @@ #include "KokkosBatched_Vector.hpp" #include "KokkosKernels_IOUtils.hpp" -#include +#include #include #include "examples_helper.hpp" #include diff --git a/lapack/impl/KokkosLapack_gesv_impl.hpp b/lapack/impl/KokkosLapack_gesv_impl.hpp index 3a60f42171..e0802c10a7 100644 --- a/lapack/impl/KokkosLapack_gesv_impl.hpp +++ b/lapack/impl/KokkosLapack_gesv_impl.hpp @@ -21,7 +21,7 @@ /// \brief Implementation(s) of dense linear solve. #include -#include +#include namespace KokkosLapack { namespace Impl { diff --git a/lapack/impl/KokkosLapack_gesv_spec.hpp b/lapack/impl/KokkosLapack_gesv_spec.hpp index ebed196e3b..bc94f519cd 100644 --- a/lapack/impl/KokkosLapack_gesv_spec.hpp +++ b/lapack/impl/KokkosLapack_gesv_spec.hpp @@ -18,7 +18,7 @@ #include #include -#include +#include // Include the actual functors #if !defined(KOKKOSKERNELS_ETI_ONLY) || KOKKOSKERNELS_IMPL_COMPILE_LIBRARY diff --git a/lapack/impl/KokkosLapack_svd_impl.hpp b/lapack/impl/KokkosLapack_svd_impl.hpp index 49df758936..7ab012bdd7 100644 --- a/lapack/impl/KokkosLapack_svd_impl.hpp +++ b/lapack/impl/KokkosLapack_svd_impl.hpp @@ -21,7 +21,7 @@ /// \brief Implementation(s) of singular value decomposition of a dense matrix. #include -#include +#include namespace KokkosLapack { namespace Impl { diff --git a/lapack/impl/KokkosLapack_svd_spec.hpp b/lapack/impl/KokkosLapack_svd_spec.hpp index 89e329d250..75c703ea29 100644 --- a/lapack/impl/KokkosLapack_svd_spec.hpp +++ b/lapack/impl/KokkosLapack_svd_spec.hpp @@ -18,7 +18,7 @@ #include #include -#include +#include // Include the actual functors #if !defined(KOKKOSKERNELS_ETI_ONLY) || KOKKOSKERNELS_IMPL_COMPILE_LIBRARY diff --git a/lapack/tpls/KokkosLapack_Host_tpl.hpp b/lapack/tpls/KokkosLapack_Host_tpl.hpp index d467cf4383..214b2bedf9 100644 --- a/lapack/tpls/KokkosLapack_Host_tpl.hpp +++ b/lapack/tpls/KokkosLapack_Host_tpl.hpp @@ -21,7 +21,7 @@ /// \brief LAPACK wrapper #include "KokkosKernels_config.h" -#include "Kokkos_ArithTraits.hpp" +#include "KokkosKernels_ArithTraits.hpp" #if defined(KOKKOSKERNELS_ENABLE_TPL_LAPACK) diff --git a/lapack/tpls/KokkosLapack_svd_tpl_spec_decl.hpp b/lapack/tpls/KokkosLapack_svd_tpl_spec_decl.hpp index e66b1f370a..95e99e5b93 100644 --- a/lapack/tpls/KokkosLapack_svd_tpl_spec_decl.hpp +++ b/lapack/tpls/KokkosLapack_svd_tpl_spec_decl.hpp @@ -18,7 +18,7 @@ #define KOKKOSLAPACK_SVD_TPL_SPEC_DECL_HPP_ #include "KokkosKernels_Error.hpp" -#include "Kokkos_ArithTraits.hpp" +#include "KokkosKernels_ArithTraits.hpp" #include diff --git a/perf_test/batched/dense/KokkosBatched_Test_BlockJacobi_Tutorial.cpp b/perf_test/batched/dense/KokkosBatched_Test_BlockJacobi_Tutorial.cpp index fa638a013d..8977f77e5e 100644 --- a/perf_test/batched/dense/KokkosBatched_Test_BlockJacobi_Tutorial.cpp +++ b/perf_test/batched/dense/KokkosBatched_Test_BlockJacobi_Tutorial.cpp @@ -21,7 +21,7 @@ /// KokkosKernels headers #include "KokkosBatched_Util.hpp" -#include "Kokkos_ArithTraits.hpp" +#include "KokkosKernels_ArithTraits.hpp" #include "KokkosBatched_Util.hpp" #include "KokkosBatched_Copy_Decl.hpp" #include "KokkosBatched_Copy_Impl.hpp" diff --git a/perf_test/batched/dense/KokkosBatched_Test_BlockTridiagDirect.cpp b/perf_test/batched/dense/KokkosBatched_Test_BlockTridiagDirect.cpp index 5359af2db5..ef9f1e6498 100644 --- a/perf_test/batched/dense/KokkosBatched_Test_BlockTridiagDirect.cpp +++ b/perf_test/batched/dense/KokkosBatched_Test_BlockTridiagDirect.cpp @@ -22,7 +22,7 @@ #include "KokkosBatched_Util.hpp" #include "KokkosBatched_Vector.hpp" -#include +#include #include #include #include diff --git a/perf_test/batched/dense/KokkosBatched_Test_BlockTridiagJacobi.cpp b/perf_test/batched/dense/KokkosBatched_Test_BlockTridiagJacobi.cpp index aa179e2ba6..e0ad7ab510 100644 --- a/perf_test/batched/dense/KokkosBatched_Test_BlockTridiagJacobi.cpp +++ b/perf_test/batched/dense/KokkosBatched_Test_BlockTridiagJacobi.cpp @@ -28,7 +28,7 @@ #include "KokkosBatched_Util.hpp" #include "KokkosBatched_Vector.hpp" -#include +#include #include #include #include diff --git a/perf_test/batched/sparse/CG/KokkosBatched_Test_CG.cpp b/perf_test/batched/sparse/CG/KokkosBatched_Test_CG.cpp index d0a9d34639..a9af06ded5 100644 --- a/perf_test/batched/sparse/CG/KokkosBatched_Test_CG.cpp +++ b/perf_test/batched/sparse/CG/KokkosBatched_Test_CG.cpp @@ -18,7 +18,7 @@ /// Kokkos headers #include "Kokkos_Core.hpp" -#include "Kokkos_ArithTraits.hpp" +#include "KokkosKernels_ArithTraits.hpp" #include "KokkosBatched_Util.hpp" #include "KokkosBatched_Vector.hpp" diff --git a/perf_test/batched/sparse/GMRES/KokkosBatched_Test_GMRES.cpp b/perf_test/batched/sparse/GMRES/KokkosBatched_Test_GMRES.cpp index a979c02027..74e419e0d0 100644 --- a/perf_test/batched/sparse/GMRES/KokkosBatched_Test_GMRES.cpp +++ b/perf_test/batched/sparse/GMRES/KokkosBatched_Test_GMRES.cpp @@ -21,7 +21,7 @@ /// Kokkos headers #include "Kokkos_Core.hpp" -#include "Kokkos_ArithTraits.hpp" +#include "KokkosKernels_ArithTraits.hpp" #include "KokkosBatched_Util.hpp" #include "KokkosBatched_Vector.hpp" diff --git a/perf_test/batched/sparse/SPMV/KokkosBatched_Test_SPMV.cpp b/perf_test/batched/sparse/SPMV/KokkosBatched_Test_SPMV.cpp index c7d508f8b2..b2bf1be30c 100644 --- a/perf_test/batched/sparse/SPMV/KokkosBatched_Test_SPMV.cpp +++ b/perf_test/batched/sparse/SPMV/KokkosBatched_Test_SPMV.cpp @@ -18,7 +18,7 @@ /// Kokkos headers #include "Kokkos_Core.hpp" -#include "Kokkos_ArithTraits.hpp" +#include "KokkosKernels_ArithTraits.hpp" #include "KokkosBatched_Util.hpp" #include "KokkosBatched_Test_Sparse_Helper.hpp" diff --git a/perf_test/batched/sparse/cusolver/KokkosBatched_Test_cusolverDn.cpp b/perf_test/batched/sparse/cusolver/KokkosBatched_Test_cusolverDn.cpp index dc815a63c0..f175a568a2 100644 --- a/perf_test/batched/sparse/cusolver/KokkosBatched_Test_cusolverDn.cpp +++ b/perf_test/batched/sparse/cusolver/KokkosBatched_Test_cusolverDn.cpp @@ -34,7 +34,7 @@ #include "KokkosKernels_config.h" #include "KokkosKernels_SparseUtils_cusparse.hpp" -#include +#include #include #include #include diff --git a/perf_test/batched/sparse/cusolver/KokkosBatched_Test_cusolverSp.cpp b/perf_test/batched/sparse/cusolver/KokkosBatched_Test_cusolverSp.cpp index f987fcface..f391bed28b 100644 --- a/perf_test/batched/sparse/cusolver/KokkosBatched_Test_cusolverSp.cpp +++ b/perf_test/batched/sparse/cusolver/KokkosBatched_Test_cusolverSp.cpp @@ -37,7 +37,7 @@ #include "KokkosKernels_config.h" #include "KokkosKernels_SparseUtils_cusparse.hpp" -#include +#include #include #include #include diff --git a/perf_test/blas/blas3/KokkosBlas3_gemm_perf_test.hpp b/perf_test/blas/blas3/KokkosBlas3_gemm_perf_test.hpp index 0849859b70..8723bd0686 100644 --- a/perf_test/blas/blas3/KokkosBlas3_gemm_perf_test.hpp +++ b/perf_test/blas/blas3/KokkosBlas3_gemm_perf_test.hpp @@ -25,7 +25,7 @@ #include -#include "Kokkos_ArithTraits.hpp" +#include "KokkosKernels_ArithTraits.hpp" #include "KokkosBatched_HostLevel_Gemm.hpp" #include "KokkosBatched_Gemm_Decl.hpp" #include "KokkosBatched_Util.hpp" diff --git a/sparse/impl/KokkosSparse_bspgemm_numeric_spec.hpp b/sparse/impl/KokkosSparse_bspgemm_numeric_spec.hpp index 450f98852e..91054882b8 100644 --- a/sparse/impl/KokkosSparse_bspgemm_numeric_spec.hpp +++ b/sparse/impl/KokkosSparse_bspgemm_numeric_spec.hpp @@ -19,7 +19,7 @@ #include #include -// #include +// #include #include "KokkosKernels_Handle.hpp" // Include the actual functors #if !defined(KOKKOSKERNELS_ETI_ONLY) || KOKKOSKERNELS_IMPL_COMPILE_LIBRARY diff --git a/sparse/impl/KokkosSparse_gauss_seidel_spec.hpp b/sparse/impl/KokkosSparse_gauss_seidel_spec.hpp index 6f62de44b1..22a1a16263 100644 --- a/sparse/impl/KokkosSparse_gauss_seidel_spec.hpp +++ b/sparse/impl/KokkosSparse_gauss_seidel_spec.hpp @@ -19,7 +19,7 @@ #include #include -// #include +// #include #include "KokkosKernels_Handle.hpp" // Include the actual functors #if !defined(KOKKOSKERNELS_ETI_ONLY) || KOKKOSKERNELS_IMPL_COMPILE_LIBRARY diff --git a/sparse/impl/KokkosSparse_getDiagCopyWithOffsets_impl.hpp b/sparse/impl/KokkosSparse_getDiagCopyWithOffsets_impl.hpp index 9048403d94..0588a495ee 100644 --- a/sparse/impl/KokkosSparse_getDiagCopyWithOffsets_impl.hpp +++ b/sparse/impl/KokkosSparse_getDiagCopyWithOffsets_impl.hpp @@ -21,7 +21,7 @@ #include "KokkosSparse_OrdinalTraits.hpp" #include "KokkosKernels_config.h" #include "Kokkos_Core.hpp" -#include "Kokkos_ArithTraits.hpp" +#include "KokkosKernels_ArithTraits.hpp" namespace KokkosSparse { namespace Impl { diff --git a/sparse/impl/KokkosSparse_gmres_impl.hpp b/sparse/impl/KokkosSparse_gmres_impl.hpp index 6cfa141b8b..a4d7a2d85f 100644 --- a/sparse/impl/KokkosSparse_gmres_impl.hpp +++ b/sparse/impl/KokkosSparse_gmres_impl.hpp @@ -23,7 +23,7 @@ /// \brief Implementation(s) of the numeric phase of GMRES. #include -#include +#include #include #include #include diff --git a/sparse/impl/KokkosSparse_gmres_spec.hpp b/sparse/impl/KokkosSparse_gmres_spec.hpp index 8e9dbe5041..37fed61333 100644 --- a/sparse/impl/KokkosSparse_gmres_spec.hpp +++ b/sparse/impl/KokkosSparse_gmres_spec.hpp @@ -21,7 +21,7 @@ #include #include -#include +#include #include "KokkosSparse_CrsMatrix.hpp" #include "KokkosSparse_BsrMatrix.hpp" #include "KokkosKernels_Handle.hpp" diff --git a/sparse/impl/KokkosSparse_mdf_impl.hpp b/sparse/impl/KokkosSparse_mdf_impl.hpp index a1ed5648e4..fee48d74b6 100644 --- a/sparse/impl/KokkosSparse_mdf_impl.hpp +++ b/sparse/impl/KokkosSparse_mdf_impl.hpp @@ -22,7 +22,7 @@ #include "KokkosKernels_Sorting.hpp" #include "KokkosSparse_findRelOffset.hpp" #include -#include "Kokkos_ArithTraits.hpp" +#include "KokkosKernels_ArithTraits.hpp" namespace KokkosSparse { namespace Impl { diff --git a/sparse/impl/KokkosSparse_par_ilut_numeric_impl.hpp b/sparse/impl/KokkosSparse_par_ilut_numeric_impl.hpp index 433899149f..c3e5d4743a 100644 --- a/sparse/impl/KokkosSparse_par_ilut_numeric_impl.hpp +++ b/sparse/impl/KokkosSparse_par_ilut_numeric_impl.hpp @@ -21,7 +21,7 @@ /// \brief Implementation(s) of the numeric phase of sparse parallel ILUT. #include -#include +#include #include #include #include diff --git a/sparse/impl/KokkosSparse_par_ilut_numeric_spec.hpp b/sparse/impl/KokkosSparse_par_ilut_numeric_spec.hpp index 471dedfb76..d5c88e4c15 100644 --- a/sparse/impl/KokkosSparse_par_ilut_numeric_spec.hpp +++ b/sparse/impl/KokkosSparse_par_ilut_numeric_spec.hpp @@ -18,7 +18,7 @@ #include #include -#include +#include #include "KokkosSparse_CrsMatrix.hpp" #include "KokkosKernels_Handle.hpp" diff --git a/sparse/impl/KokkosSparse_par_ilut_symbolic_impl.hpp b/sparse/impl/KokkosSparse_par_ilut_symbolic_impl.hpp index 92fe5c662a..2095d602ed 100644 --- a/sparse/impl/KokkosSparse_par_ilut_symbolic_impl.hpp +++ b/sparse/impl/KokkosSparse_par_ilut_symbolic_impl.hpp @@ -21,7 +21,7 @@ /// \brief Implementation of the symbolic phase of sparse ILU(k). #include -#include +#include #include #include #include diff --git a/sparse/impl/KokkosSparse_par_ilut_symbolic_spec.hpp b/sparse/impl/KokkosSparse_par_ilut_symbolic_spec.hpp index 8b816e35be..8175ffea61 100644 --- a/sparse/impl/KokkosSparse_par_ilut_symbolic_spec.hpp +++ b/sparse/impl/KokkosSparse_par_ilut_symbolic_spec.hpp @@ -18,7 +18,7 @@ #include #include -#include +#include #include "KokkosSparse_CrsMatrix.hpp" #include "KokkosKernels_Handle.hpp" diff --git a/sparse/impl/KokkosSparse_sor_sequential_impl.hpp b/sparse/impl/KokkosSparse_sor_sequential_impl.hpp index cd405035f0..1a5d5864bf 100644 --- a/sparse/impl/KokkosSparse_sor_sequential_impl.hpp +++ b/sparse/impl/KokkosSparse_sor_sequential_impl.hpp @@ -36,7 +36,7 @@ /// We have not done this here. #include -#include +#include #include // temporarily namespace KokkosSparse { diff --git a/sparse/impl/KokkosSparse_spadd_numeric_impl.hpp b/sparse/impl/KokkosSparse_spadd_numeric_impl.hpp index a22b0623e8..0fec63a3d4 100644 --- a/sparse/impl/KokkosSparse_spadd_numeric_impl.hpp +++ b/sparse/impl/KokkosSparse_spadd_numeric_impl.hpp @@ -19,7 +19,7 @@ #include "KokkosKernels_Handle.hpp" #include "KokkosKernels_Sorting.hpp" -#include "Kokkos_ArithTraits.hpp" +#include "KokkosKernels_ArithTraits.hpp" namespace KokkosSparse { namespace Impl { diff --git a/sparse/impl/KokkosSparse_spadd_symbolic_impl.hpp b/sparse/impl/KokkosSparse_spadd_symbolic_impl.hpp index 9146b6988c..3432e8477a 100644 --- a/sparse/impl/KokkosSparse_spadd_symbolic_impl.hpp +++ b/sparse/impl/KokkosSparse_spadd_symbolic_impl.hpp @@ -19,7 +19,7 @@ #include "KokkosKernels_Handle.hpp" #include "KokkosSparse_SortCrs.hpp" -#include "Kokkos_ArithTraits.hpp" +#include "KokkosKernels_ArithTraits.hpp" namespace KokkosSparse { namespace Impl { diff --git a/sparse/impl/KokkosSparse_spgemm_numeric_spec.hpp b/sparse/impl/KokkosSparse_spgemm_numeric_spec.hpp index 460033e950..e9e98f58ac 100644 --- a/sparse/impl/KokkosSparse_spgemm_numeric_spec.hpp +++ b/sparse/impl/KokkosSparse_spgemm_numeric_spec.hpp @@ -19,7 +19,7 @@ #include #include -// #include +// #include #include "KokkosKernels_Handle.hpp" // Include the actual functors #if !defined(KOKKOSKERNELS_ETI_ONLY) || KOKKOSKERNELS_IMPL_COMPILE_LIBRARY diff --git a/sparse/impl/KokkosSparse_spgemm_symbolic_spec.hpp b/sparse/impl/KokkosSparse_spgemm_symbolic_spec.hpp index 117492e21d..e7a01b8a7d 100644 --- a/sparse/impl/KokkosSparse_spgemm_symbolic_spec.hpp +++ b/sparse/impl/KokkosSparse_spgemm_symbolic_spec.hpp @@ -19,7 +19,7 @@ #include #include -#include +#include #include "KokkosKernels_Handle.hpp" // Include the actual functors #if !defined(KOKKOSKERNELS_ETI_ONLY) || KOKKOSKERNELS_IMPL_COMPILE_LIBRARY diff --git a/sparse/impl/KokkosSparse_spiluk_numeric_impl.hpp b/sparse/impl/KokkosSparse_spiluk_numeric_impl.hpp index 37ff6175d9..ba7152f30f 100644 --- a/sparse/impl/KokkosSparse_spiluk_numeric_impl.hpp +++ b/sparse/impl/KokkosSparse_spiluk_numeric_impl.hpp @@ -22,7 +22,7 @@ #include #include -#include +#include #include #include "KokkosBatched_SetIdentity_Decl.hpp" #include "KokkosBatched_SetIdentity_Impl.hpp" diff --git a/sparse/impl/KokkosSparse_spiluk_numeric_spec.hpp b/sparse/impl/KokkosSparse_spiluk_numeric_spec.hpp index 92c9b80753..22f0dc0dfc 100644 --- a/sparse/impl/KokkosSparse_spiluk_numeric_spec.hpp +++ b/sparse/impl/KokkosSparse_spiluk_numeric_spec.hpp @@ -18,7 +18,7 @@ #include #include -#include +#include #include "KokkosSparse_CrsMatrix.hpp" #include "KokkosKernels_Handle.hpp" diff --git a/sparse/impl/KokkosSparse_spiluk_symbolic_impl.hpp b/sparse/impl/KokkosSparse_spiluk_symbolic_impl.hpp index c16639dc2e..551766ab27 100644 --- a/sparse/impl/KokkosSparse_spiluk_symbolic_impl.hpp +++ b/sparse/impl/KokkosSparse_spiluk_symbolic_impl.hpp @@ -21,7 +21,7 @@ /// \brief Implementation of the symbolic phase of sparse ILU(k). #include -#include +#include #include #include #include diff --git a/sparse/impl/KokkosSparse_spiluk_symbolic_spec.hpp b/sparse/impl/KokkosSparse_spiluk_symbolic_spec.hpp index 433c9c4e80..980f25eafc 100644 --- a/sparse/impl/KokkosSparse_spiluk_symbolic_spec.hpp +++ b/sparse/impl/KokkosSparse_spiluk_symbolic_spec.hpp @@ -18,7 +18,7 @@ #include #include -#include +#include #include "KokkosSparse_CrsMatrix.hpp" #include "KokkosKernels_Handle.hpp" diff --git a/sparse/impl/KokkosSparse_spmv_bsrmatrix_spec.hpp b/sparse/impl/KokkosSparse_spmv_bsrmatrix_spec.hpp index b6ba3e5b88..e7beeb3a3d 100644 --- a/sparse/impl/KokkosSparse_spmv_bsrmatrix_spec.hpp +++ b/sparse/impl/KokkosSparse_spmv_bsrmatrix_spec.hpp @@ -18,7 +18,7 @@ #include #include -#include +#include #include "KokkosSparse_BsrMatrix.hpp" #include "KokkosSparse_spmv_handle.hpp" diff --git a/sparse/impl/KokkosSparse_spmv_spec.hpp b/sparse/impl/KokkosSparse_spmv_spec.hpp index e935351526..be3b9f60a2 100644 --- a/sparse/impl/KokkosSparse_spmv_spec.hpp +++ b/sparse/impl/KokkosSparse_spmv_spec.hpp @@ -18,7 +18,7 @@ #include #include -#include +#include #include "KokkosSparse_CrsMatrix.hpp" #include "KokkosSparse_spmv_handle.hpp" diff --git a/sparse/impl/KokkosSparse_spmv_struct_spec.hpp b/sparse/impl/KokkosSparse_spmv_struct_spec.hpp index 7a5360358c..37804c75ab 100644 --- a/sparse/impl/KokkosSparse_spmv_struct_spec.hpp +++ b/sparse/impl/KokkosSparse_spmv_struct_spec.hpp @@ -18,7 +18,7 @@ #include #include -#include +#include #include "KokkosSparse_CrsMatrix.hpp" // Include the actual functors diff --git a/sparse/impl/KokkosSparse_spmv_team_impl.hpp b/sparse/impl/KokkosSparse_spmv_team_impl.hpp index 72bc373e61..427564b643 100644 --- a/sparse/impl/KokkosSparse_spmv_team_impl.hpp +++ b/sparse/impl/KokkosSparse_spmv_team_impl.hpp @@ -19,7 +19,7 @@ #include #include -#include +#include #include namespace KokkosSparse { diff --git a/sparse/impl/KokkosSparse_spmv_team_spec.hpp b/sparse/impl/KokkosSparse_spmv_team_spec.hpp index 7ae5152d16..8b798ca138 100644 --- a/sparse/impl/KokkosSparse_spmv_team_spec.hpp +++ b/sparse/impl/KokkosSparse_spmv_team_spec.hpp @@ -19,7 +19,7 @@ #include #include -#include +#include #include #include diff --git a/sparse/impl/KokkosSparse_sptrsv_solve_impl.hpp b/sparse/impl/KokkosSparse_sptrsv_solve_impl.hpp index ace9dde6b5..9c37088b4f 100644 --- a/sparse/impl/KokkosSparse_sptrsv_solve_impl.hpp +++ b/sparse/impl/KokkosSparse_sptrsv_solve_impl.hpp @@ -21,7 +21,7 @@ /// \brief Implementation(s) of sparse triangular solve. #include -#include +#include #include #include #include diff --git a/sparse/impl/KokkosSparse_sptrsv_solve_spec.hpp b/sparse/impl/KokkosSparse_sptrsv_solve_spec.hpp index b8f8a4ab1c..5c5dc4d08a 100644 --- a/sparse/impl/KokkosSparse_sptrsv_solve_spec.hpp +++ b/sparse/impl/KokkosSparse_sptrsv_solve_spec.hpp @@ -18,7 +18,7 @@ #include #include -#include +#include #include "KokkosSparse_CrsMatrix.hpp" #include "KokkosKernels_Handle.hpp" diff --git a/sparse/impl/KokkosSparse_sptrsv_symbolic_impl.hpp b/sparse/impl/KokkosSparse_sptrsv_symbolic_impl.hpp index cb4978a64a..fd7c1894a4 100644 --- a/sparse/impl/KokkosSparse_sptrsv_symbolic_impl.hpp +++ b/sparse/impl/KokkosSparse_sptrsv_symbolic_impl.hpp @@ -20,7 +20,7 @@ /// \brief Implementation(s) of sparse triangular solve. #include -#include +#include #include // #define TRISOLVE_SYMB_TIMERS diff --git a/sparse/impl/KokkosSparse_sptrsv_symbolic_spec.hpp b/sparse/impl/KokkosSparse_sptrsv_symbolic_spec.hpp index 0b009f0e71..bb24d15139 100644 --- a/sparse/impl/KokkosSparse_sptrsv_symbolic_spec.hpp +++ b/sparse/impl/KokkosSparse_sptrsv_symbolic_spec.hpp @@ -18,7 +18,7 @@ #include #include -#include +#include #include "KokkosSparse_CrsMatrix.hpp" #include "KokkosKernels_Handle.hpp" diff --git a/sparse/impl/KokkosSparse_trsv_impl.hpp b/sparse/impl/KokkosSparse_trsv_impl.hpp index a1ff872604..9d6c955ed4 100644 --- a/sparse/impl/KokkosSparse_trsv_impl.hpp +++ b/sparse/impl/KokkosSparse_trsv_impl.hpp @@ -21,7 +21,7 @@ /// \brief Implementation(s) of sequential sparse triangular solve. #include -#include +#include #include "KokkosBatched_Axpy.hpp" #include "KokkosBatched_Gemm_Decl.hpp" #include "KokkosBatched_Gemm_Serial_Impl.hpp" diff --git a/sparse/impl/KokkosSparse_trsv_spec.hpp b/sparse/impl/KokkosSparse_trsv_spec.hpp index 95c6d23c5f..35ce007bf8 100644 --- a/sparse/impl/KokkosSparse_trsv_spec.hpp +++ b/sparse/impl/KokkosSparse_trsv_spec.hpp @@ -18,7 +18,7 @@ #include #include -#include +#include #include "KokkosSparse_CrsMatrix.hpp" #include "KokkosSparse_BsrMatrix.hpp" diff --git a/sparse/src/KokkosSparse_BsrMatrix.hpp b/sparse/src/KokkosSparse_BsrMatrix.hpp index 359f41760e..552e23105b 100644 --- a/sparse/src/KokkosSparse_BsrMatrix.hpp +++ b/sparse/src/KokkosSparse_BsrMatrix.hpp @@ -30,7 +30,7 @@ #include #include "Kokkos_Core.hpp" -#include "Kokkos_ArithTraits.hpp" +#include "KokkosKernels_ArithTraits.hpp" #include "KokkosSparse_CrsMatrix.hpp" #include "KokkosKernels_Error.hpp" #include "KokkosKernels_default_types.hpp" diff --git a/sparse/src/KokkosSparse_Preconditioner.hpp b/sparse/src/KokkosSparse_Preconditioner.hpp index b85252d287..9bc18f89f4 100644 --- a/sparse/src/KokkosSparse_Preconditioner.hpp +++ b/sparse/src/KokkosSparse_Preconditioner.hpp @@ -21,7 +21,7 @@ #include #include -#include +#include namespace KokkosSparse { namespace Experimental { diff --git a/sparse/unit_test/Test_Sparse_CrsMatrix.hpp b/sparse/unit_test/Test_Sparse_CrsMatrix.hpp index 997c701189..6544efa2ab 100644 --- a/sparse/unit_test/Test_Sparse_CrsMatrix.hpp +++ b/sparse/unit_test/Test_Sparse_CrsMatrix.hpp @@ -19,7 +19,7 @@ #include #include #include "KokkosSparse_CrsMatrix.hpp" -#include "Kokkos_ArithTraits.hpp" +#include "KokkosKernels_ArithTraits.hpp" // #ifndef kokkos_complex_double // #define kokkos_complex_double Kokkos::complex diff --git a/sparse/unit_test/Test_Sparse_SortCrs.hpp b/sparse/unit_test/Test_Sparse_SortCrs.hpp index 5f4697ae34..cf2ac7dc06 100644 --- a/sparse/unit_test/Test_Sparse_SortCrs.hpp +++ b/sparse/unit_test/Test_Sparse_SortCrs.hpp @@ -28,7 +28,7 @@ #include #include #include -#include +#include #include #include diff --git a/sparse/unit_test/Test_Sparse_removeCrsMatrixZeros.hpp b/sparse/unit_test/Test_Sparse_removeCrsMatrixZeros.hpp index c51bd43b58..b5afa13a89 100644 --- a/sparse/unit_test/Test_Sparse_removeCrsMatrixZeros.hpp +++ b/sparse/unit_test/Test_Sparse_removeCrsMatrixZeros.hpp @@ -24,7 +24,7 @@ #include #include #include -#include +#include namespace TestRemoveCrsMatrixZeros { diff --git a/sparse/unit_test/Test_Sparse_replaceSumInto.hpp b/sparse/unit_test/Test_Sparse_replaceSumInto.hpp index f8b857b8ba..8322909706 100644 --- a/sparse/unit_test/Test_Sparse_replaceSumInto.hpp +++ b/sparse/unit_test/Test_Sparse_replaceSumInto.hpp @@ -15,7 +15,7 @@ //@HEADER // #include "Teuchos_UnitTestHarness.hpp" -#include "Kokkos_ArithTraits.hpp" +#include "KokkosKernels_ArithTraits.hpp" #include #include "KokkosSparse_CrsMatrix.hpp" diff --git a/sparse/unit_test/Test_Sparse_replaceSumIntoLonger.hpp b/sparse/unit_test/Test_Sparse_replaceSumIntoLonger.hpp index c1725ee3ee..592bd7fe90 100644 --- a/sparse/unit_test/Test_Sparse_replaceSumIntoLonger.hpp +++ b/sparse/unit_test/Test_Sparse_replaceSumIntoLonger.hpp @@ -15,7 +15,7 @@ //@HEADER // #include "Teuchos_UnitTestHarness.hpp" -#include "Kokkos_ArithTraits.hpp" +#include "KokkosKernels_ArithTraits.hpp" #include #include "KokkosSparse_CrsMatrix.hpp" diff --git a/sparse/unit_test/Test_Sparse_spadd.hpp b/sparse/unit_test/Test_Sparse_spadd.hpp index 301e48e738..2fa4921dfa 100644 --- a/sparse/unit_test/Test_Sparse_spadd.hpp +++ b/sparse/unit_test/Test_Sparse_spadd.hpp @@ -16,7 +16,7 @@ #include #include #include -#include +#include #include #include diff --git a/test_common/KokkosKernels_TestMatrixUtils.hpp b/test_common/KokkosKernels_TestMatrixUtils.hpp index 998ccdba90..cb93b838ee 100644 --- a/test_common/KokkosKernels_TestMatrixUtils.hpp +++ b/test_common/KokkosKernels_TestMatrixUtils.hpp @@ -21,7 +21,7 @@ #include "KokkosKernels_Utils.hpp" #include "KokkosKernels_IOUtils.hpp" -#include "Kokkos_ArithTraits.hpp" +#include "KokkosKernels_ArithTraits.hpp" #include "KokkosBatched_Vector.hpp" // Make this include-able from all subdirectories diff --git a/test_common/KokkosKernels_TestUtils.hpp b/test_common/KokkosKernels_TestUtils.hpp index 1fc721a2fb..7202b3fe7f 100644 --- a/test_common/KokkosKernels_TestUtils.hpp +++ b/test_common/KokkosKernels_TestUtils.hpp @@ -21,7 +21,7 @@ #include "KokkosKernels_Utils.hpp" #include "KokkosKernels_IOUtils.hpp" -#include "Kokkos_ArithTraits.hpp" +#include "KokkosKernels_ArithTraits.hpp" #include "KokkosBatched_Vector.hpp" // Make this include-able from all subdirectories #include "../tpls/gtest/gtest/gtest.h" //for EXPECT_** diff --git a/test_common/KokkosKernels_TestVanilla.hpp b/test_common/KokkosKernels_TestVanilla.hpp index ce5653d5c6..eb19ec6994 100644 --- a/test_common/KokkosKernels_TestVanilla.hpp +++ b/test_common/KokkosKernels_TestVanilla.hpp @@ -21,7 +21,7 @@ #include "KokkosKernels_Utils.hpp" #include "KokkosKernels_IOUtils.hpp" -#include "Kokkos_ArithTraits.hpp" +#include "KokkosKernels_ArithTraits.hpp" #include "KokkosBatched_Vector.hpp" namespace Test { From 560e9d4d2f3a1f9ab9925921b0507fb9cea369e4 Mon Sep 17 00:00:00 2001 From: Luc Berger-Vergiat Date: Tue, 30 Sep 2025 10:00:20 -0600 Subject: [PATCH 7/7] Applying clang-format Signed-off-by: Luc Berger-Vergiat --- common/src/KokkosKernels_ArithTraits.hpp | 1 - common/src/Kokkos_ArithTraits.hpp | 6 ++++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/common/src/KokkosKernels_ArithTraits.hpp b/common/src/KokkosKernels_ArithTraits.hpp index 2bfeb8559c..930593603a 100644 --- a/common/src/KokkosKernels_ArithTraits.hpp +++ b/common/src/KokkosKernels_ArithTraits.hpp @@ -1644,5 +1644,4 @@ struct [[deprecated]] ArithTraits { } // namespace KokkosKernels - #endif // KOKKOSKERNELS_ARITHTRAITS_HPP diff --git a/common/src/Kokkos_ArithTraits.hpp b/common/src/Kokkos_ArithTraits.hpp index e90b724cf1..7fc6a8790a 100644 --- a/common/src/Kokkos_ArithTraits.hpp +++ b/common/src/Kokkos_ArithTraits.hpp @@ -24,11 +24,13 @@ namespace Kokkos { template -using ArithTraits [[deprecated("Use KokkosKernels::ArithTraits from KokkosKernels_ArithTraits.hpp header instead")]] = ::KokkosKernels::ArithTraits; +using ArithTraits [[deprecated("Use KokkosKernels::ArithTraits from KokkosKernels_ArithTraits.hpp header instead")]] = + ::KokkosKernels::ArithTraits; namespace Details { template -using ArithTraits [[deprecated("Use KokkosKernels::ArithTraits from KokkosKernels_ArithTraits.hpp header instead")]] = ::KokkosKernels::ArithTraits; +using ArithTraits [[deprecated("Use KokkosKernels::ArithTraits from KokkosKernels_ArithTraits.hpp header instead")]] = + ::KokkosKernels::ArithTraits; } // namespace Details } // namespace Kokkos