Skip to content

Commit

Permalink
batched/eti: ETI host-level interfaces
Browse files Browse the repository at this point in the history
  • Loading branch information
e10harvey committed May 2, 2023
1 parent b654dd6 commit 62c5044
Show file tree
Hide file tree
Showing 31 changed files with 945 additions and 515 deletions.
1 change: 0 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,6 @@ ELSE()
# This doesn't change pre-existing behavior before the ETI changes
#LIST(APPEND HEADERS ${ETI_HEADERS})
#-----------------------------------------------------------------------------

KOKKOSKERNELS_ADD_LIBRARY(
kokkoskernels
HEADERS ${HEADERS}
Expand Down
50 changes: 50 additions & 0 deletions batched/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,53 @@ ENDIF()
# Adding unit-tests
KOKKOSKERNELS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}/batched)
KOKKOSKERNELS_INCLUDE_DIRECTORIES(REQUIRED_DURING_INSTALLATION_TESTING ${CMAKE_CURRENT_SOURCE_DIR}/batched)

KOKKOSKERNELS_GENERATE_ETI(Batched_Gemm_nt_nt_bll Gemm
COMPONENTS batched
HEADER_LIST ETI_HEADERS
SOURCE_LIST SOURCES
TYPE_LISTS FLOATS LAYOUTS DEVICES
)
KOKKOSKERNELS_GENERATE_ETI(Batched_Gemm_nt_t_bll Gemm
COMPONENTS batched
HEADER_LIST ETI_HEADERS
SOURCE_LIST SOURCES
TYPE_LISTS FLOATS LAYOUTS DEVICES
)
KOKKOSKERNELS_GENERATE_ETI(Batched_Gemm_t_nt_bll Gemm
COMPONENTS batched
HEADER_LIST ETI_HEADERS
SOURCE_LIST SOURCES
TYPE_LISTS FLOATS LAYOUTS DEVICES
)
KOKKOSKERNELS_GENERATE_ETI(Batched_Gemm_t_t_bll Gemm
COMPONENTS batched
HEADER_LIST ETI_HEADERS
SOURCE_LIST SOURCES
TYPE_LISTS FLOATS LAYOUTS DEVICES
)

KOKKOSKERNELS_GENERATE_ETI(Batched_Gemm_nt_nt_blr Gemm
COMPONENTS batched
HEADER_LIST ETI_HEADERS
SOURCE_LIST SOURCES
TYPE_LISTS FLOATS LAYOUTS DEVICES
)
KOKKOSKERNELS_GENERATE_ETI(Batched_Gemm_nt_t_blr Gemm
COMPONENTS batched
HEADER_LIST ETI_HEADERS
SOURCE_LIST SOURCES
TYPE_LISTS FLOATS LAYOUTS DEVICES
)
KOKKOSKERNELS_GENERATE_ETI(Batched_Gemm_t_nt_blr Gemm
COMPONENTS batched
HEADER_LIST ETI_HEADERS
SOURCE_LIST SOURCES
TYPE_LISTS FLOATS LAYOUTS DEVICES
)
KOKKOSKERNELS_GENERATE_ETI(Batched_Gemm_t_t_blr Gemm
COMPONENTS batched
HEADER_LIST ETI_HEADERS
SOURCE_LIST SOURCES
TYPE_LISTS FLOATS LAYOUTS DEVICES
)
666 changes: 666 additions & 0 deletions batched/dense/impl/KokkosBatched_HostLevel_Gemm_Impl.hpp

Large diffs are not rendered by default.

533 changes: 26 additions & 507 deletions batched/dense/src/KokkosBatched_Gemm_Decl.hpp

Large diffs are not rendered by default.

12 changes: 7 additions & 5 deletions batched/dense/unit_test/Test_Batched_BatchedGemm.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -290,11 +290,13 @@ void impl_test_batched_gemm(const int N, const int matAdim1, const int matAdim2,
ViewType a_actual("a_actual", N, matAdim1, matAdim2);
ViewType b_actual("b_actual", N, matBdim1, matBdim2);
ViewType c_actual("c_actual", N, matCdim1, matCdim2);
using ta = typename ParamTagType::transA;
using tb = typename ParamTagType::transB;
using bl = typename ParamTagType::batchLayout;
BatchedGemm<ta, tb, bl>(&batchedGemmHandle, 0.34, a_actual,
b_actual, 0.43, c_actual);
using ta = typename ParamTagType::transA;
using tb = typename ParamTagType::transB;
using bl = typename ParamTagType::batchLayout;
ScalarType alpha = 0.34;
ScalarType beta = 0.43;
BatchedGemm<ta, tb, bl>(&batchedGemmHandle, alpha, a_actual,
b_actual, beta, c_actual);
std::string fmsg = kk_failure_str(__FILE__, __FUNCTION__, __LINE__);
FAIL() << fmsg;
} catch (const std::runtime_error& error) {
Expand Down
13 changes: 11 additions & 2 deletions batched/dense/unit_test/Test_Batched_BatchedGemm_Real.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,12 @@
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//@HEADER
#if defined(KOKKOS_BHALF_T_IS_FLOAT)

// We do not ETI half-types. Only test this if ETI ONLY is off
// and bhalf_t is not an alias to float.
#if !defined(KOKKOSKERNELS_ETI_ONLY) && \
!defined(KOKKOSKERNELS_IMPL_CHECK_ETI_CALLS) && \
defined(KOKKOS_BHALF_T_IS_FLOAT) && !KOKKOS_BHALF_T_IS_FLOAT
/********************* BatchLayout::Left *********************/
TEST_F(TestCategory, batched_scalar_batched_gemm_nt_nt_bhalf_bhalf_left) {
typedef ::Test::SharedParamTag<Trans::NoTranspose, Trans::NoTranspose,
Expand Down Expand Up @@ -98,7 +103,11 @@ TEST_F(TestCategory, batched_scalar_batched_gemm_t_t_bhalf_bhalf_right) {
}
#endif // KOKKOS_BHALF_T_IS_FLOAT

#if defined(KOKKOS_HALF_T_IS_FLOAT)
// We do not ETI half-types. Only test this if ETI ONLY is off
// and half_t is not an alias to float.
#if !defined(KOKKOSKERNELS_ETI_ONLY) && \
!defined(KOKKOSKERNELS_IMPL_CHECK_ETI_CALLS) && \
defined(KOKKOS_HALF_T_IS_FLOAT) && !KOKKOS_HALF_T_IS_FLOAT
/********************* BatchLayout::Left *********************/
TEST_F(TestCategory, batched_scalar_batched_gemm_nt_nt_half_half_left) {
typedef ::Test::SharedParamTag<Trans::NoTranspose, Trans::NoTranspose,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
//@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
#define KOKKOSKERNELS_IMPL_COMPILE_LIBRARY true
#include "KokkosBatched_Gemm_Decl.hpp"
namespace KokkosBatched {
namespace Impl {
using KokkosBlas::Trans;
@BATCHED_GEMM_NT_NT_BLL_ETI_INST_BLOCK@
} // namespace Impl
} // namespace KokkosBatched
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
//@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
#define KOKKOSKERNELS_IMPL_COMPILE_LIBRARY true
#include "KokkosBatched_Gemm_Decl.hpp"
namespace KokkosBatched {
namespace Impl {
using KokkosBlas::Trans;
@BATCHED_GEMM_NT_NT_BLR_ETI_INST_BLOCK@
} // namespace Impl
} // namespace KokkosBatched
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
//@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
#define KOKKOSKERNELS_IMPL_COMPILE_LIBRARY true
#include "KokkosBatched_Gemm_Decl.hpp"
namespace KokkosBatched {
namespace Impl {
using KokkosBlas::Trans;
@BATCHED_GEMM_NT_T_BLL_ETI_INST_BLOCK@
} // namespace Impl
} // namespace KokkosBatched
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
//@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
#define KOKKOSKERNELS_IMPL_COMPILE_LIBRARY true
#include "KokkosBatched_Gemm_Decl.hpp"
namespace KokkosBatched {
namespace Impl {
using KokkosBlas::Trans;
@BATCHED_GEMM_NT_T_BLR_ETI_INST_BLOCK@
} // namespace Impl
} // namespace KokkosBatched
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
//@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
#define KOKKOSKERNELS_IMPL_COMPILE_LIBRARY true
#include "KokkosBatched_Gemm_Decl.hpp"
namespace KokkosBatched {
namespace Impl {
using KokkosBlas::Trans;
@BATCHED_GEMM_T_NT_BLL_ETI_INST_BLOCK@
} // namespace Impl
} // namespace KokkosBatched
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
//@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
#define KOKKOSKERNELS_IMPL_COMPILE_LIBRARY true
#include "KokkosBatched_Gemm_Decl.hpp"
namespace KokkosBatched {
namespace Impl {
using KokkosBlas::Trans;
@BATCHED_GEMM_T_NT_BLR_ETI_INST_BLOCK@
} // namespace Impl
} // namespace KokkosBatched
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
//@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
#define KOKKOSKERNELS_IMPL_COMPILE_LIBRARY true
#include "KokkosBatched_Gemm_Decl.hpp"
namespace KokkosBatched {
namespace Impl {
using KokkosBlas::Trans;
@BATCHED_GEMM_T_T_BLL_ETI_INST_BLOCK@
} // namespace Impl
} // namespace KokkosBatched
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
//@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
#define KOKKOSKERNELS_IMPL_COMPILE_LIBRARY true
#include "KokkosBatched_Gemm_Decl.hpp"
namespace KokkosBatched {
namespace Impl {
using KokkosBlas::Trans;
@BATCHED_GEMM_T_T_BLR_ETI_INST_BLOCK@
} // namespace Impl
} // namespace KokkosBatched
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
1 change: 1 addition & 0 deletions graph/impl/KokkosGraph_Distance2MIS_impl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -829,6 +829,7 @@ struct D2_MIS_FixedPriority {
InitWorklistFunctor(worklist1));
lno_t workRemain = numVerts;
int numIter = 0;
(void)numIter;
while (workRemain) {
// do another iteration
Kokkos::parallel_for(
Expand Down

0 comments on commit 62c5044

Please sign in to comment.