summaryrefslogtreecommitdiff
path: root/src/database/database_structure.hpp
diff options
context:
space:
mode:
authorCedric Nugteren <web@cedricnugteren.nl>2017-09-06 21:50:42 +0200
committerCedric Nugteren <web@cedricnugteren.nl>2017-09-06 21:50:42 +0200
commit20da5e33a86eda746c17cbdb7bfd295d9f92f074 (patch)
treed35e7091ddc8bbd81d581c4bd49468c6329111fd /src/database/database_structure.hpp
parentbb947890dec90712c92028c20234eafd48e6fa3e (diff)
Split the database files over multiple directories and files; first step towards separate compilation
Diffstat (limited to 'src/database/database_structure.hpp')
-rw-r--r--src/database/database_structure.hpp58
1 files changed, 58 insertions, 0 deletions
diff --git a/src/database/database_structure.hpp b/src/database/database_structure.hpp
new file mode 100644
index 00000000..961ab239
--- /dev/null
+++ b/src/database/database_structure.hpp
@@ -0,0 +1,58 @@
+
+// =================================================================================================
+// 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 describes the database storage structures.
+//
+// =================================================================================================
+
+#ifndef CLBLAST_DATABASE_STRUCTURE_H_
+#define CLBLAST_DATABASE_STRUCTURE_H_
+
+#include <string>
+#include <vector>
+#include <unordered_map>
+
+namespace clblast {
+// A special namespace to hold all the global constant variables (including the database entries)
+namespace database {
+
+// =================================================================================================
+
+// The OpenCL device types
+const std::string kDeviceTypeCPU = "CPU";
+const std::string kDeviceTypeGPU = "GPU";
+const std::string kDeviceTypeAccelerator = "accelerator";
+const std::string kDeviceTypeAll = "default";
+
+// Type alias for the database parameters
+using Parameters = std::unordered_map<std::string, size_t>;
+
+// Structures for content inside the database
+struct DatabaseDevice {
+ std::string name;
+ std::vector<size_t> parameters; // parameter values
+};
+struct DatabaseVendor {
+ std::string type;
+ std::string name;
+ std::vector<DatabaseDevice> devices;
+};
+struct DatabaseEntry {
+ std::string kernel;
+ Precision precision;
+ std::vector<std::string> parameter_names;
+ std::vector<DatabaseVendor> vendors;
+};
+
+// =================================================================================================
+} // namespace database
+} // namespace clblast
+
+// CLBLAST_DATABASE_STRUCTURE_H_
+#endif