Debian Codegraph @

packages/kokkos-kernels/perf_test/batched/dense/do-not-use/KokkosBatched_Test_Gemm_Host_Complex.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_Gemm_Host_Complex 1
19
20 #include "KokkosBatched_Test_Gemm_Host.hpp"
21
22 using namespace KokkosBatched;
23
24 template <typename AlgoTagType>
25 void run(const int N) {
26 typedef Kokkos::DefaultHostExecutionSpace HostSpaceType;
27
28 Kokkos::print_configuration(std::cout);
29
30 // Test::Gemm< 4, AlgoTagType>(N);
31 // Test::Gemm< 8, AlgoTagType>(N);
32 // Test::Gemm<16, AlgoTagType>(N);
33 // Test::Gemm<20, AlgoTagType>(N);
34 // Test::Gemm<32, AlgoTagType>(N);
35 // Test::Gemm<64, AlgoTagType>(N);
36
37 PerfTest::Gemm<3, HostSpaceType, AlgoTagType>(N);
38 PerfTest::Gemm<5, HostSpaceType, AlgoTagType>(N);
39 PerfTest::Gemm<10, HostSpaceType, AlgoTagType>(N);
40 PerfTest::Gemm<15, HostSpaceType, AlgoTagType>(N);
41 }
42
43 int main(int argc, char* argv[]) {
44 Kokkos::initialize(argc, argv);
45
46 #if !defined(__CUDA_ARCH__) && !defined(__HIP_DEVICE_COMPILE__)
47 const int ntest = 1;
48 // const int N[6] = { 256, 512, 768, 1024, 1280, 1536 };
49 int N[1] = {128 * 128};
50
51 for (int i = 1; i < argc; ++i) {
52 const std::string& token = argv[i];
53 if (token == std::string("-N")) N[0] = std::atoi(argv[++i]);
54 }
55
56 {
57 std::cout << " KokkosKernels complex SIMD format is different from Intel "
58 "MKL compact format.\n";
59 std::cout << " Accuracy check is not meaningful. \n";
60 for (int i = 0; i < ntest; ++i) {
61 std::cout << " N = " << N[i] << std::endl;
62
63 std::cout << "\n Testing Algo::Gemm::Unblocked\n";
64 run<Algo::Gemm::Unblocked>(N[i]);
65
66 std::cout << "\n Testing Algo::Gemm::Blocked\n";
67 run<Algo::Gemm::Blocked>(N[i]);
68
69 #if defined(__KOKKOSBATCHED_INTEL_MKL_COMPACT_BATCHED__)
70 std::cout << "\n Testing Algo::Gemm::CompactMKL\n";
71 run<Algo::Gemm::CompactMKL>(N[i]);
72 #endif
73 }
74 }
75
76 #endif
77 Kokkos::finalize();
78
79 return 0;
80 }