QUDA  v1.1.0
A library for QCD on GPUs
tune_key.h
Go to the documentation of this file.
1 #ifndef _TUNE_KEY_H
2 #define _TUNE_KEY_H
3 
4 #include <cstring>
5 
6 namespace quda {
7 
8  struct TuneKey {
9 
10  static const int volume_n = 32;
11  static const int name_n = 512;
12  static const int aux_n = 256;
14  char name[name_n];
15  char aux[aux_n];
16 
17  TuneKey() { }
18  TuneKey(const char v[], const char n[], const char a[]="type=default") {
19  strcpy(volume, v);
20  strcpy(name, n);
21  strcpy(aux, a);
22  }
23  TuneKey(const TuneKey &key) {
24  strcpy(volume,key.volume);
25  strcpy(name,key.name);
26  strcpy(aux,key.aux);
27  }
28 
29  TuneKey& operator=(const TuneKey &key) {
30  if (&key != this) {
31  strcpy(volume,key.volume);
32  strcpy(name,key.name);
33  strcpy(aux,key.aux);
34  }
35  return *this;
36  }
37 
38  bool operator<(const TuneKey &other) const {
39  int vc = std::strcmp(volume, other.volume);
40  if (vc < 0) {
41  return true;
42  } else if (vc == 0) {
43  int nc = std::strcmp(name, other.name);
44  if (nc < 0) {
45  return true;
46  } else if (nc == 0) {
47  return (std::strcmp(aux, other.aux) < 0 ? true : false);
48  }
49  }
50  return false;
51  }
52 
53  };
54 
55 }
56 
59 
60 #endif
static const int aux_n
Definition: tune_key.h:12
TuneKey(const TuneKey &key)
Definition: tune_key.h:23
char volume[volume_n]
Definition: tune_key.h:13
char name[name_n]
Definition: tune_key.h:14
TuneKey(const char v[], const char n[], const char a[]="type=default")
Definition: tune_key.h:18
static const int volume_n
Definition: tune_key.h:10
TuneKey & operator=(const TuneKey &key)
Definition: tune_key.h:29
bool operator<(const TuneKey &other) const
Definition: tune_key.h:38
static const int name_n
Definition: tune_key.h:11
char aux[aux_n]
Definition: tune_key.h:15
quda::TuneKey getLastTuneKey()
Definition: tune.cpp:30