GENIE
config.h
Go to the documentation of this file.
1 #ifndef GENIE_INTERFACE_CONFIG_H_
2 #define GENIE_INTERFACE_CONFIG_H_
3 
4 #include <iostream>
5 #include <string>
6 
7 namespace genie {
8 
20 class Config {
21  private:
22  uint32_t k_;
23  uint32_t query_range_;
24  uint32_t num_of_queries_;
25  bool save_to_gpu_ = false;
26  uint8_t gpu_id_ = 0;
27  bool k_initialized_ = false;
28  bool query_range_initialized_ = false;
29  bool num_of_queries_initialized_ = false;
30  public:
34  uint32_t GetK() const;
38  uint32_t GetQueryRange() const;
42  uint32_t GetNumOfQueries() const;
46  bool GetSaveToGpu() const;
50  uint8_t GetGpuId() const;
54  Config& SetK(const uint32_t k);
58  Config& SetQueryRange(const uint32_t query_range);
62  Config& SetNumOfQueries(const uint32_t num_of_queries);
66  Config& SetSaveToGpu(const bool save_to_gpu);
70  Config& SetGpuId(const uint8_t gpu_id);
74  Config& LoadFromFile(const std::string& filename);
78  bool IsKSet() const;
82  bool IsQueryRangeSet() const;
86  bool IsNumOfQueriesSet() const;
90  void Validate() const;
94  void DisplayConfiguration();
95 };
96 
97 } // end of namespace genie
98 
99 #endif
Config & SetGpuId(const uint8_t gpu_id)
Set the ID of the GPU used.
Definition: config.cc:62
uint8_t GetGpuId() const
Return the ID of the GPU used.
Definition: config.cc:30
This is the top-level namespace of the project.
Config & SetNumOfQueries(const uint32_t num_of_queries)
Set the number of query to search.
Definition: config.cc:49
Config & SetQueryRange(const uint32_t query_range)
Set the range used in range-based search.
Definition: config.cc:42
void Validate() const
Validate that all required options are set.
Definition: config.cc:88
uint32_t GetK() const
Return K.
Definition: config.cc:10
Config & SetSaveToGpu(const bool save_to_gpu)
Set whether table should be saved to GPU after search.
Definition: config.cc:56
uint32_t GetQueryRange() const
Return the range used in range-based search.
Definition: config.cc:15
void DisplayConfiguration()
Display enabled configuration options.
Definition: config.cc:96
Config & SetK(const uint32_t k)
Set k.
Definition: config.cc:35
Config class holds all user configurable settings of GENIE.
Definition: config.h:20
Config & LoadFromFile(const std::string &filename)
Load configuration from a file.
Definition: config.cc:68
bool IsNumOfQueriesSet() const
Return whether the number of query has been set.
Definition: config.cc:83
bool IsQueryRangeSet() const
Return whether the query range has been set.
Definition: config.cc:78
bool GetSaveToGpu() const
Return whether table should be saved to GPU after search.
Definition: config.cc:25
uint32_t GetNumOfQueries() const
Return the number of query to search.
Definition: config.cc:20
bool IsKSet() const
Return whether K has been set.
Definition: config.cc:73