summaryrefslogtreecommitdiff
path: root/include/internal/tuning.h
blob: 7768888c270326eb50cc27f308a9cdd7cb831b1a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
// =================================================================================================
// This file is part of the CLBlast project. The project is licensed under Apache Version 2.0. This
// project loosely follows the Google C++ styleguide and uses a tab-size of two spaces and a max-
// width of 100 characters per line.
//
// Author(s):
//   Cedric Nugteren <www.cedricnugteren.nl>
//
// This file implements the header for the tuner functions. This is only used for the optional
// and stand-alone tuner binaries and not part of the core of CLBlast. The convention used here is
// that X and Y are vectors, while A, B, and C are matrices.
//
// =================================================================================================

#ifndef CLBLAST_TUNING_H_
#define CLBLAST_TUNING_H_

#include <vector>
#include <functional>

#include <cltune.h>

namespace clblast {
// =================================================================================================

// Functions with two or three OpenCL memory buffers
template <typename T>
using Tuner2 = std::function<void(const Arguments<T>&,
                                  const std::vector<T>&, std::vector<T>&,
                                  cltune::Tuner&)>;
template <typename T>
using Tuner3 = std::function<void(const Arguments<T>&,
                                  const std::vector<T>&, const std::vector<T>&, std::vector<T>&,
                                  cltune::Tuner&)>;

// Tuner for vector-vector input
template <typename T>
void TunerXY(int argc, char* argv[], const Tuner2<T> &tune_function);

// Tuner for matrix-matrix input
template <typename T>
void TunerAB(int argc, char* argv[], const Tuner2<T> &tune_function);

// Tuner for matrix-matrix-matrix input
template <typename T>
void TunerABC(int argc, char* argv[], const Tuner3<T> &tune_function);

// =================================================================================================
} // namespace clblast

// CLBLAST_TUNING_H_
#endif