| 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 |
// Created by Poliakoff, David Zoeller on 4/26/21. |
| 18 |
// |
| 19 |
#ifndef KOKKOSKERNELS_BLAS3_TRACKED_TESTING_HPP |
| 20 |
#define KOKKOSKERNELS_BLAS3_TRACKED_TESTING_HPP |
| 21 |
|
| 22 |
#include <common/RAJAPerfSuite.hpp> |
| 23 |
#include <common/Executor.hpp> |
| 24 |
|
| 25 |
#include "KokkosBlas3_gemm_tracked_perf_test.hpp" |
| 26 |
|
| 27 |
/* |
| 28 |
*Three cases to test: |
| 29 |
* |
| 30 |
* 1) m = n = k |
| 31 |
* 2) one case for m, n, k all pretty large, |
| 32 |
* 3) and another for m, k small but n large |
| 33 |
* |
| 34 |
* You could use m = k = 5, n = 1 million or something like that for dot based |
| 35 |
* gemm |
| 36 |
* |
| 37 |
*/ |
| 38 |
|
| 39 |
namespace test { |
| 40 |
namespace blas3 { |
| 41 |
|
| 42 |
// Change n and k values in the context of the backend |
| 43 |
template <class ExecSpace> |
| 44 |
std::vector<gemmConfig> create_m_n_k_vect() { |
| 45 |
std::string exec_space_name = ExecSpace::name(); |
| 46 |
|
| 47 |
return { |
| 48 |
|
| 49 |
// m = n = k; one case for m, n, k all pretty large, |
| 50 |
{1000, 1000, 1000}, |
| 51 |
// and another for m, k small but n large |
| 52 |
{5, 1000000, 5}}; |
| 53 |
} |
| 54 |
|
| 55 |
// Register kernels for a specific test |
| 56 |
void build_gemm_executor(rajaperf::Executor& exec, int argc, char* argv[], const rajaperf::RunParams& params) { |
| 57 |
for (auto* kernel : construct_gemm_kernel_base(params, create_m_n_k_vect<Kokkos::DefaultExecutionSpace>())) { |
| 58 |
exec.registerKernel("BLAS3", kernel); |
| 59 |
} |
| 60 |
} |
| 61 |
|
| 62 |
void build_blas3_executor(rajaperf::Executor& exec, int argc, char* argv[], const rajaperf::RunParams& params) { |
| 63 |
exec.registerGroup("BLAS3"); |
| 64 |
build_gemm_executor(exec, argc, argv, params); |
| 65 |
} |
| 66 |
|
| 67 |
} // namespace blas3 |
| 68 |
} // namespace test |
| 69 |
|
| 70 |
#endif // KOKKOSKERNELS_TRACKED_TESTING_HPP |