Skip to content

Commit

Permalink
ETI: adding more decl files to eti
Browse files Browse the repository at this point in the history
Now all the sparse kernels have an ETI decl file to prevent
multiple template instantiation.
  • Loading branch information
lucbv committed Aug 1, 2024
1 parent ea899a3 commit f77c66b
Show file tree
Hide file tree
Showing 33 changed files with 464 additions and 16 deletions.
15 changes: 6 additions & 9 deletions cmake/kokkoskernels_eti.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -177,16 +177,13 @@ MACRO(KOKKOSKERNELS_GENERATE_ETI FUNCTION_NAME SUBFOLDER)

LIST(APPEND ${ETI_HEADER_LIST} ${CMAKE_CURRENT_BINARY_DIR}/${AVAIL_HEADER})

STRING(FIND "Sparse_sptrsv_symbolic;Sparse_sptrsv_solve;Sparse_trsv;Sparse_spmv;Sparse_spmv_mv;Sparse_spmv_bsrmatrix;Sparse_spmv_mv_bsrmatrix" ${FUNCTION_NAME} DO_DECL)
IF(DO_DECL GREATER -1)
SET(DECL_HEADER "${ETI_COMPONENTS}/eti/generated_specializations_hpp/Kokkos${FUNCTION_NAME}_eti_spec_decl.hpp")
SET(DECL_TEMPLATE "${DECL_HEADER}.in")
SET(DECL_HEADER "${ETI_COMPONENTS}/eti/generated_specializations_hpp/Kokkos${FUNCTION_NAME}_eti_spec_decl.hpp")
SET(DECL_TEMPLATE "${DECL_HEADER}.in")

STRING(REPLACE ";" "\n" ${UPPER_NAME}_ETI_DECL_BLOCK "${${UPPER_NAME}_ETI_DECL_LIST}")
STRING(REPLACE ";" "\n" ${UPPER_NAME}_ETI_DECL_BLOCK "${${UPPER_NAME}_ETI_DECL_LIST}")

CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/${DECL_TEMPLATE}
${CMAKE_CURRENT_BINARY_DIR}/${DECL_HEADER})
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/${DECL_TEMPLATE}
${CMAKE_CURRENT_BINARY_DIR}/${DECL_HEADER})

LIST(APPEND ${ETI_HEADER_LIST} ${CMAKE_CURRENT_BINARY_DIR}/${DECL_HEADER})
ENDIF()
LIST(APPEND ${ETI_HEADER_LIST} ${CMAKE_CURRENT_BINARY_DIR}/${DECL_HEADER})
ENDMACRO(KOKKOSKERNELS_GENERATE_ETI)
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
//@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 KOKKOSSPARSE_BSPGEMM_NUMERIC_ETI_SPEC_DECL_HPP_
#define KOKKOSSPARSE_BSPGEMM_NUMERIC_ETI_SPEC_DECL_HPP_
namespace KokkosSparse {
namespace Impl {
@SPARSE_BSPGEMM_NUMERIC_ETI_DECL_BLOCK@
} //IMPL
} //Kokkos
#endif
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
//@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 KOKKOSSPARSE_GAUSS_SEIDEL_APPLY_ETI_SPEC_DECL_HPP_
#define KOKKOSSPARSE_GAUSS_SEIDEL_APPLY_ETI_SPEC_DECL_HPP_
namespace KokkosSparse {
namespace Impl {
@SPARSE_GAUSS_SEIDEL_APPLY_ETI_DECL_BLOCK@
} //IMPL
} //Kokkos
#endif
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
//@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 KOKKOSSPARSE_GAUSS_SEIDEL_NUMERIC_ETI_SPEC_DECL_HPP_
#define KOKKOSSPARSE_GAUSS_SEIDEL_NUMERIC_ETI_SPEC_DECL_HPP_
namespace KokkosSparse {
namespace Impl {
@SPARSE_GAUSS_SEIDEL_NUMERIC_ETI_DECL_BLOCK@
} //IMPL
} //Kokkos
#endif
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
//@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 KOKKOSSPARSE_GAUSS_SEIDEL_SYMBOLIC_ETI_SPEC_DECL_HPP_
#define KOKKOSSPARSE_GAUSS_SEIDEL_SYMBOLIC_ETI_SPEC_DECL_HPP_
namespace KokkosSparse {
namespace Impl {
@SPARSE_GAUSS_SEIDEL_SYMBOLIC_ETI_DECL_BLOCK@
} //IMPL
} //Kokkos
#endif
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#ifndef KOKKOSSPARSE_GMRES_ETI_SPEC_AVAIL_HPP_
#define KOKKOSSPARSE_GMRES_ETI_SPEC_AVAIL_HPP_
/*
//@HEADER
// ************************************************************************
Expand All @@ -18,11 +16,11 @@
//@HEADER
*/

#ifndef KOKKOSSPARSE_GMRES_ETI_SPEC_AVAIL_HPP_
#define KOKKOSSPARSE_GMRES_ETI_SPEC_AVAIL_HPP_
namespace KokkosSparse {
namespace Impl {

@SPARSE_GMRES_ETI_AVAIL_BLOCK@

} // Impl
} // KokkosSparse
#endif // KOKKOSSPARSE_GMRES_ETI_SPEC_AVAIL_HPP_
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
/*
//@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 KOKKOSSPARSE_GMRES_ETI_SPEC_DECL_HPP_
#define KOKKOSSPARSE_GMRES_ETI_SPEC_DECL_HPP_
namespace KokkosSparse {
namespace Impl {
@SPARSE_GMRES_ETI_DECL_BLOCK@
} // Impl
} // KokkosSparse
#endif // KOKKOSSPARSE_GMRES_ETI_SPEC_DECL_HPP_
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
//@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 KOKKOSSPARSE_PAR_ILUT_NUMERIC_ETI_SPEC_DECL_HPP_
#define KOKKOSSPARSE_PAR_ILUT_NUMERIC_ETI_SPEC_DECL_HPP_
namespace KokkosSparse {
namespace Impl {

@SPARSE_PAR_ILUT_NUMERIC_ETI_DECL_BLOCK@

} // Impl
} // KokkosSparse
#endif // KOKKOSSPARSE_PAR_ILUT_NUMERIC_ETI_SPEC_DECL_HPP_
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
//@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 KOKKOSSPARSE_PAR_ILUT_SYMBOLIC_ETI_SPEC_DECL_HPP_
#define KOKKOSSPARSE_PAR_ILUT_SYMBOLIC_ETI_SPEC_DECL_HPP_
namespace KokkosSparse {
namespace Impl {

@SPARSE_PAR_ILUT_SYMBOLIC_ETI_DECL_BLOCK@

} // Impl
} // KokkosSparse
#endif // KOKKOSSPARSE_PAR_ILUT_SYMBOLIC_ETI_SPEC_DECL_HPP_
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
//@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 KOKKOSSPARSE_SPADD_NUMERIC_ETI_SPEC_DECL_HPP_
#define KOKKOSSPARSE_SPADD_NUMERIC_ETI_SPEC_DECL_HPP_
namespace KokkosSparse {
namespace Impl {
@SPARSE_SPADD_NUMERIC_ETI_DECL_BLOCK@
} //IMPL
} //Kokkos
#endif
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
//@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 KOKKOSSPARSE_SPADD_SYMBOLIC_ETI_SPEC_DECL_HPP_
#define KOKKOSSPARSE_SPADD_SYMBOLIC_ETI_SPEC_DECL_HPP_
namespace KokkosSparse {
namespace Impl {
@SPARSE_SPADD_SYMBOLIC_ETI_DECL_BLOCK@
} //IMPL
} //Kokkos
#endif
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
//@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 KOKKOSSPARSE_SPGEMM_JACOBI_ETI_SPEC_DECL_HPP_
#define KOKKOSSPARSE_SPGEMM_JACOBI_ETI_SPEC_DECL_HPP_

namespace KokkosSparse {
namespace Impl {
@SPARSE_SPGEMM_JACOBI_ETI_DECL_BLOCK@
} //IMPL
} //Kokkos
#endif
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
//@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 KOKKOSSPARSE_SPGEMM_NOREUSE_ETI_SPEC_DECL_HPP_
#define KOKKOSSPARSE_SPGEMM_NOREUSE_ETI_SPEC_DECL_HPP_
namespace KokkosSparse {
namespace Impl {
@SPARSE_SPGEMM_NOREUSE_ETI_DECL_BLOCK@
} //IMPL
} //Kokkos
#endif
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
//@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 KOKKOSSPARSE_SPGEMM_NUMERIC_ETI_SPEC_DECL_HPP_
#define KOKKOSSPARSE_SPGEMM_NUMERIC_ETI_SPEC_DECL_HPP_
namespace KokkosSparse {
namespace Impl {
@SPARSE_SPGEMM_NUMERIC_ETI_DECL_BLOCK@
} //IMPL
} //Kokkos
#endif
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
//@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 KOKKOSSPARSE_SPGEMM_SYMBOLIC_ETI_SPEC_DECL_HPP_
#define KOKKOSSPARSE_SPGEMM_SYMBOLIC_ETI_SPEC_DECL_HPP_
namespace KokkosSparse {
namespace Impl {
@SPARSE_SPGEMM_SYMBOLIC_ETI_DECL_BLOCK@
} //IMPL
} //Kokkos
#endif
Loading

0 comments on commit f77c66b

Please sign in to comment.