Debian Codegraph @

packages/kokkos-kernels/perf_test/batched/dense/do-not-use/KokkosBatched_Test_Gemv_Host_Real.cpp

raw
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_Gemv_Host_Real 1
19 #include "KokkosBatched_Test_Gemv_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);
28
29 // PerfTest::Gemv< 4, 1, ExecSpace,AlgoTagType>(N);
30 // PerfTest::Gemv< 8, 1, ExecSpace,AlgoTagType>(N);
31 // PerfTest::Gemv<16, 1, ExecSpace,AlgoTagType>(N);
32 // PerfTest::Gemv<20, 1, ExecSpace,AlgoTagType>(N);
33 // PerfTest::Gemv<32, 1, ExecSpace,AlgoTagType>(N);
34 // PerfTest::Gemv<64, 1, ExecSpace,AlgoTagType>(N);
35
36 PerfTest::Gemv<3, 1, HostSpaceType, AlgoTagType>(N);
37 PerfTest::Gemv<5, 1, HostSpaceType, AlgoTagType>(N);
38 PerfTest::Gemv<10, 1, HostSpaceType, AlgoTagType>(N);
39 PerfTest::Gemv<15, 1, HostSpaceType, AlgoTagType>(N);
40 }
41
42 int main(int argc, char *argv[]) {
43 Kokkos::initialize(argc, argv);
44 #if !defined(__CUDA_ARCH__) && !defined(__HIP_DEVICE_COMPILE__)
45 const int ntest = 1;
46 // const int N[6] = { 256, 512, 768, 1024, 1280, 1536 };
47 const int N[1] = {128 * 128};
48
49 {
50 for (int i = 0; i < ntest; ++i) {
51 std::cout << " N = " << N[i] << std::endl;
52
53 std::cout << "\n Testing Algo::Gemv::Unblocked\n";
54 run<Algo::Gemv::Unblocked>(N[i]);
55
56 std::cout << "\n Testing Algo::Gemv::Blocked\n";
57 run<Algo::Gemv::Blocked>(N[i]);
58 }
59 }
60 #endif
61 Kokkos::finalize();
62
63 return 0;
64 }