| 1 |
//@HEADER |
| 2 |
// ************************************************************************ |
| 3 |
// |
| 4 |
// Kokkos v. 4.0 |
| 5 |
// Copyright (2022) National Technology & Engineering |
| 6 |
// Solutions of Sandia, LLC (NTESS). |
| 7 |
// |
| 8 |
// Under the terms of Contract DE-NA0003525 with NTESS, |
| 9 |
// the U.S. Government retains certain rights in this software. |
| 10 |
// |
| 11 |
// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. |
| 12 |
// See https://kokkos.org/LICENSE for license information. |
| 13 |
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception |
| 14 |
// |
| 15 |
//@HEADER |
| 16 |
|
| 17 |
#ifndef KOKKOSBLAS1_AXPBY_TPL_SPEC_AVAIL_HPP_ |
| 18 |
#define KOKKOSBLAS1_AXPBY_TPL_SPEC_AVAIL_HPP_ |
| 19 |
|
| 20 |
namespace KokkosBlas { |
| 21 |
namespace Impl { |
| 22 |
// Specialization struct which defines whether a specialization exists |
| 23 |
template <class execution_space, class AV, class XMV, class BV, class YMV, int rank = YMV::rank> |
| 24 |
struct axpby_tpl_spec_avail { |
| 25 |
enum : bool { value = false }; |
| 26 |
}; |
| 27 |
} // namespace Impl |
| 28 |
} // namespace KokkosBlas |
| 29 |
|
| 30 |
namespace KokkosBlas { |
| 31 |
namespace Impl { |
| 32 |
|
| 33 |
// Generic Host side BLAS (could be MKL or whatever) |
| 34 |
#ifdef KOKKOSKERNELS_ENABLE_TPL_BLAS |
| 35 |
|
| 36 |
#define KOKKOSBLAS1_AXPBY_TPL_SPEC_AVAIL_BLAS(SCALAR, LAYOUT, MEMSPACE) \ |
| 37 |
template <class ExecSpace> \ |
| 38 |
struct axpby_tpl_spec_avail< \ |
| 39 |
ExecSpace, SCALAR, \ |
| 40 |
Kokkos::View<const SCALAR*, LAYOUT, Kokkos::Device<ExecSpace, MEMSPACE>, \ |
| 41 |
Kokkos::MemoryTraits<Kokkos::Unmanaged> >, \ |
| 42 |
SCALAR, \ |
| 43 |
Kokkos::View<SCALAR*, LAYOUT, Kokkos::Device<ExecSpace, MEMSPACE>, Kokkos::MemoryTraits<Kokkos::Unmanaged> >, \ |
| 44 |
1> { \ |
| 45 |
enum : bool { value = true }; \ |
| 46 |
}; |
| 47 |
|
| 48 |
KOKKOSBLAS1_AXPBY_TPL_SPEC_AVAIL_BLAS(double, Kokkos::LayoutLeft, Kokkos::HostSpace) |
| 49 |
KOKKOSBLAS1_AXPBY_TPL_SPEC_AVAIL_BLAS(float, Kokkos::LayoutLeft, Kokkos::HostSpace) |
| 50 |
KOKKOSBLAS1_AXPBY_TPL_SPEC_AVAIL_BLAS(Kokkos::complex<double>, Kokkos::LayoutLeft, Kokkos::HostSpace) |
| 51 |
KOKKOSBLAS1_AXPBY_TPL_SPEC_AVAIL_BLAS(Kokkos::complex<float>, Kokkos::LayoutLeft, Kokkos::HostSpace) |
| 52 |
|
| 53 |
#endif |
| 54 |
|
| 55 |
// cuBLAS |
| 56 |
#ifdef KOKKOSKERNELS_ENABLE_TPL_CUBLAS |
| 57 |
|
| 58 |
#define KOKKOSBLAS1_AXPBY_TPL_SPEC_AVAIL_CUBLAS(SCALAR, LAYOUT, MEMSPACE) \ |
| 59 |
template <class ExecSpace> \ |
| 60 |
struct axpby_tpl_spec_avail< \ |
| 61 |
ExecSpace, SCALAR, \ |
| 62 |
Kokkos::View<const SCALAR*, LAYOUT, Kokkos::Device<ExecSpace, MEMSPACE>, \ |
| 63 |
Kokkos::MemoryTraits<Kokkos::Unmanaged> >, \ |
| 64 |
SCALAR, \ |
| 65 |
Kokkos::View<SCALAR*, LAYOUT, Kokkos::Device<ExecSpace, MEMSPACE>, Kokkos::MemoryTraits<Kokkos::Unmanaged> >, \ |
| 66 |
1> { \ |
| 67 |
enum : bool { value = true }; \ |
| 68 |
}; |
| 69 |
|
| 70 |
KOKKOSBLAS1_AXPBY_TPL_SPEC_AVAIL_CUBLAS(double, Kokkos::LayoutLeft, Kokkos::CudaSpace) |
| 71 |
KOKKOSBLAS1_AXPBY_TPL_SPEC_AVAIL_CUBLAS(float, Kokkos::LayoutLeft, Kokkos::CudaSpace) |
| 72 |
KOKKOSBLAS1_AXPBY_TPL_SPEC_AVAIL_CUBLAS(Kokkos::complex<double>, Kokkos::LayoutLeft, Kokkos::CudaSpace) |
| 73 |
KOKKOSBLAS1_AXPBY_TPL_SPEC_AVAIL_CUBLAS(Kokkos::complex<float>, Kokkos::LayoutLeft, Kokkos::CudaSpace) |
| 74 |
|
| 75 |
#endif |
| 76 |
} // namespace Impl |
| 77 |
} // namespace KokkosBlas |
| 78 |
#endif |