| 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 |
/// \author Kyungjoo Kim ([email protected]) |
| 17 |
|
| 18 |
#define KokkosBatched_Test_LU_Host_Real 1 |
| 19 |
#include "KokkosBatched_Test_LU_Host.hpp" |
| 20 |
|
| 21 |
using namespace KokkosBatched; |
| 22 |
|
| 23 |
template <typename AlgoTagType> |
| 24 |
void run(const int N) { |
| 25 |
typedef Kokkos::DefaultHostExecutionSpace HostSpaceType; |
| 26 |
|
| 27 |
Kokkos::print_configuration(std::cout, false); |
| 28 |
|
| 29 |
PerfTest::LU<3, HostSpaceType, AlgoTagType>(N); |
| 30 |
PerfTest::LU<5, HostSpaceType, AlgoTagType>(N); |
| 31 |
PerfTest::LU<10, HostSpaceType, AlgoTagType>(N); |
| 32 |
PerfTest::LU<15, HostSpaceType, AlgoTagType>(N); |
| 33 |
} |
| 34 |
|
| 35 |
int main(int argc, char* argv[]) { |
| 36 |
Kokkos::initialize(argc, argv); |
| 37 |
|
| 38 |
#if !defined(__CUDA_ARCH__) && !defined(__HIP_DEVICE_COMPILE__) |
| 39 |
int N = 128 * 128; |
| 40 |
|
| 41 |
for (int i = 1; i < argc; ++i) { |
| 42 |
const std::string& token = argv[i]; |
| 43 |
if (token == std::string("-N")) N = std::atoi(argv[++i]); |
| 44 |
} |
| 45 |
|
| 46 |
{ |
| 47 |
std::cout << " N = " << N << std::endl; |
| 48 |
|
| 49 |
std::cout << "\n Testing Algo::LU::Unblocked\n"; |
| 50 |
run<Algo::LU::Unblocked>(N); |
| 51 |
|
| 52 |
std::cout << "\n Testing Algo::LU::Blocked\n"; |
| 53 |
run<Algo::LU::Blocked>(N); |
| 54 |
|
| 55 |
#if defined(__KOKKOSBATCHED_INTEL_MKL_COMPACT_BATCHED__) |
| 56 |
std::cout << "\n Testing Algo::LU::CompactMKL\n"; |
| 57 |
run<Algo::Gemm::CompactMKL>(N); |
| 58 |
#endif |
| 59 |
} |
| 60 |
#endif |
| 61 |
|
| 62 |
Kokkos::finalize(); |
| 63 |
|
| 64 |
return 0; |
| 65 |
} |