FTransformBench.h
1 //-*-C++-*-
2 /***************************************************************************
3  *
4  * Copyright (C) 2009 by Willem van Straten
5  * Licensed under the Academic Free License version 2.1
6  *
7  ***************************************************************************/
8 
9 #ifndef __FTransformBench_h_
10 #define __FTransformBench_h_
11 
12 #include "FTransform.h"
13 
14 namespace FTransform {
15 
17  class Bench : public Reference::Able
18  {
19  public:
20 
21  static bool verbose;
22 
24  Bench ();
25 
27  void set_path (const std::string& path);
28 
30  void set_nthread (unsigned nthread);
31 
33  unsigned get_max_nfft () const;
34 
35  class Entry;
36 
38  Entry get_best (unsigned nfft) const;
39 
40  protected:
41 
43  mutable std::vector<Entry> entries;
44  mutable unsigned max_nfft;
45  mutable bool loaded;
46 
47  std::string path;
48  unsigned nthread;
49 
50  void reset ();
51 
52  virtual void load () const;
53  virtual void load (const std::string& library,
54  const std::string& filename) const;
55  };
56 
57  class Bench::Entry
58  {
59  public:
60  std::string library;
61  unsigned nfft;
62  double cost;
63 
64  Entry () { nfft = 0; cost = 0.0; }
65  };
66 }
67 
68 #endif
std::string get_library_name(unsigned i)
Get the name of the ith available library.
Definition: FTransform.C:158
void set_nthread(unsigned nthread)
Set the number of threads for which benchmarks will be loaded.
Definition: FTransformBench.C:34
A convenient exception handling class.
Definition: Error.h:54
Bench()
Construct from installed benchmarks.
Definition: FTransformBench.C:18
Entry get_best(unsigned nfft) const
Get the best FFT cost for the specified transform length.
Definition: FTransformBench.C:122
Manages Reference::To references to the instance.
Definition: ReferenceAble.h:40
unsigned get_num_libraries()
Get the number of available libraries.
Definition: FTransform.C:152
unsigned get_max_nfft() const
Get the maximum FFT length measured.
Definition: FTransformBench.C:48
void set_path(const std::string &path)
Set the patch from which benchmarks will be loaded.
Definition: FTransformBench.C:27
const std::string get_message() const
Get the error message.
Definition: Error.C:133
std::vector< Entry > entries
Database entries.
Definition: FTransformBench.h:53
unsigned nthread
Number of threads that will use the plan.
Definition: FTransform.C:19
Defines a single interface to a variety of Fourier transform libraries.
Definition: FFTW3_Transform.h:14

Generated using doxygen 1.8.17