forked from kokkos/kokkos-kernels
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'develop' into jgfouca/block_sptrsv2
* develop: (32 commits) Bigger sptrsv cleanup (kokkos#2280) init (kokkos#2273) Unify alignPtrTo implementation (kokkos#2275) Sycl gemv beta (kokkos#2276) Sparse - SpMV: removing calls to unsuported oneapi - MKL functions (kokkos#2274) A little sptrsv cleanup before the main block effort (kokkos#2247) Implement batched serial pttrf (kokkos#2256) BLAS - gemv: using fallback when mode is 't' or 'c' and onemkl is used (kokkos#2272) Workarounds for removed cusparse functions (kokkos#2270) handle_t* -> unique_ptr<handle_t> in Bsr SpMV unit tests (kokkos#2269) Bump actions/upload-artifact from 4.3.3 to 4.3.4 (kokkos#2266) Help gcc/8.3 with ctad issue sycl: use alternative `alignPtrTo` when SYCL is enabled (SpGEMM) (kokkos#2262) sparse: spadd_symbolic fences before device values used on host (kokkos#2259) Bump github/codeql-action from 3.25.10 to 3.25.11 (kokkos#2263) Rename `Impl::alignPtr` to `Impl::alignPtrTo`, allow it to infer argument type (kokkos#2261) sparse: replace macros with constexpr bools (kokkos#2260) spgemm: add profiling regions to native implementations (kokkos#2253) RCM fixes, improvements (kokkos#2254) Fix warning about memcpy (kokkos#2252) ...
- Loading branch information
Showing
68 changed files
with
3,440 additions
and
1,530 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
//@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 KOKKOSBATCHED_PTTRF_SERIAL_IMPL_HPP_ | ||
#define KOKKOSBATCHED_PTTRF_SERIAL_IMPL_HPP_ | ||
|
||
#include <KokkosBatched_Util.hpp> | ||
#include "KokkosBatched_Pttrf_Serial_Internal.hpp" | ||
|
||
/// \author Yuuichi Asahi (yuuichi.asahi@cea.fr) | ||
|
||
namespace KokkosBatched { | ||
|
||
template <typename DViewType, typename EViewType> | ||
KOKKOS_INLINE_FUNCTION static int checkPttrfInput( | ||
[[maybe_unused]] const DViewType &d, [[maybe_unused]] const EViewType &e) { | ||
static_assert(Kokkos::is_view<DViewType>::value, | ||
"KokkosBatched::pttrf: DViewType is not a Kokkos::View."); | ||
static_assert(Kokkos::is_view<EViewType>::value, | ||
"KokkosBatched::pttrf: EViewType is not a Kokkos::View."); | ||
|
||
static_assert(DViewType::rank == 1, | ||
"KokkosBatched::pttrf: DViewType must have rank 1."); | ||
static_assert(EViewType::rank == 1, | ||
"KokkosBatched::pttrf: EViewType must have rank 1."); | ||
|
||
#if (KOKKOSKERNELS_DEBUG_LEVEL > 0) | ||
const int nd = d.extent(0); | ||
const int ne = e.extent(0); | ||
|
||
if (ne + 1 != nd) { | ||
Kokkos::printf( | ||
"KokkosBatched::pttrf: Dimensions of d and e do not match: d: %d, e: " | ||
"%d \n" | ||
"e.extent(0) must be equal to d.extent(0) - 1\n", | ||
nd, ne); | ||
return 1; | ||
} | ||
#endif | ||
return 0; | ||
} | ||
|
||
template <> | ||
struct SerialPttrf<Algo::Pttrf::Unblocked> { | ||
template <typename DViewType, typename EViewType> | ||
KOKKOS_INLINE_FUNCTION static int invoke(const DViewType &d, | ||
const EViewType &e) { | ||
// Quick return if possible | ||
if (d.extent(0) == 0) return 0; | ||
if (d.extent(0) == 1) return (d(0) < 0 ? 1 : 0); | ||
|
||
auto info = checkPttrfInput(d, e); | ||
if (info) return info; | ||
|
||
return SerialPttrfInternal<Algo::Pttrf::Unblocked>::invoke( | ||
d.extent(0), d.data(), d.stride(0), e.data(), e.stride(0)); | ||
} | ||
}; | ||
} // namespace KokkosBatched | ||
|
||
#endif // KOKKOSBATCHED_PTTRF_SERIAL_IMPL_HPP_ |
Oops, something went wrong.