| 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_Real 1 |
| 19 |
#include "KokkosBatched_Test_Gemm_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 |
// Test::Gemm< 4, AlgoTagType>(N); |
| 30 |
// Test::Gemm< 8, AlgoTagType>(N); |
| 31 |
// Test::Gemm<16, AlgoTagType>(N); |
| 32 |
// Test::Gemm<20, AlgoTagType>(N); |
| 33 |
// Test::Gemm<32, AlgoTagType>(N); |
| 34 |
// Test::Gemm<64, AlgoTagType>(N); |
| 35 |
|
| 36 |
PerfTest::Gemm<3, HostSpaceType, AlgoTagType>(N); |
| 37 |
PerfTest::Gemm<5, HostSpaceType, AlgoTagType>(N); |
| 38 |
PerfTest::Gemm<10, HostSpaceType, AlgoTagType>(N); |
| 39 |
PerfTest::Gemm<15, 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 |
int N[1] = {128 * 128}; |
| 48 |
|
| 49 |
for (int i = 1; i < argc; ++i) { |
| 50 |
const std::string& token = argv[i]; |
| 51 |
if (token == std::string("-N")) N[0] = std::atoi(argv[++i]); |
| 52 |
} |
| 53 |
|
| 54 |
{ |
| 55 |
for (int i = 0; i < ntest; ++i) { |
| 56 |
std::cout << " N = " << N[i] << std::endl; |
| 57 |
|
| 58 |
std::cout << "\n Testing Algo::Gemm::Unblocked\n"; |
| 59 |
run<Algo::Gemm::Unblocked>(N[i]); |
| 60 |
|
| 61 |
std::cout << "\n Testing Algo::Gemm::Blocked\n"; |
| 62 |
run<Algo::Gemm::Blocked>(N[i]); |
| 63 |
|
| 64 |
#if defined(__KOKKOSBATCHED_INTEL_MKL_COMPACT_BATCHED__) |
| 65 |
std::cout << "\n Testing Algo::Gemm::CompactMKL\n"; |
| 66 |
run<Algo::Gemm::CompactMKL>(N[i]); |
| 67 |
#endif |
| 68 |
} |
| 69 |
} |
| 70 |
|
| 71 |
#endif |
| 72 |
Kokkos::finalize(); |
| 73 |
|
| 74 |
return 0; |
| 75 |
} |